0

This question has been asked wrt Tomcat servers, but I would like to know with Google App Engine for Java where the JSP generated Java class files are being stored.

I need to know because I'm having no problems compiling my JSP files, both locally and when deployed, but am getting an NPE on line XX of the generated Index_jsp.java when I try to access the page.

Here's the Error:

WARNING: /
java.lang.NullPointerException
at org.apache.jsp.Index_jsp._jspService(Index_jsp.java:75)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Thanks.

Community
  • 1
  • 1
willlma
  • 7,353
  • 2
  • 30
  • 45
  • 1
    Just put Java code in servlet class instead of JSP file. It'll be so much easier to debug. See also http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files/3180202#3180202 It's by the way surprising that you tagged this `[servlets]`. – BalusC Sep 19 '13 at 19:05
  • Or, if you don't have any Java code in your JSP file and this is just the classic NPE on JSP-specific `org.apache.jsp.Index_jsp._jspInit()` method, then your concrete problem has a completely different cause: a dirty classpath. – BalusC Sep 19 '13 at 19:07
  • Can you reproduce the NPE and debug the JSP? I'd expect you to be able to walk through it while seeing the JSP source as you'd written it. – nitind Sep 19 '13 at 19:12
  • @BalusC, it's not the dirty classpath. I actually know what's causing the NPE in this situation, but have gotten this error before and wanted a way to see exactly which line in the JSP was causing it. Thanks for the link, though. I'll have a read and probably change to just using servlets. – willlma Sep 19 '13 at 19:33
  • @nitind, I have updated the question to show the relevant part of the error. How would I go about debugging the JSP? As you can see, the console does not show which line in the JSP caused the error, and when I click on `Index_jsp.java` I get the error `Source not found for org.apache.jsp.Index_jsp`. – willlma Sep 19 '13 at 19:37
  • 1
    Are you able to set a breakpoint in the JSP file and Debug (not Run) the app server in its entirety as shown at https://developers.google.com/eclipse/docs/running_and_debugging_2_0 ? – nitind Sep 19 '13 at 19:55
  • @nitind I would need to install GWT to be able to do that. Thanks for the help. I'll leave it as-is for now, as I've solved this particular NPE, but will look into GWT, debugging, and `JSP` breakpoints next time I have a similar issue. – willlma Sep 19 '13 at 20:18

0 Answers0