Ошибка интеграции Struts2 spring для загрузки индексной страницы с классом действий

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>

person santosh    schedule 21.07.2015    source источник
comment
Где код? web.xml, struts.xml,...   -  person Andrea Ligios    schedule 21.07.2015
comment
Caused by: Action class [login] not found, он существует?   -  person Dave Newton    schedule 21.07.2015
comment
я упоминал в struts.xml   -  person santosh    schedule 21.07.2015
comment
и я добавил всю банку в папку lib (Web-inf/lib)   -  person santosh    schedule 21.07.2015
comment
Весь смысл баночки...?   -  person Dave Newton    schedule 21.07.2015
comment
Какой загрузчик классов используется для загрузки классов?   -  person Roman C    schedule 22.07.2015
comment
я добавил struts2 и spring jars в папку lib   -  person santosh    schedule 22.07.2015
comment
Наконец-то я получил ответ и пытаюсь получить ответ через плагин...   -  person santosh    schedule 22.07.2015


Ответы (1)


просто правильно используйте правильный плагин struts2-spring, поскольку вы используете банку, помните о плагинах, и я использую (struts2-spring-plugin-2.1.6.jar). просто добавьте это в папку lib и пересоберите проект, вы можете получить правильный вывод, если вы получите ошибку выше

спасибо за все предложения.

person santosh    schedule 22.07.2015