6 Replies Latest reply on Apr 13, 2004 5:55 AM by Tomer ben david

    JSP execution problem in Jboss_2.4.3_Tomcat_4.0

    Andrea Cervellati Newbie

      Hi,

      I have no problem executing servlets from Jboss_2.4.3_Tomcat_4.0 (the tomcat-test.ear file works) but I have problems with JSP !!!

      This is the error that occurs:

      [EmbeddedCatalinaServiceSX] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
      javax.servlet.ServletException: sun/tools/javac/Main
      at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
      at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.valves.CertificatesValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
      at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
      at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:484)
      [EmbeddedCatalinaServiceSX] ----- Root Cause -----
      java.lang.NoClassDefFoundError: sun/tools/javac/Main
      at org.apache.jasper.compiler.SunJavaCompiler.compile(Unknown Source)
      at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
      at org.apache.jasper.servlet.JspServlet.loadJSP(Unknown Source)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Unknown Source)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown Source)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
      at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
      at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.valves.CertificatesValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
      at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
      at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
      at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
      at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
      at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:484)

      PLEASE HELP!!!

      Thanks

        • 1. Re: JSP execution problem in Jboss_2.4.3_Tomcat_4.0
          Herve Tchepannou Newbie

          The problem is that JBoss doesn't have in its classpath the reference to the java compiler.

          To fix this, do this
          Unix: export JBOSS_CLASSPATH=$JAVA_HOME/lib/tools.jar:$JBOSS_CLASSPATH

          Windows: JBOSS_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%JBOSS_CLASSPATH%

          • 2. Re: JSP execution problem in Jboss_2.4.3_Tomcat_4.0
            Andrea Cervellati Newbie

            THANK YOU VERY MUCH FOR YOUR HELP!!!

            Everything works now!

            Bye

            • 3. JSP execution problem in Jboss_2.4.3_Tomcat_3.2.3
              Keshav Prasad Newbie

              I have the services started fine - both JBOSS and the embedded TOMCAT service - but when I try to get the JSPs(irrespective of the file having the JSP scriptlets) on the browser I get an OutOfMemory error or a NoClassDefFoundError. I even added the following lines onto the JBOSS_CLASSPATH :
              export JBOSS_CLASSPATH = $JAVA_HOME/lib/tools.jar:$JBOSS_CLASSPATH.
              Can someone please enlighten me as to why I get these errors and what I need to do to overcome them.

              • 4. Re: JSP execution problem in Jboss_2.4.3_Tomcat_4.0
                Tomer ben david Novice

                Hi

                I'm using Tomcat5 with JBOSS
                It has an exception and tells me to out the tools.jar in the common/lib of tomcat, howeve the tomcat5 under jboss doesnt have any common/lib :/

                I have updated my JBOSS_CLASSPATH to contain the tools.jar however I still get this error:

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

                No Java compiler was found to compile the generated source for the JSP.
                This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the
                JDK
                to the common/lib directory of the Tomcat server, followed by a Tomcat restart.

                If using an alternate Java compiler, please check its installation and access pa
                th.

                at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErro
                rHandler.java:127)
                at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher
                .java:351)
                at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
                at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
                at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
                at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
                .java:552)
                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
                .java:291)
                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
                01)
                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

                • 5. Re: JSP execution problem in Jboss_2.4.3_Tomcat_4.0
                  Tomer ben david Novice

                  And please do notice that when I'm running my site on a stand alone tomcat5 I receive no errors at all!

                  • 6. Re: JSP execution problem in Jboss_2.4.3_Tomcat_4.0
                    Tomer ben david Novice

                    I found the problem, if anyone is interested.

                    It seems like for any exception the stacktrace would tell the user to see his tools.jar! (I had a real one there, but with all this gigantic stacktrace i couldnt locate it previously)

                    but THe problem was that I got such a big stack trace that was telling me that there might be a problem with tools.jar.

                    it seems like if there is any exception with compilation the stack trace would include an error message for users to see their tools.jar! :/