This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a very simple servlet that forwards a response to a JSP. It's an example from 'Heads First Servlets and JSP'.
I have had this example working, then I created it again, and now I have a problem.
It is the call to view.forward that it causing an exception:
11-Nov-2005 23:40:18 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Ch3 Beer2 threw exception java.lang.InstantiationError: org.apache.jasper.compiler.Compiler at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:234).........
I know that the JSP page is being found, because if I provide an deliberately incorrect file name in request.getRequestDispatcher the server tells me that the file cannot be found. I also checked that the objects view, request and response were not null.
Depending on your container, you may or may not need a full JDK in order to compile JSPs. Sometimes the Tomcat installer will find an installation of Java on your machine other than the full JDK. When this happens servlets will run but not JSPs.