0

当我尝试配置我的第一个应用程序时出现此错误。战争已成功生成,但是当我点击我的项目的 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)
4

1 回答 1

1

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

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

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

问题是,HttpServletRequest服务器加载的内容不能转换为HttpServletRequest您的应用程序加载的内容,反之亦然。

于 2013-08-20T22:09:21.750 回答