[Deployers on JBoss (Deployers/JBoss)] - Re: HOWTO deploy webapp dynamically
by richard.opalka@jboss.com
This is our usecase:
We have the jaxws-endpoint-servlet.war web archive with the following content:
jar -tvf jaxws-endpoint-servlet.war
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/org/
WEB-INF/classes/org/jboss/
WEB-INF/classes/org/jboss/test/
WEB-INF/classes/org/jboss/test/ws/
WEB-INF/classes/org/jboss/test/ws/jaxws/
WEB-INF/classes/org/jboss/test/ws/jaxws/endpoint/
WEB-INF/classes/org/jboss/test/ws/jaxws/endpoint/EndpointBean.class
WEB-INF/classes/org/jboss/test/ws/jaxws/endpoint/EndpointInterface.class
WEB-INF/classes/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.class
WEB-INF/wsdl/
WEB-INF/wsdl/TestService.wsdl
WEB-INF/web.xml
The most important class here is EndpointServlet, which contains the following lines of code:
| public void init(ServletConfig config) throws ServletException
| {
| super.init(config);
|
| // Create the endpoint
| EndpointBean epImpl = new EndpointBean();
| javax.xml.ws.Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
|
| // Create and start the HTTP server
| SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
| HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
| httpServer.start();
|
| // Create the context and publish the endpoint
| HttpContext context = httpServer.createContext("/jaxws-endpoint");
| endpoint.publish(context);
| }
|
The purpose of this code is to create new web application deployment dynamically using this api only. The endpoint published this way must reside on address http://localhost:8080/jaxws-endpoint where HttpContext and Endpoint are our abstractions.
Our current approach:
To solve this use case we're creating new web deployment dynamically this way at the moment:
| JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
|
| AbstractDeployment deployment = createSimpleDeployment(dep.getSimpleName());
| MutableAttachments ma = (MutableAttachments)deployment.getPredeterminedManagedObjects();
| ma.addAttachment(HttpSpec.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE);
| ma.addAttachment(ClassLoaderFactory.class, new ContextClassLoaderFactory());
| ma.addAttachment(JBossWebMetaData.class, jbwmd);
| mainDeployer.deploy(deployment);
|
| ...
|
| private static class ContextClassLoaderFactory implements ClassLoaderFactory
| {
| public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception
| {
| return Thread.currentThread().getContextClassLoader();
| }
|
| public void removeClassLoader(DeploymentUnit unit) throws Exception
| {
| }
| }
|
Problem we're dealing with:
We're not able to dynamically deploy this archive to http://localhost:8080/jaxws-endpoint context. The dynamically created application is deployed to http://localhost:8080/jaxws-endpoint-servlet context.
I guess this is because of our custom class loader we have. Is there a possibility to enforce deployment context?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160586#4160586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160586
17 years, 9 months
[Design of Clustering on JBoss (Clusters/JBoss)] - Re: JBPAPP-863 -- FC blocks during slow failure detection
by bstansberry@jboss.com
The issue of whether to include FC in a config should be better covered in the docs:
http://jira.jboss.com/jira/browse/JBAS-5677
Re: mod_jk doing retries, I expect the config described would cause test failures even if there were a much faster failure timeout (say 20-30 seconds). After 8 secs, mod_jk will retry, and this is a counter-based test, so the counter will increase by 2 and you'll get a failure.
This illustrates why a retry when the request has reached a server is dangerous. For EJB proxies the clustering logics forbids this.
If you want to enable retries, suggest you use the recovery_options parameter (see http://tomcat.apache.org/connectors-doc/reference/workers.html ) and set it to 1 such that retries are not attempted if the request reaches the server.
OK, now back to this JIRA and the general testing program.
First, besides the good points Bela makes about 2.4.x vs. 2.6.x, I wouldn't want to change config files in a micro release or EAP CP. So, if we don't change the defaults, this becomes a knowledge-base issue. Hence the docs update JIRA, and I know the support guys are aware of this thread.
For the general testing program, a bigger cluster is probably better if you're testing what happens when the plug is pulled on a single node. *If* you need to drill further into what happens with a 2 node cluster, then removing FC from your TCP-based config makes sense. We already know the effect FC has, and removing FC from a 2 node TCP config is correct. So removing it will let you check for other effects.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160565#4160565
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160565
17 years, 9 months