문제

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
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top