modules-1.1
by Thomas Diesler
Hi David,
some time ago we migrated the framework to modules-1.1. That hasn't made
it into AS7 so far. What's the plan?
cheers
-thomas
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
13 years, 4 months
Re: [jboss-as7-dev] [jboss-as] Added support for -b command-line binding functionality (#248)
by Brian Stansberry
Continuing the discussion from
https://github.com/jbossas/jboss-as/pull/248 on the regular dev list, so
it has higher visibility.
On 9/4/11 4:40 PM, dobozysaurus wrote:
> Yep, Bob's right - shorthand is great for usability. Right now in AS7, if you want to, say, bind the public interface to any address, instead of just using the -b arg as we've been using for a while now, users have to:
>
> 1. Open standalone.xml
> 2. Find the public logical interface XML configuration section.
> 3. Delete the<inet-address value="127.0.0.1" /> element
> 4. Add<any-address /> in its place.
>
> That's four steps where one existed before, and on step #4, it's not immediately obvious to them that they should now use<any-address /> instead of 0.0.0.0 for a wildcard binding.
>
> The new configuration model is super awesome, but little things like this definitely help people make the transition from previous AS versions to AS7.
>
First, thanks for the patch; I didn't say that before. :) Better
handling of "0.0.0.0" in the inet-address element is definitely needed.
So let's just assume any need for step #4 will go away.
To achieve the goal of controlling the external sockets of a standalone
server with a simple -b, the standard standalone*.xml configs we ship
would need to be modified like this:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address.public:127.0.0.1}"/>
</interface>
</interfaces>
A necessary precondition to that is the management console included in
master not barf if it queries the server and gets back a ModelNode of
ModelType.EXPRESSION instead of ModelType.STRING. Heiko/Stan, where does
that stand?
Once the console can support it, I think it's a good idea to have the
standard configs use an expression.
Once that's there, I'm kinda ok with the use of -b as a cmd line arg to
a standalone server. I see the ease of use benefits, and -b is a
long-standing JBoss AS tradition. The thing that makes me queasy is it's
a long-standing tradition, but now with new and different wrinkles:
1) It's now much easier to make the -b setting meaningless. If someone
changes the name of the "public" interface to something else or gives it
a criteria other than <inet-address
value="${jboss.bind.address.public:127.0.0.1}"/> the -b setting will be
completely ignored. You could break -b in earlier AS releases as well,
but you had to try much harder to make it completely meaningless.
This is the kind of thing that can be explained in a good FAQ, which is
why I'm kinda ok with the whole idea.
2) It doesn't do anything if you run domain.sh, or if it will the
semantics are presently undefined. A command line arg passed to
domain.sh potentially impacts multiple processes: ProcessController,
HostController, 0..n app server instances.
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
13 years, 4 months
Integration Testsuite - HttpRequest.put problem with JAX-RS (RESTEasy)
by Pavel Janousek
Hello,
I'm trying to develop simple integration JAX-RS TestCase (RESTEasy) based on widely used template class org.jboss.as.testsuite.integration.jaxrs.packaging.war.NoApplicationIntegrationTestCase.
The main difference is that I'm trying to invoke PUT HTTP method (via put(...) method later added to org.jboss.as.testsuite.integration.common.HttpRequest object).
Always I got error on test testPutBasic() - HTTP Status 405 (The specified HTTP method is not allowed for the requested resource ().), test testGetBasic() passed.
Where I'm doing mistake?
Source code is like this above...
BasicPutTestCase:
import java.util.concurrent.TimeUnit;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.testsuite.integration.common.HttpRequest;
import org.jboss.as.testsuite.integration.jaxrs.packaging.war.WebXml;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
@RunAsClient
public class BasicPutTestCase {
@Deployment(testable = false)
public static Archive<?> deploy() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "jaxrsnoap.war");
war.addPackage(HttpRequest.class.getPackage());
war.addClasses(BasicPutTestCase.class, TestResource.class);
war.addAsWebInfResource(
WebXml.get(" <servlet-mapping>\n"
+ " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
+ " <url-pattern>/myjaxrs/*</url-pattern>\n"
+ " </servlet-mapping>\n"
+ "\n"
), "web.xml");
return war;
}
private static String performCallGet(String urlPattern) throws Exception {
return HttpRequest.get("http://localhost:8080/jaxrsnoap/" + urlPattern,
5, TimeUnit.SECONDS);
}
private static String performCallPut(String urlPattern, String message) throws Exception {
return HttpRequest.put("http://localhost:8080/jaxrsnoap/" + urlPattern, message,
5, TimeUnit.SECONDS);
}
@Test
public void testGetBasic() throws Exception {
String result = performCallGet("myjaxrs/basic");
Assert.assertEquals("basic", result);
}
@Test
public void testPutBasic() throws Exception {
String result = performCallPut("myjaxrs/basic", "basic");
Assert.assertEquals("", result);
}
}
TestResource:
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@Path("basic")
public class TestResource {
private static String str = "basic1";
@GET
@Produces("text/plain")
public String get() {
return str;
}
@PUT
@Consumes("text/plain")
public void put() {
str = new String("basic2");
}
}
Cheers,
--
Pavel Janousek
Senior JBoss QA Engineer
13 years, 4 months
Web static content from external files, such as: img, css, js, html
by Douglas Matheus de Souza
Hello friends, I need your help.
How can I get static content from external files, such as: img, css, js, html to my Web application on JBoss 7 (standalone.xml), as has been done on server.xml of older versions?
Compare
<!-- Aplicacao myweb -->
<Context path="/myweb/html" appBase=""
docBase="${jboss.server.home.dir}/estatico/myweb/html"
debug="99" reloadable="true">
</Context>
<Context path="/myweb/ajuda" appBase=""
docBase="${jboss.server.home.dir}/estatico/myweb/ajuda"
debug="99" reloadable="true">
</Context>
<Context path="/myweb/css" appBase=""
docBase="${jboss.server.home.dir}/estatico/myweb/css"
debug="99" reloadable="true">
</Context>
<Context path="/myweb/img" appBase=""
docBase="${jboss.server.home.dir}/estatico/myweb/img"
debug="99" reloadable="true">
</Context>
<Context path="/myweb/js" appBase=""
docBase="${jboss.server.home.dir}/estatico/myweb/js"
debug="99" reloadable="true">
</Context>
But, how should be done in standalone.xml ?
<
???
/>
Thank you in advance
► Douglas Matheus
13 years, 4 months
jndi lookup from a @RunAsClient test case
by Stefano Maestri
Hi all,
I've written a test case that need to invoke an operation (to add a
resource-adapter definition) and then have to make a jndi lookup.
I would define the test as @RunAsClient (arquillian of course) to avoid
to include all Model* classes in deployed rar, but are there any best
practice to make a jndi lookup from this kind of test cases?
What initial context env have I to use?
To get an idea of what I'm trying take a look there
https://github.com/maeste/jboss-as/blob/d7800c96a11c8ba218414be10ed66cdb3...
thanks in advance
13 years, 4 months
Moving EJB3 code into the AS7 source tree
by Stuart Douglas
Hi Guys,
While looking at some EJB3 stuff I began to wonder just how much stuff from the JBoss EJB3 maven artefacts we actually use. Even though there is a lot of artefacts, it turns out that we use around 75 classes from EJB3, and more than half of them are timer service related (It looks like a lot of the stuff in the EJB3 package is either legacy stuff that is just hanging around).
Given that the majority of the actual EJB logic / implementation is in the AS modules (in the EJB and EE modules), I was wondering if it would be worth merging the whole of EJB into AS7 and dumping the EJB3 aggregator project altogether.
I have a branch that does this here (although this branch has not migrated any tests yet):
https://github.com/stuartwdouglas/jboss-as/tree/remove
Personally I think this would make it much easier to refactor, and would also allow us to remove some adaptor classes between AS7 and EJB3 (e.g. AS7 has to sub class the EJB3 interceptors, rather than EJB3 providing real jboss invocation interceptors).
Stuart
13 years, 4 months
Multiple HQ servers on the same AS instance
by Brian Stansberry
Just an FYI for those interested in the HornetQ integration into the AS.
I recalled this morning a call I was on a couple years back where an HA
architecture was discussed based on two or more AS's w/ 2 HQ servers on
each, one on each AS acting as backup to one on another. From chatting
with Clebert today, it seems that architecture was implemented.
This has implications for the HQ integration in AS 7.1. Two support this
kind of architecture, we'd need to:
1) Add a high level element in the jboss-as-messaging.xsd schema that
encapsulates all the existing element and represents an HQ server.
2) Add a level to the messaging subsystem management resource tree for same.
3) Rework any HQ-related MSC service names to account for the
possibility of multiple HQ servers.
4) Figure out an other issues this introduces as far as integrating with
other services that depend on the messaging services.
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
13 years, 4 months