环境:

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  (#)

*   Trying 127.0.0.1... connected

* Connected to localhost (127.0.0.1) port  (#)

> GET / HTTP/1.1

> User-Agent: curl/7.19. (i386-redhat-linux-gnu) libcurl/7.19. NSS/3.21 Basic ECC zlib/1.2. libidn/1.18 libssh2/1.4.

> Host: localhost:

> 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

[root@centos]/usr/share/java# ll|grep ecj

-rw-r--r--  root root   11月   ecj-3.4..jar

lrwxrwxrwx  root root        9月   : ecj.jar -> ecj-3.4..jar

lrwxrwxrwx  root root        9月   : eclipse-ecj-3.4..jar -> ecj-3.4..jar

lrwxrwxrwx  root root        9月   : eclipse-ecj.jar -> eclipse-ecj-3.4..jar

lrwxrwxrwx  root root        9月   : jdtcore.jar -> ecj-3.4..jar

果然很老。

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

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

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

done

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

  1. 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 ...

  2. 报错: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 ...

  3. Eclipse无法启动报An internal error occurred during: "reload maven project". java.lang.NullPointerException

    由于没有正常关机导致eclipse无法将数据正常写入配置文件导致无法启动.报这样一个异常 An internal error occurred during: "reload maven p ...

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

    本地原来已经安装了JAVA JDK1.7并配置好了环境变量; 然后又安装了JDK8,想2个版本并存. 然后发现eclipse 打不开,闪退.然后查看环境: 发现 C:\Users\Administra ...

  5. debian 7 linux 安装jdk出现Error occurred during initialization of VM java/lang/NoClassDefFoun

    debian 7 linux 安装jdk出现Error occurred during initialization of VM java/lang/NoClassDefFoun 这两天一直研究lin ...

  6. 踩坑系列《三》 java -version 报错出现Error occurred during initialization of VM java/lang/NoClassDefFoundError:

    之前导入一个项目,因为该项目Spring版本过低,只能适用于1.7版本,装了jdk1.7版本.安装配置好后,打开cmd窗口,执行 java -version 指令发现没像正常一样显示版本信息,而是报了 ...

  7. tomcat报错catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory

    将生产服务器的Tomcat目录打包过来后解压后,启动Tomcat后,发现如下问题: # ./shutdown.sh  Using CATALINA_BASE:   /usr/local/tomcat  ...

  8. tomcat报错catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory(转)

    原文:https://blog.csdn.net/reblue520/article/details/52588825 将生产服务器的Tomcat目录打包过来后解压后,启动Tomcat后,发现如下问题 ...

  9. Maven相关: An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException

    I solved mine by delete the .settings folder and .project file in the project and then reimport the ...

随机推荐

  1. Android : Android Studio 更新至gradle 4.10.1后Variants API变化

    同步警告: WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'v ...

  2. 黄金点游戏 结队i项目

    结对编程——黄金点游戏   本次的结对编程的项目是黄金点游戏,我的结对对象是冯雨倩,我们的编程能力都不太好,而且都对C语言更熟悉些,因此我们决定用C语言来实现. (1)分工:角色分配:冯雨倩是领航员, ...

  3. web roadmap

  4. L328 What Is Millennial Burnout?

    What Is Millennial Burnout?Do you often feel stressed? Does the pace of life make you feel like you' ...

  5. MySQL:数据查询

    数据查询 一.基本查询语句 1.语法:写一行 select{*<字段列表>}//查询的字段,多个字段用逗号分开 from<表1>,<表2>…//数据表名 {//可选 ...

  6. HttpConnection详解【转】

    HttpConnection详解[转]   HttpURLConnection对象  1.从Internet获取网页,发送请求,将网页以流的形式读回来. 步骤:1)创建一个URL对象:URL url ...

  7. ios MQTT协议的实际应用

    1,创建单视图项目,pod search mqtt找到一个库,然后在项目目录下pod init 出Podfile 2,pod install 安装mqtt库 3,主要代码: #import " ...

  8. ElasticSearch(四):关于es的一些基础知识讲解

    上一篇博客更新完之后,我发现一个问题:在我创建索引的时候依旧无法准确的理解每个字段的意义,所以就有了这个. 1. 关于索引 1.1 关于索引的一些基础知识 在创建标准化索引的时候,我们传入的请求体如下 ...

  9. SQL-记录删除篇-007

    删除记录: delete * from table_name 解释:删除表中的所有数据 delete * from table_name where id<10 解释:删除表中id小于10的数据 ...

  10. ue4 C++ json数据的读写

    这是改变恢复机制的json文件的例子  //写入 TSharedPtr<FJsonObject> RootObject = MakeShareable(newFJsonObject); T ...