gpt4 book ai didi

java.lang.ClassNotFoundException : org. apache.struts2.dispatcher.FilterDispatcher

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:09:03 24 4
gpt4 key购买 nike

启动tomcat时记录

Apr 28, 2011 10:52:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\software\jdk1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:/software/jdk1.5.0_06/bin/../jre/bin/client;D:/software/jdk1.5.0_06/bin/../jre/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\TortoiseSVN\bin.;D:\software\jdk1.5.0_06\bin;D:\software\Ant 1.7\bin;D:\software\Axis2-1.5.4\axis2-1.5.4-bin\axis2-1.5.4\bin;C:\Program Files\IDM Computer Solutions\UltraEdit\
Apr 28, 2011 10:52:58 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsHelloWorld' did not find a matching property.
Apr 28, 2011 10:52:58 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsHelloWorld1' did not find a matching property.
Apr 28, 2011 10:53:00 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Apr 28, 2011 10:53:00 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3657 ms
Apr 28, 2011 10:53:00 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 28, 2011 10:53:00 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Apr 28, 2011 10:53:01 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Apr 28, 2011 10:53:01 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Apr 28, 2011 10:53:01 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/StrutsHelloWorld1] startup failed due to previous errors
log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
log4j:WARN Please initialize the log4j system properly.
Apr 28, 2011 10:53:05 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Apr 28, 2011 10:53:05 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 28, 2011 10:53:05 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/46 config=null
Apr 28, 2011 10:53:05 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4951 ms

最佳答案

如果你有...

  1. 包括所有必要的 jar
  2. 正确配置构建路径
  3. 将它们全部添加到部署程序集中
    正确。

然后您还会收到“java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher”错误,那么您可能做错了以下事情。

解决方法:

检查您的 struts2-core-x.x.jar 版本。

-->如果是struts2-core-2.5.jar那么把你在web.xml中的filter class标签值改成

<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>

-->如果是struts2-core-2.1.3.jar那么把你在web.xml中的filter class标签值改成

<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>

FilterDispatcher 从 Struts 2.1.3 开始被弃用。如果您使用的是旧版本,则使用上述解决方案。

-->如果是struts2-core-2.3.X.jar那么把你在web.xml中的filter class标签值改成

<filter-class> 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>

所有这一切背后的原因是 struts 2 Controller 被放置在不同版本的 struts2-core jar 中的不同位置,有时它们被不同的名称调用,如您在 2.1.3 中所见。

谢谢,

关于java.lang.ClassNotFoundException : org. apache.struts2.dispatcher.FilterDispatcher,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5814036/

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