Question

How can I add a folder to the System ClassLoader classpath so my TOMCAT app find resources?

inside a jar file from a 3rd party lib I have resource been loaded by the code

String resourceName = "MyResource";    
ResourceBundle RESOURCE = ResourceBundle.getBundle(resourceName, Locale.getDefault(), ClassLoader.getSystemClassLoader());

in this folder I have the resources

/opt/properties/
     MyResource.properties
     MyResource_en.properties
     MyResource_en_US.properties
Was it helpful?

Solution

Add /opt/properties to the common.loader property of /conf/catalina.properties file.

Code you posted looks correct to load it, should work with that property in place

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top