初级问题,我的TOMCAT不能执行jsp? (10分)

  • 主题发起人 主题发起人 sherlockmei
  • 开始时间 开始时间
S

sherlockmei

Unregistered / Unconfirmed
GUEST, unregistred user!
可以启动,可以打开localhost,可以执行其中的servlet,但是执行jsp就会出好多的错误。用jswdk就可以。估计是
tomcat的设置问题,可是我的autoexec.bat已经加入了:
SET CLASSPATH=c:/jdk1.3.1_02/lib/tools.jar
SET JAVA_HOME=c:/jdk1.3.1_02
SET TOMCAT_HOME=c:/tomcat
SET PATH=C:/WINDOWS;C:/WINDOWS/COMMAND;c:/jdk1.3.1_02/bin;
到底是什么问题?
 
请给出错误详细信息。
 
在浏览器中显示错误如下:(好象完全不能编译)
Error: 500
Location: /examples/jsp/num/numguess.jsp
Internal Servlet Error:
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:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
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:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
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)
 
我也在用tomcat ,设置时,我只改了tomcat.bat
   SET JAVA_HOME=c:/jdk1.3.1_02
SET TOMCAT_HOME=c:/tomcat
而  SET CLASSPATH 这一项,我没写,系统会自动找到的
 
装 resin ,很容易调试,原来我也用TOMCAT,后来换RESIN了.
TOMCAT还需要设置classpath 的,指到你程序用到的JAVABEAN 所在目录.
 
改:SET CLASSPATH=.;c:/jdk1.3.1_02/lib/dt.jar;c:/jdk1.3.1_02/lib/tools.jar
 
同意caicai-niao
 
到www.cnjsp.com去看看,那有很多文档!
 
to:顶楼
你的配置没有错。
你在autoexec.bat里面加入那几个环境变量,难道你用的是windows 98吗?
ultrawolf说的是对的。
 
接受答案了.
 
后退
顶部