18:23:26,988 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/strutsNew]] (MSC service thread 1-2) Exception starting filter struts2: Unable to load configuration. - action - vfs:/C:/jboss-as-web-7.0.0.Final/bin/content/strutsNew.war/WEB-INF/classes/struts.xml:5:37
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431) [struts2-core-2.1.8.1.jar:]
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) [struts2-core-2.1.8.1.jar:]
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) [struts2-core-2.1.8.1.jar:]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3245) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3836) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_45]
at java.lang.Thread.run(Unknown Source) [:1.6.0_45]
Caused by: Unable to load configuration. - action - vfs:/C:/jboss-as-web-7.0.0.Final/bin/content/strutsNew.war/WEB-INF/classes/struts.xml:5:37
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) [xwork-core-2.1.6.jar:]
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374) [struts2-core-2.1.8.1.jar:]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418) [struts2-core-2.1.8.1.jar:]
... 11 more
Caused by: Action class [login] not found - action - vfs:/C:/jboss-as-web-7.0.0.Final/bin/content/strutsNew.war/WEB-INF/classes/struts.xml:5:37
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:409) [xwork-core-2.1.6.jar:]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:354) [xwork-core-2.1.6.jar:]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:468) [xwork-core-2.1.6.jar:]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:264) [xwork-core-2.1.6.jar:]
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111) [struts2-core-2.1.8.1.jar:]
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193) [xwork-core-2.1.6.jar:]
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55) [xwork-core-2.1.6.jar:]
... 13 more
18:23:26,988 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error filterStart
18:23:26,988 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/strutsNew] startup failed due to previous errors
18:23:26,988 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/strutsNew]] (MSC service thread 1-2) Closing Spring root WebApplicationContext
18:23:26,988 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/strutsNew]] (MSC service thread 1-2) Shutting down log4j
18:23:26,988 INFO [org.jboss.web] (MSC service thread 1-2) registering web context: /strutsNew
18:23:26,988 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Replaced deployment "strutsNew.war" with deployment "strutsNew.war"
请帮我解决Struts2和spring集成的错误 我正在使用jboss服务器, 并使用build.properties和build.xml文件 的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>StrutsNewFirststrutsInteg</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts.xml中
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="abc" extends="struts-default">
<action name="login" class="login" >
<result name="success">welcome.jsp</result>
</action>
</package>
</struts>
的applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="login" class="com.cluster.action.Login">
<property name="message" value="Welcome Spring"></property>
</bean>
</beans>
答案 0 :(得分:0)
正确使用正确的struts2-spring插件,因为你使用jar知道插件和我使用(struts2-spring-plugin-2.1.6.jar)。只需将此添加到lib文件夹并重新构建项目即可获得正确的输出,如果出现上述错误
感谢所有的建议。