尽管属性文件可用,但 glassfish 上出现 log4j 错误
我在 Glassfish 3 域的自动部署中投入了一场战争,它已经爆炸得很好,显示了一个子目录树 domain1>applications>myApp,其下是一个 WEB-INF>classes>myApp 文件夹树,用于存储 myApp 的类。
应用程序已部署,但我遇到了有关 Log4J 的问题:
[#|2010-10-14T16:18:04.433+0100|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=25;_ThreadName=Thread-1;|log4j:WARN No appenders could be found for logger (org.ajax4jsf.renderkit.ChameleonRenderKitFactory).|#]
[#|2010-10-14T16:18:04.433+0100|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=25;_ThreadName=Thread-1;|log4j:WARN Please initialize the log4j system properly.|#]
我的应用程序是使用与应用程序类位于同一文件夹中的属性文件进行组织的。在设置 Log4J 的 bean 中,我加载了以下属性:
PropertyConfigurator.configure(MyApp.class.getClassLoader().getResource("log4j.properties").getPath().replaceAll("%20", " "));
Is this code direct to Blame for the error?我没想到会在部署时出现此错误,而不是在运行时出现此错误。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我写这篇文章时,我刚刚看到战争和所包含的属性文件存在问题。现在包含属性文件并且错误减少。
I've just seen there was a problem with the war and the contained properties file at the time I wrote the post. The properties file is now included and errors abate.