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.
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