• 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

Problem reading property file -- Linux

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am reading a property file from my java application. The code works fine fine Under Windows 2000, WebSphere studio. But when I deploy it on tomcat running under German Linux it fails to load the property file.
Properties prop = new Properties();
Locale locale = new Locale("de","DE");
ResourceBundle bundle = ResourceBundle.getBundle("myproperties",locale);
Enumeration enum = bundle.getKeys();
String key = null;
while( enum.hasMoreElements() ) {
key = (String)enum.nextElement();
prop.put(key, bundle.getObject( key ));
}

It throws Exception java.util.MissingResourceException : Can't find bundle for base name myproperties.
My property file resides in document root of the web application.
Any help is appreciated.
T
hanks in advance,
Regards,
Bhiku.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to put the propertis file in Web-inf/classes directory.
 
Bhiku Mhatre
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Hiteshkumar ,
It has worked. But created another problem. When I build my project in WSAD 4.01 the WSAD deletes the property file from the classes folder. Ofcourse with a small work around I got it working. Thnaks once again.
Warm Regards,
Bhiku

Originally posted by Hiteshkumar Patel:
Try to put the propertis file in Web-inf/classes directory.

 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic