aspose file tools*
The moose likes JBoss/WildFly and the fly likes Deploying a webservice with isolated namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Deploying a webservice with isolated namespace" Watch "Deploying a webservice with isolated namespace" New topic
Author

Deploying a webservice with isolated namespace

Radek Chmielarz
Greenhorn

Joined: Aug 17, 2009
Posts: 2
Hello everyone,

What I need to get done:
- deploy several webservices on one jboss server
- all of them have to provide a wsdl description file
- every one of them is using one class pt.iscte.fenix.util.PropertiesManager for getting configuration information from build.properties in the runtime

Problem description (short):
Every webservice uses the same instance of PropertiesManager (the one that was first loaded in the memory) which points to the wrong build.properties file (and every webservice has it's own build.properties files with different keys)

What I want to achieve:
I want to isolate webservices so that each of them is in their own sandbox.

Problem description(longer):
When I deploy one webservice packed as jar into jboss/server/deploy everything works as expected - the properties from build.properties are read properly. But when I deploy another webservice instead of using properties from its own build.properties it uses the ones that were used by the first webservice. So it obviously means that it has to use the PropertiesManager instance created by the first service.

A temporary solution would be to use different class names for PropertiesManager for every webservice (I've tried, it works), but that doesn't solve the main problem, which is namespace conflict. So I would like to put every jar into their own sanbox, so that I'm assured it only uses its own classes.

I've came across solution to put the jar file into ear and provide ear with META-INF/jboss-app.xml:

But since I'm counting on jbossws and annotations to create my wsdl, when I use a jar inside a ear jboss ejbdeployer doesn't generate a wsdl file for me.

I'm using jboss-4.2.3. Every webservice is zipped into jar and compose of at least 3 source files:

##Test1Agent.java:


##Test1AgentBean.java:


##PropertiesManager.java:


If I made anything unclear feel free to point it out. Thanks in advance.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

All you need is classloader isolation of your applications:

http://www.jboss.org/community/wiki/ClassLoadingConfiguration

http://www.jboss.org/community/wiki/JbossClassLoadingUseCases


[My Blog] [JavaRanch Journal]
Radek Chmielarz
Greenhorn

Joined: Aug 17, 2009
Posts: 2
Thank you very much for your response.

What I did was to pack jar inside an ear with META-INF/jboss-app.xml file:


Now it works as expected.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploying a webservice with isolated namespace