struts2 com.opensymphony.xwork2.config.ConfigurationException: 异常原因

写struts2代码时出现这样的错误:


十一月 25, 2016 9:12:41 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:struts2_3200_Interception' did not find a matching property.
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.69
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Apr 11 2016 07:57:09 UTC
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.69.0
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 7
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.1
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          x86
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java\jdk1.7.0_79\jre
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.7.0_79-b15
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         G:\tomcat-7
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=G:\tomcat-7
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=G:\tomcat-7\endorsed
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
十一月 25, 2016 9:12:41 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_79\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;G:/MyEclipse 10/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client;G:/MyEclipse 10/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin;G:/MyEclipse 10/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/lib/i386;g:\app\x\product\11.2.0\dbhome_1\bin;C:\Program Files\Java\jdk1.7.0_79\bin;C:\Program Files\Java\jdk1.7.0_79\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Program Files\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files\MySQL\MySQL Server 5.7\bin;.
十一月 25, 2016 9:12:41 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
十一月 25, 2016 9:12:41 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
十一月 25, 2016 9:12:41 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 493 ms
十一月 25, 2016 9:12:41 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十一月 25, 2016 9:12:41 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.69
十一月 25, 2016 9:12:41 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [162] milliseconds.
十一月 25, 2016 9:12:42 上午 org.apache.catalina.startup.TldConfig execute
信息: 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.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
09:12:43.141 [localhost-startStop-1] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed
com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration.
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) ~[xwork-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978) ~[struts2-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) ~[struts2-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) [struts2-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) [struts2-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) [struts2-core-2.3.31.jar:2.3.31]
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) [catalina.jar:7.0.69]
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) [catalina.jar:7.0.69]
	at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105) [catalina.jar:7.0.69]
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908) [catalina.jar:7.0.69]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602) [catalina.jar:7.0.69]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:7.0.69]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572) [catalina.jar:7.0.69]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562) [catalina.jar:7.0.69]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_79]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_79]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_79]
	at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
Caused by: com.opensymphony.xwork2.config.ConfigurationException: Action class [class.interceptiontest.action.InterceptinAction] not found
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486) ~[xwork-core-2.3.31.jar:2.3.31]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429) ~[xwork-core-2.3.31.jar:2.3.31]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556) ~[xwork-core-2.3.31.jar:2.3.31]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295) ~[xwork-core-2.3.31.jar:2.3.31]
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) ~[struts2-core-2.3.31.jar:2.3.31]
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264) ~[xwork-core-2.3.31.jar:2.3.31]
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ~[xwork-core-2.3.31.jar:2.3.31]
	... 17 more
十一月 25, 2016 9:12:43 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Unable to load configuration. - action - file:/H:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_3200_Interception/WEB-INF/classes/struts.xml:12:99
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: Unable to load configuration. - action - file:/H:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_3200_Interception/WEB-INF/classes/struts.xml:12:99
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
	at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
	... 14 more
Caused by: Action class [class.interceptiontest.action.InterceptinAction] not found - action - file:/H:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_3200_Interception/WEB-INF/classes/struts.xml:12:99
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	... 17 more

十一月 25, 2016 9:12:43 上午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
十一月 25, 2016 9:12:43 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/struts2_3200_Interception] startup failed due to previous errors
十一月 25, 2016 9:12:43 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
十一月 25, 2016 9:12:43 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
十一月 25, 2016 9:12:43 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 1879 ms

经过仔细排查后 原来根本的错误是这个
Caused by: Action class [class.interceptiontest.action.InterceptinAction] not found - action - file:/H:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_3200_Interception/WEB-INF/classes/struts.xml:12:99

即struts.xml 中这一句  
错了,引用的class的包写错了。应该是
还是粗心大意了。

结论
一、写代码要细心。
二、代码是调出来的。


你可能感兴趣的:(struts2 com.opensymphony.xwork2.config.ConfigurationException: 异常原因)