eclipse创建maven项目启动报错

eclipse 创建maven 项目 动态web工程完整示例
(参考https://www.cnblogs.com/noteless/p/5213075.html)

eclipse的版本为:Eclipse Java Oxygen
默认只有J2SE,没有J2EE
升级J2EE(参考https://blog.csdn.net/YIII_TIAN/article/details/78991782)

根据创建maven项目步骤,项目取名:spring-ioc-demo
启动报错如下:

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: 

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:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.

查找问题结论:tomcat 6.0.29,jdk是1.8版本,由于tomcat比jdk版本低而错误,tomcat 8.0及以上版本才能支持jdk1.8。

[INFO] Using existing Tomcat server configuration at C:\Users\Administrator\eclipse-workspace\spring-ioc-demo\target\tomcat
四月 10, 2018 11:57:54 下午 org.apache.catalina.startup.Embedded start
信息: Starting tomcat server
四月 10, 2018 11:57:54 下午 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.29
四月 10, 2018 11:57:54 下午 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
四月 10, 2018 11:57:54 下午 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
四月 10, 2018 11:58:12 下午 org.apache.jasper.compiler.JDTCompiler$1 findType
严重: Compilation error

开始下载tomcat 8.0
eclipse创建maven项目启动报错_第1张图片

这个自带的下载及安装有点坑爹,启动一直报错,我怀疑是版本的问题,可能系统32位或64位对应不上(我的电脑是Windows 64位)

重新去官网下载tomcat 8.5.30(64-bit Windows zip )
(下载地址:https://tomcat.apache.org/download-80.cgi)

重新启动tomcat 8.5.30
eclipse创建maven项目启动报错_第2张图片

你可能感兴趣的:(Java)