6 Replies Latest reply on Sep 17, 2001 9:26 AM by ipozeng

    JBoss-2.4.1_Tomcat-3.2.3 JSP failure

    pohl

      None of the JSP examples at http://localhost:8080/examples/jsp/index.html function when I unpack this version of jboss/tomcat. I exceptions like the following (this one from the date example)


      javax.servlet.ServletException: sun/tools/javac/Main
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      at org.apache.tomcat.core.Handler.service(Handler.java:287)
      at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      at java.lang.Thread.run(Thread.java:484)

      Root cause:

      java.lang.NoClassDefFoundError: sun/tools/javac/Main
      at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:136)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
      at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
      at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      at org.apache.tomcat.core.Handler.service(Handler.java:287)
      at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      at java.lang.Thread.run(Thread.java:484)




        • 1. Re: JBoss-2.4.1_Tomcat-3.2.3 JSP failure
          p_d_austin

          1. Do you have the full JDK installed?
          2. In you environment vraibales have you set JAVA_HOME to point to the installation directory of the JDK?

          • 2. Re: JBoss-2.4.1_Tomcat-3.2.3 JSP failure
            smullaney

            You need to copy %JAVA_HOME%/lib/tools.jar in your %TOMCAT_HOME%/lib directory so tomcat knows where to find the compiler to compile your JSPs.

            That should do it

            • 3. one build.xml.......for complete project.....how to???
              ipozeng

              i want to make a single build.xml to which i can give 2 command line argument ......1) the path of the source directory (where my class files r placed)....2)my destination directory(where it should place its jar,war,ear file).......coz command line argument will save me from hard coding the absolute path at each and every place.........for that.....i have merged the two build.xml files.....in the example documentation.......but when i run it....it gives the following error.......Plz see if there is something wrong with build.xml or its invocation or both...-;)

              ============Command Prompt===========================
              C:\Jetty\JBoss-2.2.2_Jetty-3.1.RC5\jboss\InterestExampleDirectory\jbproject\inte
              restexampleproject>ant C:\Jetty\JBoss-2.2.2_Jetty-3.1.RC5\jboss\InterestExampleD
              irectory\jbproject\interestexampleproject
              Buildfile: build.xml

              BUILD FAILED

              C:\Jetty\JBoss-2.2.2_Jetty-3.1.RC5\jboss\InterestExampleDirectory\jbproject\inte
              restexampleproject\build.xml:46: You must specify value, location or refid with
              the name attribute

              Total time: 0 seconds
              =================build.xml=======================
              <?xml version="1.0" encoding="UTF-8" ?>
              <!-- An Ant build file for the Interest EJB example
              -->



              <?xml version="1.0" encoding="UTF-8" ?>


              <!--
              Ant build file for the documentation tutorial code
              Writer of a chapter with an example have to include a foroward
              to their build file. This latest build file suppose arguments
              sets here :
              src.dir : Directory where the source are : manual\src\examples
              build.dir : Base directory where to store generated files (class/ejb/war/...)
              classpath : Classpath used to make any compilation (set up here by verifing
              which version of JBoss is used.
              -->




              <!-- Override with your JBoss server dist location if the JBOSS_DIST env var is not set -->

              <!-- Override with your web server servlet jar location. The default assumes that
              JBOSS_DIST points to a JBoss/Tomcat bundle distribution
              -->



















































              <!-- Tutorial ejb jar -->

















              <!-- Tutorial web app war -->














              <!-- Create the tutorial ear that uses the properties based security info -->





























              • 4. Re: JBoss-2.4.1_Tomcat-3.2.3 JSP failure
                janek

                I had exactly the same error and fixed it by adding a missing environment variable into ./bash_profile

                JDK_HOME=/usr/bin/jdk1.3.1
                export JAVA_HOME=$JDK_HOME

                (JDK_HOME was already set in my bash profile for another application.)

                I then tried http://localhost:8080/examples/jsp/num/numguess.jsp and it worked okay:

                Congratulations! You got it. And after just 6 tries.

                Care to try again?


                :-)

                • 5. Re: JBoss-2.4.1_Tomcat-3.2.3 JSP failure
                  pohl

                  Thank you all. How hard would it be to catch this
                  exception and print an informative message to this effect, so that the container itself answers this FAQ?

                  • 6. Re: JBoss-2.4.1_Tomcat-3.2.3 JSP failure
                    pohl

                    Never mind, this is obviously something that would need to be caught in the servlet container, not jboss.