views:

175

answers:

3

Hello everybody,

i'm about to deploy two different but dependent war-files into a single jboss (AS 4.2.x GA) One implements some webservices (jax-ws) exposing their interfaces through a wsdl. The other one is a (say) web frontend using the aformentioned webservices. When I drop both warfiles to $JBOSS_HOME/server/default/deploy at the same time I can see that the first gets deployed (somehow) but the second one gets stuck and the entire jboss is not responding. When I deploy them one after another, everything is fine (it just works:)

  • Is there a way to tell jboss that deployment of warfile2.war has to wait for warfile1.war to finish deployment before starting deployment of warfile2.war?

  • Is there a way to determine programatically wheter a given 'service' is deployed and ready?

  • I'm wonder what happens when both wars are present and jboss is restarted?

Kind regards, Jay Wee.

A: 

What about implementing a listener in the web frontend waiting for a successfull head request to the wsdl on localhost?

Arne Burmeister
Thanks Ame,do you mean a http-listener, which polls on http://localhost:8080/app?wsdl But who would start it? Cheers,Jan
Yes Jan, an HTTP-Listener (ServletContextListener) in declared in the web.xml of the second webapp to be deloyed after the webservice. The contextInitialized() method does not return until the webservice resonds.
Arne Burmeister
+1  A: 

To answer your last question first, JBoss will deploy the contents of its deploy directory in alphabetical order. If you drop two WAR files into a running server's deploy directory, the results are unpredictable, but should be safe, so I'm not sure what's going on there.

By the way you describe the dependency, it sounds like when a user uses the frontend WAR, it calls the web service WAR, and that on startup there's no link between the two? Could anyone be trying to use the frontend WAR while the web service WAR is still deploying? Which WAR comes first alphabetically?

As a possible solution, when you have two WAR files that depend on each other, you should consider packing them both into a single EAR file. That way JBoss will deploy them together in a controlled way.

skaffman
A: 

Hi skaffman,

Thats right. backend.war is deployed before frontend.war.

I deployed it on my local jboss and nobody else has acces to it.

What I can see when i debug into jboss is that the frontend accesses the backend wsdl (https://localhost:9999/app/svc?wsdl ) hangs while jboss is not ready.

\at Arne Burmeister: the listener approach doesen't help. the listener is called to early in the process: I can connect to the backendWsdlUrl but backenWsdlUrl.getConnection().getOutputstream() hangs

I think I'll give the ear a try. Is there a good documentation on how to pack things together in an ear? (skaffman already pointed me into the right direction)

Thanks a lot to all who help so far, Jan

http://www.coderanch.com/t/91212/JBoss/JBoss-EAR-structure
skaffman