pom.xml
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
https://github.com/mansreeal/stanweb/blob/main/pom.xml
login.jsp
<% tablib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>login</title>
</head>
<script src="${pageContext.request.contextPath}/js/scripts/jquery.min.js"></script>
</html>
项目结构
Folder structure
+StanWeb
+Java Resources
+src/main/java
+src/main/resources
+config
+Libraries
+JavaScript Resources
+Referenced Libraries
+Deployed Resources
+src
+main
+java
+resources
+webapp
+META-INF
+views
+resources
+WEB-INF
+lib
-dispatcher-servlet.xml
-spring-security.xml
-web.xml
pom.xml
错误详细信息
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet [jsp] threw exception
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at javax.el.CompositeElResolver.add(CompositeELResolver.java:47)
at org.apache.jasper.el.JasperELResolver.add(JasperELResolver.java:79)
at org.apache.jasper.el.JasperELResolver.<init>(JasperELResolver.java:64)
at org.apache.jasper.runtime.JspApplicationContextImpl.createELResolver(JspApplicationContext Impl.java:116)
at org.apache.jasper.runtime.JspApplicationContextImpl.createELContext(JspApplicationContext Impl.java:90)
at org.apache.jasper.runtime.PageContextImpl.getELContext(PageContextImpl.java:705)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:690)
at org.apache.jsp.pages.headerlogin_jsp._jspService(headerlogin.jsp.java:139)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.jasper.servlet.JspServletWrapper.service(spServletWrapper.java:467)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:378)
at org.apache.jasper.servlet.JspServlet.service(spServlet.java:326)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:578)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:514)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimelibrary.java:954)
at org.apache.jsp.pages.login.login_jsp._jspService(login_jsp.java:125)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:467)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:378)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:326)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
at org.apache.catalina.core.ApplicationDispatcher.forward(Application Dispatcher.java:312)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:170)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1325)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1069)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1008)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
at org.springframework.web.servlet.FrameworkServlet.service(Framework Servlet.java:855)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
at com.StanWeb.ui.filter.ApplicationFilter.doFilter(ApplicationFilter.java.237)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePer RequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:155)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
at org.apache..http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocols$ConnectionHandler.process(AbstractProtocol.java:887)
at org.apache.tomcat.util.net.NioEndpoint SocketProcessor.doRun(NioEndpoint.java:1684)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runworker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThreadSWrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
org.apache.catalina.core.StandardWrapperValue invoke
SEVERE: Servlet.servce() for servlet [dispatcher] in context with path [/StanWeb] threw exception [An exception occured processing [views/login.jsp] at line [6]
<script src="${pageContext.request.contextPath}/js/scripts/jquery.min.js"></script>
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\docs]
org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARS that were scanned but no TLDs were found in them. Skipping unneeded JARS during scanning can improve startup time and JSP compilation time.
org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\docs]has finished in [3,185] ms
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\examples]
org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARS that were scanned but no TLDs were found in them. Skipping unneeded JARS during scanning can improve startup time and JSP compilation time.
org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplication Initializer types detected on classpath
org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: context Initialized()
org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded("StockTicker', 'async.Stockticker@55cee89')
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\examples] has finished in [3,274] ms
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\apache-tomcat-9.0.48)webapps\host-manager]
org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARS during scanning can improve startup time and JSP compilation time.
org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps host-manager] has finished in [2,555] ms
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\manager]
org.apache.Jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARS during scanning can improve startup time and JSP compilation time.
org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\manager] has finished in [2,841] ms
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\ROOT]
org.apache. jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARS that were scanned but no TLDs were found in them. Skipping unneeded JARS during scanning can improve startup time and JSP compilation time.
org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplication Initializer types detected on classpath
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.48\webapps\ROOT] has finished in [2,104] ms
org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-9090"]
org.apache.catalina.startup.Catalina start
INFO: Server startup in [86855] milliseconds
运行应用程序时,我收到以下错误消息:org.apache.catalina.core.standardwrappervalue invoke servlet.servce(),该消息针对上下文中的servlet[dispatcher],路径[/stanweb]在第[6]行抛出异常[处理[views/login.jsp]时发生异常]
<script src="${pageContext.request.contextPath}/js/scripts/jquery.min.js"></script>
我正在使用tomcat版本9和spring mvc版本5。我尝试更改为request.getcontextpath(),但仍然存在相同的问题。请帮忙
1条答案
按热度按时间pb3s4cty1#
正如评论中已经提到的,您的一个依赖项(
activiti-engine
)具有el规范的替代实现:juel。在我看来,这是一个错误
activiti-engine
的pom:项目不应该依赖于特定的el实现,而应该依赖于el api。您可以通过从项目中明确排除juel依赖项来更正它: