This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one 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.