maven 项目,通过maven编译 解决出现JSP NullPointerException

原创
2014/09/28 20:57
阅读数 704
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
	at org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
	at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
	at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:744)

原因:jar包依赖冲突,两种方式解决;

1、把servlet的jar的依赖范围改成provided <scope>provided</scope>

2、在pom.xml中,查找servlet关键字,删除跟servlet相关的jar包依赖


展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部