Creating an exception when building a SPRING4+MYBATIS+SPRINGMVC Access project:
Critical: Servlet.service () for Servlet JSP threw Exceptionjava.lang.NullPointerExceptionAt Org.apache.jsp.index_jsp._jspinit(index_jsp.java:22)At Org.apache.jasper.runtime.HttpJspBase.init(httpjspbase.java:52)At Org.apache.jasper.servlet.JspServletWrapper.getServlet(jspservletwrapper.java:164)At Org.apache.jasper.servlet.JspServletWrapper.service(jspservletwrapper.java:340)At Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:313) at Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:260) at Javax.servlet.http.HttpServlet.service ( httpservlet.java:723) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter ( applicationfilterchain.java:290) at Org.apache.catalina.core.ApplicationFilterChain.doFilter ( applicationfilterchain.java:206) at Org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(characterencodingfilter.java:85)At Org.springframework.web.filter.OncePerRequestFilter.doFilter(onceperrequestfilter.java:107)At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:235) 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:127) at Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:103) at Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109) at Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:293) at Org.apache.coyote.http11.Http11Processor.process (http11processor.java:861) at Org.apache.coyote.http11.http11protocol$http11connectionhandler.process (http11protocol.java:606)At Org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:489)At Java.lang.Thread.run (Unknown Source)
In general, this exception is thrown at startup without reporting an exception while accessing the project times. The reason is that the project itself contains Servlet.api.jar, and Tomcat also contains the jar, which creates a conflict.
The simplest solution is to deploy the project to TOMCAT7 to solve the problem perfectly!
Resolves a 500 error in the TOMCAT6 Deployment spring4+mybatisjsp page, and the console report java.lang.NullPointerException issues