log4j jsp 导入

发布于 2024-10-28 03:42:40 字数 807 浏览 1 评论 0原文

我得到以下信息,但 log4j 在 Java EE 项目的 java 文件中工作正常

09:09:56,785 ERROR [0]] Exception Processing ErrorPage[errorCode=404, location=/pages/sorry3.jsp]
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 1 in the generated java file
The type org.apache.log4j.Logger cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 10 in the generated java file
The import org.apache.log4j.Logger cannot be resolved

An error occurred at line: 54 in the jsp file: /pages/sorry3.jsp
Logger cannot be resolved

53:     
54:     Logger.getLogger("com.mysite.myapp.jsps.sorry3").error(
55:         "Page Not Found: " + pageContext.getErrorData().getRequestURI());
56: %>
57: 

如果有人能指出我正确的方向,那就太好了。

I'm getting the following, yet log4j works fine in the java files of a Java EE project

09:09:56,785 ERROR [0]] Exception Processing ErrorPage[errorCode=404, location=/pages/sorry3.jsp]
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 1 in the generated java file
The type org.apache.log4j.Logger cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 10 in the generated java file
The import org.apache.log4j.Logger cannot be resolved

An error occurred at line: 54 in the jsp file: /pages/sorry3.jsp
Logger cannot be resolved

53:     
54:     Logger.getLogger("com.mysite.myapp.jsps.sorry3").error(
55:         "Page Not Found: " + pageContext.getErrorData().getRequestURI());
56: %>
57: 

If anyone could point me in the right direction, that would be great.

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

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

发布评论

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

评论(1

岁吢 2024-11-04 03:42:40

听起来您的类路径中根本没有 log4.jar / log4j.properties 。

将其添加到您的 CLASSPATH 中。

一般来说,log4j.properties应该位于WEB-INF/classes

应该有效

It sounds like you don’t have the log4.jar / log4j.properties in your classpath at all.

Add it in your CLASSPATH.

Generally, log4j.properties should be at WEB-INF/classes.

It should work

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