• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

externalize message from ejb to a xml or text file

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am trying to call a webservice in a ejb and found that i need to declare the url of that webservice inside my ejb classes. does anyone here know how can i externalize my url values to a xml or text file instead so i don't have to compile everytime the url change . thanks in advance
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a link http://weblogs.java.net/pub/wlg/547 that talks about this stuff kind of.

I would use a properties file loaded through the classloader like this





All you have to do is put the properties file in a directory that is on the classpath of the appserver.

Another way would maybe have the url in a database if it is being accessed by many diff servers or something.

HTH


Adrian
 
yc lim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the info!

i tried it .. but have some problem with that

i create a Configuration.properties file and tried put it into the APP-INF/classes folder and APP-INF/lib
But i still hit a NullPointerException when i

Properties userProps = new Properties();
java.net.URL url = ClassLoader.getSystemResource("Configuration.properties");
userProps.load(url.openStream());

how should i write my Configuration.properties ? is it the same as the struts, ApplicationResource.properties? Am using weblogic 8.1 btw.
did i miss any steps ? sorry, im a noob in programming

[ September 17, 2004: Message edited by: yc lim ]
[ September 17, 2004: Message edited by: yc lim ]
 
yc lim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
erm i found the solution for this.. should use the Ear Classloader instead of the System ClassLoader instead..

 
This is my favorite tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic