servlet [jsp] in context with path [/springmvc] threw exception [java.lang.NullPointerException]
2018-03-20 22:05
567 查看
整合springMVC遇到的错误,采用的是maven来构建项目。
错误原因和我这篇文章http://blog.csdn.net/CronousGT/article/details/79632070相同都是与tomcat中的包有了冲突,报错如下:
看下我的pom.xml
修改部分:
即可解决问题。
总结一下问题:在我们使用maven进行web的开发时候,特别要注意自己导入的包于tomcat中的包的冲突问题,我已知的jar包有:servlet-api.jar jsp-api.jar 这两个jar的scope设置为provided,即支持项目编译测试,并不部署到项目上。额外要说的是 jstl.jar要与standard.jar同时导入,jstl需要standard的支撑才可以,不然标签引入报红,报错。
错误原因和我这篇文章http://blog.csdn.net/CronousGT/article/details/79632070相同都是与tomcat中的包有了冲突,报错如下:
严重: Servlet.service() for servlet [jsp] in context with path [/springmvc] threw exception [java.lang.NullPointerException] with root cause java.lang.NullPointerException at org.apache.jsp.index_jsp._jspInit(index_jsp.java:31) at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49) at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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:745)
看下我的pom.xml
修改部分:
即可解决问题。
总结一下问题:在我们使用maven进行web的开发时候,特别要注意自己导入的包于tomcat中的包的冲突问题,我已知的jar包有:servlet-api.jar jsp-api.jar 这两个jar的scope设置为provided,即支持项目编译测试,并不部署到项目上。额外要说的是 jstl.jar要与standard.jar同时导入,jstl需要standard的支撑才可以,不然标签引入报红,报错。
相关文章推荐
- struts2 action空指针异常 org.apache.struts2.ServletActionContext java.lang.NullPointerException
- 严重: Servlet.service() for servlet [jsp] in context with path [] threw exception [/addGoods.jsp(1,34)
- Servlet.service() for servlet [springMVC] in context with path [] threw exception [Could not get Req
- 错误:严重: Servlet.service() for servlet [appServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is
- Servlet.service() for servlet [springMVC] in context with path [/project_manager] threw exception [R
- Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
- Stacktrace:] with root cause java.lang.NullPointerException 【jsp】
- java.lang.NullPointerException at javax.servlet.GenericServlet.getServletContext
- Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
- Servlet.service() for servlet [jsp] in context with path [/Kindergarten] threw exception [Unable to
- threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with
- Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processin
- 处理Servlet.service() for servlet [jsp] in context with path [/ssh_test02] threw exception [java.
- 严重: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
- Spring Cloud ZooKeeper集成Feign的坑2,服务调用了一次后第二次调用就变成了500,错误:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.n
- Servlet.service() for servlet [jsp] in context with path [/] threw exception [Unable to compile clas
- 在Servlet使用getServletContext()获取ServletContext对象出现java.lang.NullPointerException(空指针)异常的解决办法
- java.lang.NullPointerException at org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
- Tomcat+Eclipse+Ubuntu ××× Servlet.service() for servlet [jsp] in context with path [] threw exceptio
- java.lang.NullPointerException at org.apache.jsp.index_jsp._jspInit