maven报错

maven报错

HTTP Status 500 -

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)
com.heima.servlet.MyServlet.doGet(MyServlet.java:15)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
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.



正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
好帮手慕柯南 2019-08-22 15:29:58

同学你好!

在pom文件中添加以下代码,测试一下

<build>
    <finalName>b_mvn</finalName>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <port>8081</port>
                    <path>/</path>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

  • 提问者 javaer11 #1
    报别的错误 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
    2019-08-22 16:11:02
  • 好帮手慕柯南 回复 提问者 javaer11 #2
    同学这个错和之前的一样哦,同学将以上代码的tomcat7改为tomcat8测试一下。另外同学使用的是什么工具呢,idea还是eclipse。同学也可以重新创建一个项目测试一下。祝学习愉快~
    2019-08-22 17:21:09
好帮手慕柯南 2019-08-22 10:59:43

同学你好!

有用的报错信息

http://img1.sycdn.imooc.com//climg/5d5e04920001238f07380239.jpg

根据报错的信息的提示:说明同学的jsp文件的第一行有错误,同学检查一下jsp文件是否导入了java.io.ObjectInputStream这个类,如果有同学可以删除一下。

如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

  • 提问者 javaer11 #1
    没有导入你说的
    2019-08-22 11:18:04
  • 提问者 javaer11 #2
    这是idea报的错 严重: Compilation error org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException 严重: Servlet.service() for servlet jsp threw 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 严重: Servlet.service() for servlet MyServlet threw 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
    2019-08-22 11:23:43
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师