I’m trying to trace an error down in an existing system. So the problem is that Tomcat doesn’t give me the line in which the error occurred, but just a general NULL-pointer exception. The current system uses servlets that get a reference to a bean. This bean class does all the data handling and whenever an error occurs within such a bean, I won’t be able to find the error unless I debug the code manually, which is not possible for some errors that just happen once in a while. Are there any flags which I can enable to get more information? Or do I have to re-design the system to get debug information?
I’m working with Tomcat version 7.0.12.
Thanks!
java.lang.NullPointerException
at org.apache.jsp.search_jsp._jspService(search_jsp.java:151)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at ...
Edit: Just found out that the exception handling in the servlet tried to access a property of a null object, which caused the original error to be disguised with that null pointer exception.
You can go to $TOMCAT_HOME/work/catalina/localhost/${YOUR_APP_NAME}/org/apache/jsp/..
and find the file search_jsp.java. So you’ll be able to find the line where the error happened.