I have no problem with using a resource bundle, although I place it in war file under WEB-INF/classes/. The war file is added to my ear file, which is then placed in JBoss' deploy directory. However, if you want to still place it under webapps, try webapps/"yourServletContext"/WEB-INF/classes/
I am having the same problem..I have tried putting the ".properties" file everywhere and yet no luck
Has anyone managed to find out what the problem is here? I have a properties file and I know I have its directory set up in the classpath but I still get the MissingResource exception.
I finally solved this problem by putting the properties files at WEB-INF/classes/props.properties.
But, I don't know why that should make any difference.
I don't know either. That web-inf directory is used for web servers isn't it? I'm just running a straightforward GUI application which needs to access a properties file. It looks like it needs more than simply being in a classpath directory but whatever it is, I have no clue.
I met the same problem on JBoss3.0.4_Tomcat4.0.6.
I follow your way to put all of the properties files under WEB-INF/classes/props.properties and use messages = ResourceBundle.getBundle("MessagesBundle"); in JSP page, then I still get error message: "org.apache.catalina.jsp_file : /Error.jsp
javax.servlet.jsp.jspException : java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key"
If ur .properties is definitely in ur classpath, try this
ResourceBundle bundle = ResourceBundle..getBundle(, , getClass().getClassLoader());
I tried to use the code below but i still got the same error when using it inside a java class. but when i tried it using in a jsp file it worked.
need help on this one. thanks
I finally figured it out.
i just moved my *.properties on <JBOSS_HOME>/server/default/conf and the following codes below worked.
ResourceBundle rb = ResourceBundle.getBundle("MyPropeties");