首页 > 程序开发 > 软件开发 > Java >

Javaweb出错处理,myeclipse,Tomcat服务器选择错误

2017-08-02

Javaweb出错处理,myeclipse,Tomcat服务器选择错误。今天使用myeclipse编写Javaweb程序,查看网页时候出现如下错误,网上查了好久,大部分都说是Java版本或Tomcat版本错误,按其解决方式还是没能解决,最后才发现是服务器问题。写下来希望可以帮助到初学者。

Javaweb出错处理,myeclipse,Tomcat服务器选择错误

今天使用myeclipse编写Javaweb程序,查看网页时候出现如下错误,网上查了好久,大部分都说是Java版本或Tomcat版本错误,按其解决方式还是没能解决,最后才发现是服务器问题。写下来希望可以帮助到初学者,也能给自己留下印象。问题解析和解决方式在末尾:

An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

Stacktrace:] with root cause
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:443)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1568)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

本人电脑上装有两个Tomcat:apache-tomcat-7.0.79和apache-tomcat-7.0.2;
将web项目发布的时候先部署到其中一个服务器,然后用另一个服务器又查看网页是无法查看的。应该从之前的服务器部署项目中移除掉此项目,然后部署到当前服务器上。错误解决!
查看是否部署到当前服务器目录下

相关文章
最新文章
热点推荐