• Post Reply Bookmark Topic Watch Topic
  • New Topic

deployment and resource bundle problem  RSS feed

 
JHM Lin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all
I have a problem when deploying a war file into Java Web Start. The war file consists of several jar files, and one of the jar files contanins several *.properties files(such as system.properties). I attempt to find the properties file by the following code:
InputStream is = this.getClass().getResourceAsStream("/system.properties");
Properties prop = new Properties();
prop.load(is);
String initCtxFactory = prop.getProperty("myproperties");
but it fails to find the properties file.
Can anyone provide me with the solution to this problem?
Thanks in advance!
 
Martin Coetzee
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey...I'm no expert on this, but I solved it once by asking the classloader to provide me with the resource.
Try this:
Hmm..Give it a shot.
Cheers from sunny south africa.
Martin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!