问答详情
源自:2-2 Struts2 案例代码实现

出现这样的错误是怎么回事呢,求解答

七月 08, 2016 11:25:18 下午 org.apache.catalina.core.AprLifecycleListener init

信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.

七月 08, 2016 11:25:18 下午 org.apache.catalina.core.AprLifecycleListener init

信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

七月 08, 2016 11:25:18 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin

警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWorld' did not find a matching property.

七月 08, 2016 11:25:19 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL

信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)

七月 08, 2016 11:25:19 下午 org.apache.coyote.AbstractProtocol init

信息: Initializing ProtocolHandler ["http-apr-8088"]

七月 08, 2016 11:25:19 下午 org.apache.coyote.AbstractProtocol init

信息: Initializing ProtocolHandler ["ajp-apr-8009"]

七月 08, 2016 11:25:19 下午 org.apache.catalina.startup.Catalina load

信息: Initialization processed in 1832 ms

七月 08, 2016 11:25:19 下午 org.apache.catalina.core.StandardService startInternal

信息: Starting service Catalina

七月 08, 2016 11:25:19 下午 org.apache.catalina.core.StandardEngine startInternal

信息: Starting Servlet Engine: Apache Tomcat/7.0.52

七月 08, 2016 11:25:21 下午 org.apache.catalina.util.SessionIdGenerator createSecureRandom

信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [168] milliseconds.

七月 08, 2016 11:25:22 下午 org.apache.catalina.core.StandardContext filterStart

严重: Exception starting filter struts2

java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)

at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:529)

at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)

at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)


七月 08, 2016 11:25:22 下午 org.apache.catalina.core.StandardContext startInternal

严重: Error filterStart

七月 08, 2016 11:25:22 下午 org.apache.catalina.core.StandardContext startInternal

严重: Context [/HelloWorld] startup failed due to previous errors

七月 08, 2016 11:25:22 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["http-apr-8088"]

七月 08, 2016 11:25:22 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["ajp-apr-8009"]

七月 08, 2016 11:25:22 下午 org.apache.catalina.startup.Catalina start

信息: Server startup in 2807 ms


提问者:阳光的味道_ 2016-07-08 23:31

个回答

  • 响穷彭蠡之滨
    2016-07-09 10:16:30
    已采纳

    java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    你的stuts2的jar包版本不对。要么是2.1之前的要么就是2.5的。struts2 2.5版本已经没有这个

    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter了。换回struts2 2.2的版本吧,最新的2.5版本的配置我找不到相应的配置教程

  • 吴凤禹
    2017-05-13 21:40:20

    不知道

  • 沈剑心23333
    2016-07-16 14:53:19

    <filter-name>struts-prepare</filter-name>

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


    <filter-name>struts-execute</filter-name>

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

    最新的2.5.2版本要把prepare和execute分开配置,可以在struts-2.5.2\src\apps\showcase\src\main\webapp\WEB-INF找个web.xml参考,进行配置就行了

  • 悟空悟空
    2016-07-09 10:19:30

    楼上正解,我昨天也出现这种情况,换回老师同款struts2就正常了