Thread.currentThread().getContextClassLoader() 怪异问题
tomcat启动时我在工具类中加载属性文件
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = this.getClass().getResource(“属性文件”);
在运行过程中,通过工具类调用这两句代码获取属性文件的url ,对属性文件进行读写。
tomcat启动时第一次调用没问题,在运行过程中调用就报错:
无法加载 org.apache.log4j.spi.throwsable,可是我已经把log4j的语句都注释了,还是这个错误
是不是在运行过程中调用
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = this.getClass().getResource(“属性文件”);
有什么问题?