"SSH" Dispatcher initialization failed && Exception Startingfilter struts2

Source: Internet
Author: User
Tags addchild

In the afternoon during the SSH introduction of the page process, the code after the video knocked out, the display interface is always like this:

Then view the error message in the console as follows:

Severity: Dispatcher initialization failed

Unable to load configuration. -action-file:/c:/program%20files/apache%20software%20foundation/tomcat%207.0/webapps/mystruts2_2/web-inf/ classes/struts.xml:8:68
At Com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (configurationmanager.java:58)
At Org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (dispatcher.java:374)
At Org.apache.struts2.dispatcher.Dispatcher.init (dispatcher.java:418)
At Org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher (initoperations.java:69)
At Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init ( STRUTSPREPAREANDEXECUTEFILTER.JAVA:51)
At Org.apache.catalina.core.ApplicationFilterConfig.initFilter (applicationfilterconfig.java:277)
At Org.apache.catalina.core.ApplicationFilterConfig.getFilter (applicationfilterconfig.java:258)
At Org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (applicationfilterconfig.java:382)
At Org.apache.catalina.core.applicationfilterconfig.<init> (applicationfilterconfig.java:103)
At Org.apache.catalina.core.StandardContext.filterStart (standardcontext.java:4638)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5294)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:895)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:871)
At Org.apache.catalina.core.StandardHost.addChild (standardhost.java:615)
At Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1099)
At Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1621)
At Java.util.concurrent.executors$runnableadapter.call (executors.java:441)
At Java.util.concurrent.futuretask$sync.innerrun (futuretask.java:303)
At Java.util.concurrent.FutureTask.run (futuretask.java:138)
At Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908)
At Java.lang.Thread.run (thread.java:619)
caused By:action class [com.keshuo.action。 Loginverifyaction] Not Found-action-file:/c:/program%20files/apache%20software%20foundation/tomcat%207.0/webapps /mystruts2_2/web-inf/classes/struts.xml:8:68
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction (Xmlconfigurationprovider.java : 409)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction (Xmlconfigurationprovider.java : 354)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage (Xmlconfigurationprovider.java : 468)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages (Xmlconfigurationprovider.java : 264)
At Org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages (Strutsxmlconfigurationprovider.java : 111)
At Com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (defaultconfiguration.java:193)
At Com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (configurationmanager.java:55)
... More
2014-9-18 9:00:45 Org.apache.catalina.core.StandardContext Filterstart
Severity: Exception Starting filter Struts2
Unable to load configuration. -action-file:/c:/program%20files/apache%20software%20foundation/tomcat%207.0/webapps/mystruts2_2/web-inf/ classes/struts.xml:8:68
At Org.apache.struts2.dispatcher.Dispatcher.init (dispatcher.java:431)
At Org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher (initoperations.java:69)
At Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init ( STRUTSPREPAREANDEXECUTEFILTER.JAVA:51)
At Org.apache.catalina.core.ApplicationFilterConfig.initFilter (applicationfilterconfig.java:277)
At Org.apache.catalina.core.ApplicationFilterConfig.getFilter (applicationfilterconfig.java:258)
At Org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (applicationfilterconfig.java:382)
At Org.apache.catalina.core.applicationfilterconfig.<init> (applicationfilterconfig.java:103)
At Org.apache.catalina.core.StandardContext.filterStart (standardcontext.java:4638)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5294)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:895)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:871)
At Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908)
At Java.lang.Thread.run (thread.java:619)
caused By:unable to load configuration. -action-file:/c:/program%20files/apache%20software%20foundation/tomcat%207.0/webapps/mystruts2_2/web-inf/ classes/struts.xml:8:68
At Com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (configurationmanager.java:58)
At Org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (dispatcher.java:374)
At Org.apache.struts2.dispatcher.Dispatcher.init (dispatcher.java:418)
... More
caused By:action class [com.keshuo.action.LoginVerifyAction] not found-action-file:/c:/program%20files/apache% 20software%20foundation/tomcat%207.0/webapps/mystruts2_2/web-inf/classes/struts.xml:8:68
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction (Xmlconfigurationprovider.java : 409)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction (Xmlconfigurationprovider.java : 354)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage (Xmlconfigurationprovider.java : 468)
At Com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages (Xmlconfigurationprovider.java : 264)
At Org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages (Strutsxmlconfigurationprovider.java : 111)
At Com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (defaultconfiguration.java:193)
At Com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (configurationmanager.java:55)

... More

I thought, I have to learn new things again.

For the "Exception starting filter Struts2" and the "Dispatcher initialization failed" two errors, The most explanation given by netizens is that the introduction of jar packages is less:

Check out these 5 basic jar packages:

Commons-logging-api-1.1.jar

Freemarker-2.3.8.jar

Ognl-2.6.11.jar

Struts2-core-2.0.12.jar

Xwork-2.0.6.jar

Indeed, a "Commons-logging-api-1.1.jar" is missing, and the problem is not resolved. What to do?

elder brother Help check Together "Applicationcontext.xml" when found, configure hibernate when the configuration file is written more.

<property name= "mappingresources" ><list><span style= "White-space:pre" ></span><value >cn/itcast/shop/user/vo/User.hbm.xml</value></list>

this "hbm.xml" does not exist in my work space at all now.

In addition to this, in Web. XML :

<filter>        <filter-name>struts2</filter-name>        <filter-class> Org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class> </filter>

See on the Internet: This should be the case if the Struts2 version is 2.1 before the Web. XML Config Filter:<filter-class> Org.apache.struts2.dispatcher.filterdispatcher</filter-class>
If the struts2 version is more than 2.1 Web. XML Configuration <filter-class> Org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class>, Although I wrote the 2.1 version of the configuration statement, but again changed a bit here, unexpectedly successful, but also drunk.

So , at the beginning of this problem, two points:

First, the basic Jar package is fully quoted, basically the Web-based data can be solved.

Second, check the configuration of Struts.xml and Web. XML and the Applicationcontext.xml three configuration files, especially

(1) Spring core Listener in Web. XML:

<!--Configure Spring's core listener-<listener>        <listener-class> Org.springframework.web.context.contextloaderlistener</listener-class> </listener>  < context-param>        <param-name>contextConfigLocation</param-name>        <param-value> Classpath:applicationcontext.xml</param-value> </context-param>

(2) core filter in Struts

<!--Configure core filters for Struts2--<filter>        <filter-name>struts2</filter-name>        < Filter-class>org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class> < /filter>  <filter-mapping>        <filter-name>struts2</filter-name>        <url-pattern >/*</url-pattern>        <dispatcher>REQUEST</dispatcher>        <dispatcher>forward</ Dispatcher> </filter-mapping>

consider whether the version of Struts is 2.1 and then configure the content in <filter-class></filter-class>.

A rookie, is learning how to fly.

"SSH" Dispatcher initialization failed && Exception Startingfilter struts2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.