log4j:ERROR Could not read configuration file from URL [file:/C:/WebProj/apache-tomcat-7.0.73/webapps/J_QNZ_MERCHANT_PC/WEB-INF/classes/log4j.properties].
java.io.FileNotFoundException: C:\WebProj\apache-tomcat-7.0.73\webapps\J_QNZ_MERCHANT_PC\WEB-INF\classes\log4j.properties (系統找不到指定的文件。)
出現以上的問題,就是\WEB-INF\classes\log4j.properties找不到文件,追溯到配置文件的配置,可以設置爲如下:
<!-- ServletContext初始化參數 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
最後,clean,publish,start就ok