尽管属性文件可用,但 glassfish 上出现 log4j 错误

发布于 2024-09-27 11:09:44 字数 979 浏览 0 评论 0 原文

我在 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?我没想到会在部署时出现此错误,而不是在运行时出现此错误。

I have dropped a war into the autodeploy of a Glassfish 3 domain and it has exploded fine, showing a subdirectory tree domain1>applications>myApp under which is a WEB-INF>classes>myApp folder tree which stores the classes for myApp.

The app deploys, but I've got this problem about 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.|#]

My app is organised with properties files in the same folder as the application classes. In the bean which sets up Log4J I load the properties with

PropertyConfigurator.configure(MyApp.class.getClassLoader().getResource("log4j.properties").getPath().replaceAll("%20", " "));

Is this code directly to blame for the error? I wasn't expecting this error on deployment, not at runtime.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你与昨日 2024-10-04 11:09:44

在我写这篇文章时,我刚刚看到战争和所包含的属性文件存在问题。现在包含属性文件并且错误减少。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文