博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
新部署tomcat,An error occurred at line: [1] index_jsp.java
阅读量:4465 次
发布时间:2019-06-08

本文共 3025 字,大约阅读时间需要 10 分钟。

环境:

centos6.5 32位

oracle jdk 1.8

tomcat 7

问题:

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

[root@centos]~# 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< Apache Tomcat/7.0.65 - Error report 

HTTP Status 500 - Unable to compile class for JSP:


type Exception report

message Unable to compile class for JSP:

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:  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

[root@centos]/usr/share/java# ll|grep ecj-rw-r--r-- 1 root root  1442090 11月 11 2010 ecj-3.4.2.jarlrwxrwxrwx 1 root root       13 9月  15 00:53 ecj.jar -> ecj-3.4.2.jarlrwxrwxrwx 1 root root       13 9月  15 00:53 eclipse-ecj-3.4.2.jar -> ecj-3.4.2.jarlrwxrwxrwx 1 root root       21 9月  15 00:53 eclipse-ecj.jar -> eclipse-ecj-3.4.2.jarlrwxrwxrwx 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

 

posted on
2016-09-15 11:33 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/yinkw/p/5874555.html

你可能感兴趣的文章
MySQL5使用Innodb引擎时如何设置数据文件按表存储
查看>>
UNIX网络编程 - UNIX errno值
查看>>
有多少种JVM
查看>>
System.gc()
查看>>
【BZOJ3926】【ZJOI2015】—诸神眷顾的幻想乡(广义后缀自动机)
查看>>
测者的测试技术手册:自动的自动化框架EvoSuite集成Cobertura得到可视化的代码覆盖报告...
查看>>
"Hello World!" for the NetBeans IDE
查看>>
AlertDialog弹出退出对话框和图片对话框
查看>>
ASP.NET页面间数据传递的方法
查看>>
函数—参数会变吗
查看>>
Windows 10 v9926 初测
查看>>
Perl单URL爬虫
查看>>
Memcached
查看>>
codeforces 25D
查看>>
多校 2009 2
查看>>
uva 305 Joseph
查看>>
移植rtmpdump(librtmp)到android
查看>>
类查找android中跨项目的数据库操作ContentProvider的使用
查看>>
WCF也可以做聊天程序
查看>>
HDU 4497 素数筛,合数分解
查看>>