This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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.
The difference between winner and loser is making things happen and letting things happen.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
I can imagine that you used e.g. MyProperties.properties as filename. On windows this is ignored, but linux differs between capital and small letters.
Bhiku Mhatre
Ranch Hand
Joined: Apr 08, 2002
Posts: 127
posted
0
Hello, Thanks a million for your quick reply. But the file name in both code and on disk is in lowercase. Thanks once again, Regard,. Bhiku.
Wayne L Johnson
Ranch Hand
Joined: Sep 03, 2003
Posts: 399
posted
0
I use Tomcat (on Windows and Linux) and my properties file always goes in the ...\WEB-INF\classes directory [or a sub-directory if I include a path name in the .getBundle(...) class]. Also, what is the name of your properties file? You might try "myproperties_de.properties" or even "myproperties_de_DE.properties".
Bhiku Mhatre
Ranch Hand
Joined: Apr 08, 2002
Posts: 127
posted
0
Thanks Wayne, It has worked. Warm regards, Bhiku.
Originally posted by Wayne L Johnson: I use Tomcat (on Windows and Linux) and my properties file always goes in the ...\WEB-INF\classes directory [or a sub-directory if I include a path name in the .getBundle(...) class]. Also, what is the name of your properties file? You might try "myproperties_de.properties" or even "myproperties_de_DE.properties".