Thursday, March 08, 2007

Load a resource file in ear environment

Three issues
1. the properties files must be in the class path of the application module trying to read it
2. you have to use the correct class loader (Thread.currentThread().getContextClassLoader()).
3. call classloader's getResource(String propResource) method.

It will not work by simply using ClassLoader.getSystemResource() method.

1 comment:

Anonymous said...

Well said.