• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Deploying a webservice with isolated namespace

 
Radek Chmielarz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All you need is classloader isolation of your applications:

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

http://www.jboss.org/community/wiki/JbossClassLoadingUseCases
 
Radek Chmielarz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic