4 Replies Latest reply on Aug 7, 2006 7:23 AM by 843838

    Unable to compile class for JSP

    843838
      Hi,

      I am using j2sdk1.4.0_02 and tomcat4.1.12. when i invoke the application, i got this type of exception. when referesh the frame, then the jsp is compiled and loaded properly. Classpath and Environment variable are set correctly.


      HTTP Status 500 -

      --------------------------------------------------------------------------------

      type Exception report

      message

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

      exception

      org.apache.jasper.JasperException: Unable to compile class for JSP
           at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:479)
           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
           at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
           at java.lang.Thread.run(Thread.java:536)


      root cause

      java.io.FileNotFoundException: D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\SolareMP\web\Helpdeskhome_jsp.java (The system cannot find the path specified)
           at java.io.FileOutputStream.open(Native Method)
           at java.io.FileOutputStream.(FileOutputStream.java:176)
           at java.io.FileOutputStream.(FileOutputStream.java:70)
           at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:208)
           at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
           at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
           at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
           at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
           at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
           at java.lang.Thread.run(Thread.java:536)



      --------------------------------------------------------------------------------

      Apache Tomcat/4.1.12



      so any one can help regards this.
        • 1. Re: Unable to compile class for JSP
          gimbal2
          Just to note: tomcat ignores the classpath environmental variable.

          Your problem is a strange one that I haven't seen before. It seems like Jasper is failing to write the generated servlet source file. Do the tomcat logfiles contain any additional information perhaps?
          • 2. Re: Unable to compile class for JSP
            843838
            Hai
            Tomcat log files show these errors .

            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:23: cannot access assettabg.String
            file assettabg\String.class not found
            java.lang.String st="";
            ^
            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:24: incompatible types
            found : assettabg.String
            required: java.lang.String
            java.lang.String newvalue = "";
            ^
            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:27: incompatible types
            found : assettabg.String
            required: java.lang.String
            java.lang.String original2 ="";
            ^
            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:28: incompatible types
            found : assettabg.String
            required: java.lang.String
            java.lang.String original1 ="";
            ^
            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:30: incompatible types
            found : assettabg.String
            required: java.lang.String
            java.lang.String fpart= "";


            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\usermaintanance_prflvl21599_jsp.java:916: operator != cannot be applied to java.util.Hashtable,<*>
            if(hidden != null){
            ^


            D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\eFirstHelp\web\helpdesklogin_jsp.java:210: cannot access java.util.Dictionary
            file java\util\Dictionary.class not found
                                java.util.Properties settings = new java.util.Properties();


            The above is the error showned in the tomcat log files.After refreshing the page the page loaded correctly.Some times it shows the lang package is not there ,another time it show util package is not there

            How to solve this problem
            • 3. Re: Unable to compile class for JSP
              gimbal2
              The refreshing part may be because the webserver is loading an older version of the servlet, I had that once myself. By removing everything in the work directory and rebooting tomcat I cleaned up the inconsistencies and got proper runtime errors.

              The ones in your log leave me completely stumped however. It seems like Tomcats internal classpath is completely screwed up. I'm leaning towards suggesting you to reinstall both tomcat and the JDK. But first try cleaning out the work directory to see if that helps anything (don't forget to restart tomcat afterwards).
              • 4. Re: Unable to compile class for JSP
                843838
                On cleaning the work folder i faced these problem.
                after cleaning the work folder ,i started the tomcat.at first time
                loding the page only i got these problem.at that time i refresh the page
                .page gets loaded correctly.

                how i can solve these problem