开发者

Tomcat 7 and shared.loader problem

I am using a custom directory for properties files located at

${catalina.home}/conf/properties

and in order to add it to the classpath i edited ctalina.properties and added

shared.loader=${catalina.home}/conf/properties

But contents of this directory are not accessible when I try to read them from a listener via:

MyListener.class.getResourceAsStream("/sample.props")开发者_如何学Go

I most probably have misunderstood something here. Any help would be greatly appreciated.


Use

Thread.currentThread().getContextClassLoader()
    .getResourceAsStream("/sample.props");


Worked for me with : Thread.currentThread().getContextClassLoader() .getResourceAsStream("sample.props");

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜