users@glassfish.java.net

jsp compile error messages

From: <glassfish_at_javadesktop.org>
Date: Thu, 19 Jul 2007 08:29:44 PDT

is there any way to get better error messages for the jsp compiler?

for example, if i put this into a jsp


<%!
public static void method() {
  methodb();
}
public void methodb() {
}
%>



i then get this error message.

HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

root cause

java.lang.NullPointerException

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs.



if i look in the server.log file i get this:


[#|2007-07-19T11:18:35.688-0400|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=httpWorkerThread-80-1;_RequestID=5b84c578-645c-48be-9c16-4272aec77ff9;|StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
        at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:347)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:400)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:477)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:371)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:631)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:562)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:803)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
|#]






neither one of these error messages are at all helpful. this is a short example, i just spent a couple of hours with a much larger jsp determining what the problem was because i couldnt get any useful error message out of it. this is very annoying considering when i run something simple like this on tomcat or some other server i get much better error messages that actually TELL ME WHY IT WONT COMPILE.


thanks.
[Message sent by forum member 'derek_111' (derek_111)]

http://forums.java.net/jive/thread.jspa?messageID=227308