• 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

MissingResourceException due to class loader constellation (caller not in WEB-INF/classes)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I get a MissingResourceException when accessing a resource bundle. The problem comes up due to my specific class loader exception.

The calling class
I am trying to read a text.properties file from within a class which resides under JBOSS_HOME/server/myServer/myDeployDir/myEAR/myJAR.jar (Note: the class is not under WEB-INF/classes!). The text.properties file is here: JBOSS_HOME/server/myServer/myDeployDir/myEAR/myWAR/WEB-INF/classes.

When running the following code



I get

java.util.MissingResourceException: Can't find bundle for base name text, locale de_DE
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:777)

Unfortunately, I cannot change the structure of the application: I can neither move the caller class (now in myJAR.jar) to WEB-INF/classes, nor can I pack the properties file into myJAR.jar. Is there any way to access the properties file from outside WEB-INF/classes?

The application runs on JBOSS 4.2.3., so I guess I have to keep web-server thread handling in mind.

Thanks for your help in advance,
Gunnar
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gunnar,

Is your locale folder in the classpath(source file path)? If so, please check whether it contains a folder named de_DE which contains the relevant properties file.

Once this is in place, we can investigate further.

Regards,
Praveen.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic