jsp全体崩溃!(和tomcat配置有关)
小弟前几天重装系统之后又重新装了下Jbuilder2006,并且把JB06自带的jdk1.5改为系统变量.然后用JB06自带的tomcat把以前的jsp执行一下.不执行不要紧一执行他妈的居然全都不能运行.我又卸载了JB用我原来了jdk1.4+tomcat5.0执行,居然也不行.我就怀疑是不是我的系统变量错了(因为不记得上次系统里的变量是什么了,jdk绝对正确)我又从网赏查了很多关于tomcat的配置基本都试过了不行.而且每次tomcat的主页(http://localhost:8080/)都能出来,而且jsp-examples里头系统自己编译好的就能执行成功,但是象jsp2.0的例子好象都不能成功.另外,我建立虚礼目录后用javac编译好servelet后也能成功,那就说明肯定是tomcat编译是出了鬼.
在网上溜达了三天看了很多说法.
有的说是jdk和tomcat版本不配;
有的说是tomcat找不到tools.jar把jdk/lib/下的tools.jar复制过去就行了(试过没用);
有的说是机器把JAVA_HOME的目录执行错了.重装tomcat就行.
还有说是sun和windows的问题(可能和我重装系统有关).
哭求高手给个明确的说话,小弟差不多三个半夜没睡了.> > > > >
另外给出错误信息和
系统环境变量:
JAVA_HOME: D:\j2sdk1.4.2_10
TOMCAT_HOME: D:\Tomcat 5.0
CLASSPATH: .\;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;%TOMCAT_HOME%\common\lib
Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME%\bin
出错信息为:
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
Generated servlet error:
D:\Tomcat 5.0\work\Catalina\localhost\jsp1\org\apache\jsp\Clock_jsp.java:59: handlePageException(java.lang.Exception) in javax.servlet.jsp.PageContext cannot be applied to (java.lang.Throwable)
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
^
Generated servlet error:
Note: D:\Tomcat 5.0\work\Catalina\localhost\jsp1\org\apache\jsp\Clock_jsp.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
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:865)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
代码为:
<%@ page contentType= "text/html; charset=gb2312 " language= "java " import= "java.sql.* " errorPage= " " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body>
<%= (new java.util.Date()).toLocaleString() %>
</body>
</html>
运行jsp-examples的Hello World Tag 例子时出错信息为:
HTTP Status 500 -
--------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class org.apache.jsp.jsp2.simpletag.hello_jsp
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)
root cause
java.lang.VerifyError: (class: org/apache/jsp/jsp2/simpletag/hello_jsp, method: _jspx_meth_mytag_helloWorld_0 signature: (Ljavax/servlet/jsp/PageContext;)Z) Incompatible argument to function
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
java.lang.Class.getConstructor0(Class.java:1930)
java.lang.Class.newInstance0(Class.java:278)
java.lang.Class.newInstance(Class.java:261)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
[解决办法]
检查一下Servlet的配置,估计跟它有关
[解决办法]
看一下tomcat使用了那个jdk编译!!!是否是1.4与1.5版本的问题。
------解决方案--------------------
出售以下资料、代码
1.JSP编程技巧百问集锦(100个问题;一个问题一段代码) 报价:30 RMB
2.ASP编程技巧百问集锦(100个问题;一个问题一段代码) 报价:30 RMB
3.JavaScript编程技巧百问集锦(100个问题;一个问题一段代码) 报价:20 RMB
4. <在线书店系统> 大解密(jsp+javabean+servlet Web版 全套源码 安装即用) 报价:150 RMB
5. <办公自动化系统> 大解密(jsp+javabean+servlet Web版 全套源码 安装即用) 报价:300 RMB
需要者请联系:e_mail:fzlotuscn@yahoo.com.cn QQ:595563946
[解决办法]
估计是Servlet的问题
[解决办法]
tomcat重装一下,记得安装目录不要带空格和中文字符.
[解决办法]
环境配置问题。。。
Error instantiating servlet class
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html