0

I have developed a .jsp website using NetBeans. It is working perfectly well when I run it from NetBeans but when I clean and build the project and copy the .war file from the dist folder and copy in the webapps folder of the TomCat 5.0 that is installed alongwith no .jsp file is being executed.

The error shows:

exception

    org.apache.jasper.JasperException: Unable to compile class for JSP
        org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
        org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
        org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
        org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
    org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
        org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
        org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
        org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
        org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Sometimes while cleaning and building the project an error occurs in NetBeans that MySQL driver.jar i.e. included library cannot be deleted.

1
  • Upgrade your Tomcat, it is extremely old! Commented Aug 8, 2011 at 9:13

1 Answer 1

1

tomcat uses environment variable JAVA_HOME, set it to point to your jdk

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.