-2

I try to develop a web application (Struts 2, Spring, Hibernate) using Maven, in eclipse. I first create a simple Maven project, I joined Struts2, and everything goes perfectly. When I tried to integrate Spring and struts2-spring-plugin, I always have a 404 error. Once I remove the dependence of struts2-spring-plugin my pom.xml, the application running again.

<dependency>
    <groupId> org.apache.struts </groupId>
    <artifactId> struts2-spring-plugin </artifactId>
    <version> 2.3.16.3 </version>
</dependency>
Diogo Rocha
  • 9,759
  • 4
  • 48
  • 52

2 Answers2

0

Do you have already defined the object mapper like explained in the struts2 spring plugin documentation?

<struts>
  <constant name="struts.objectFactory" value="spring" />
  ... 
</struts>

If you have defined it would be great if you could provide some more details about your config and your log messages.

Johannes
  • 2,060
  • 3
  • 17
  • 27
  • 1
    Doesn't the Spring plugin set the object factory automatically? I don't recall having to set it by hand. – Dave Newton Nov 24 '15 at 14:44
  • 2
    Dave you are right, this setting is not always necessary "If you are using more than one object factory, * you will need to set the struts.objectFactory property". But this and the missing listener are the must error root causes for this kind of errors. – Johannes Nov 25 '15 at 07:22
0

you are not forced to add struts2-spring-plugin to work wirh spring, hibernate and struts. I work with project containing spring, struts2, hibernate and spring security and i dont have a configuration problem. You just should keep attention to the versions. Spring version should be the same to spring security version, but for struts 2 and hibernate there is no conflicts.