gpt4 book ai didi

java - 异常发送请求初始化生命周期事件到类 org.springframework.web.context.request.RequestContextListener 的监听器实例

转载 作者:行者123 更新时间:2023-12-01 14:19:20 26 4
gpt4 key购买 nike

当我尝试配置我的第一个应用程序时,出现此错误。 War 已成功生成,但当我点击项目的 URL 时,此错误出现在网页上,并且控制台中出现相同的错误:

堆栈跟踪

2013-07-20 17:05:49,100 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testing]] (http-127.0.0.1-8080-1) Exception sending request initialized lifecycle event to listener instance of class org.springframework.web.context.request.RequestContextListener
java.lang.IllegalArgumentException: Request is not an HttpServletRequest: org.apache.catalina.connector.RequestFacade@2b617c79
at org.springframework.web.context.request.RequestContextListener.requestInitialized(RequestContextListener.java:54)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:180)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:724)
2013-07-20 17:06:12,617 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testing]] (http-127.0.0.1-8080-1) Exception sending request initialized lifecycle event to listener instance of class org.springframework.web.context.request.RequestContextListener
java.lang.IllegalArgumentException: Request is not an HttpServletRequest: org.apache.catalina.connector.RequestFacade@f4ffab5
at org.springframework.web.context.request.RequestContextListener.requestInitialized(RequestContextListener.java:54)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:180)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:724)

最佳答案

检查您的 war 中是否碰巧有 servlet-api 库。如果是这样,您必须将其删除,因为该库是由服务器提供的。

说明:
HttpServletRequestservlet-api库提供,通常由服务器(JBoss、Tomcat等)加载

如果该库也存在于您的应用程序中,则会通过不同的 classloaders 多次加载它。 :应用程序类加载器和服务器默认类加载器。

问题是,服务器加载的 HttpServletRequest 无法转换为应用程序加载的 HttpServletRequest,反之亦然。

关于java - 异常发送请求初始化生命周期事件到类 org.springframework.web.context.request.RequestContextListener 的监听器实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17761913/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com