Invalid action class configuration that references an unknown class named

1

I have an application in Struts2 and Spring with Maven, but when trying to perform an action, the following error occurs:

Invalid action class configuration that references an unknown class named 

Exception:

java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [ThemeAction]
  org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:99)

This is the configuration of the Struts in pom.xml

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>${org.strutsframework-version}</version>
</dependency>

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-spring-plugin</artifactId>   
    <version>${org.strutsframework-version}</version>
</dependency>

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-convention-plugin</artifactId>
    <version>${org.strutsframework-version}</version>
</dependency>

In this way I call an action of Struts

<action name="actionName" method="execute" class="ClassAction">
    <result name="success">/pages/fileName.jsp</result>    
</action>

and in this way I declare the action in the Spring.xml

<bean class="com.test.action.ClassAction" id="ClassAction">
    <property name="classService" ref="classService"/>
</bean>


How can I solve the error?

    
asked by Andres Guillermo Castellanos A 10.01.2017 в 20:18
source

1 answer

0

In order for Spring dependency injection to work, it is necessary to include in the deployment descriptor, web.xml, the listener ContextLoaderListener in charge of loading the Spring context and therefore Struts2 can use the ClassAction instance as a bean to manage the request.

    
answered by 16.01.2017 в 17:12