新部署tomcat,An error occurred at line: [1] index_jsp.java

环境:

centos6.5 32位

oracle jdk 1.8

tomcat 7

问题:

yum install tomcat后,返回如下错误:

[[email protected]]~# curl -v http://localhost:8080

* About to connect() to localhost port 8080 (#0)

*   Trying 127.0.0.1... connected

* Connected to localhost (127.0.0.1) port 8080 (#0)

> GET / HTTP/1.1

> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: localhost:8080

> Accept: */*

> 

< HTTP/1.1 500 Internal Server Error

< Server: Apache-Coyote/1.1

< Content-Type: text/html;charset=utf-8

< Content-Language: en

< Content-Length: 2655

< Date: Thu, 15 Sep 2016 03:03:16 GMT

< Connection: close

< 

<html><head><title>Apache Tomcat/7.0.65 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Unable to compile class for JSP: </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>Unable to compile class for JSP: </u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [1] in the generated java file: [/usr/share/tomcat/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java]

The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: [1] in the generated java file: [/usr/share/tomcat/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java]

The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

Stacktrace:

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)

org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:466)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

* Closing connection #0

#

网友介绍这是ecj.jar太老了。网友的版本事3.4.2,换4.2后ok。看下自己的ecj

[[email protected]]/usr/share/java# ll|grep ecj

-rw-r--r-- 1 root root  1442090 11月 11 2010 ecj-3.4.2.jar

lrwxrwxrwx 1 root root       13 9月  15 00:53 ecj.jar -> ecj-3.4.2.jar

lrwxrwxrwx 1 root root       13 9月  15 00:53 eclipse-ecj-3.4.2.jar -> ecj-3.4.2.jar

lrwxrwxrwx 1 root root       21 9月  15 00:53 eclipse-ecj.jar -> eclipse-ecj-3.4.2.jar

lrwxrwxrwx 1 root root       13 9月  15 00:53 jdtcore.jar -> ecj-3.4.2.jar

果然很老。

那么打开ecj看下, 果然很多编译相关的类啊!

http://wiki.jikexueyuan.com/project/tomcat/classloading.html

用ecj-4.4.2.jar 替换老版本ecj后,重启tomcat,关闭防火墙,访问网页

done

时间: 2024-09-30 16:38:48

新部署tomcat,An error occurred at line: [1] index_jsp.java的相关文章

An error occurred at line: 1 in the generated java file问题处理

tomcat6启动后,加载jsp页面报错,提示无法将jsp编译为class文件,主要报错信息如下: An error occurred at line: 1 in the generated java file 最后确认该错误原因为:tomcat6不支持jdk1.8版本 修改jdk为1.7,刷新工程,通过!

报错:An error occurred at line: 22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory 加入Myeclipse自带的java EE 6 library即可解决:

Error occurred during initialization of VM java/lang/NoClassDefFoundError

因工作需要,这两天一直在RedHat Linux下配置Tomcat6.在手动安装JDK并配置完环境变量后,报出很奇怪的问题: Error occurred during initialization of VM java/lang/NoClassDefFounction...出现此问题先检查环境变量配置是否正确 如果没问题就看一下lib和jre/lib中的rt.pack.tools.pack如果发现这两个文件的话,就是因为他们没有解压我们只需要把他们解压成rt.jar和tools.jar就一切O

Eclipse无法启动报An internal error occurred during: &quot;reload maven project&quot;. java.lang.NullPointerException

由于没有正常关机导致eclipse无法将数据正常写入配置文件导致无法启动.报这样一个异常 An internal error occurred during: "reload maven project". java.lang.NullPointerException 查看workspace/.metadata/.log发现如下异常: !ENTRY org.eclipse.core.resources 2 10035 2015-12-15 09:31:13.488 !MESSAGE T

解决 Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object 错误

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object 可以看出是没有找到基础类库,查看一下tools.jar及rt.jar 果然没有,果断重新解包出来, 这个错误的原因是没有找到tools.jar及rt.jar; tools.jar是关于一些工具的类库 rt.jar包含了jdk的基础类库,也就是你在java doc里面看到的所有的类的class文件 解包方法,jdk每

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object

本地原来已经安装了JAVA JDK1.7并配置好了环境变量; 然后又安装了JDK8,想2个版本并存. 然后发现eclipse 打不开,闪退.然后查看环境: 发现 C:\Users\Administrator>java -versionError occurred during initialization of VMjava/lang/NoClassDefFoundError: java/lang/Object 于是执行: C:\Users\Administrator>java -fullve

Maven 项目报错An internal error occurred during: &quot;reload maven project&quot;.

1.有时候因为网络的原因,maven工程下载jar包失败,会一直卡住,很慢,什么操作都做不了,我们通常就会直接强制关闭掉Eclipse,但是这样下次启动的时候就会有问题: 通常会报:"An internal error occurred during: "reload maven project". java.lang.NullPointerException" 解决办法: 1.备份原工作目录中的项目 2.删除掉Eclipse原工作目录 2.switch 一个wor

Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap

ionic build Android后的报错问题 ionic 升级了splashscreen和statusbar的插件后,执行ionic build android会一直报打包错误.原因是过低的Android-platform版本不支持新的 splashscreen和statusbar插件 解决 办法是:  ionic platform add [email protected]      添加Android平台前加上版本号就行 然而,又有了新的问题:Error occurred during

eclipse不能启动,An internal error occurred during: &quot;reload maven project&quot;.

An internal error occurred during: "reload maven project". 这个错误是因为项目已经关闭,导致 导致此问题的原因是Springbao路径提示的插件,和eclipse冲突,myeclispe没问题,但myeclipse插件较多,占用内存较大,eclipse反之 创建maven项目引出的问题,创建maven项目需要配置用哪个Maven,添加自己安装的并选中 Window Preferences Maven Installations