problems encountered:
Unable to load config class org.apache.struts2.interceptor.I18nInterceptor at interceptor
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.opensymphony.xwork2.LocaleProvider] is defined:
Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath
Cause of the problem:
This struts2 configuration and spring4 Action bean configuration about
struts2 configuration:
<constant name="struts.objectFactory.spring.autoWire" value="type" />
spring4 action bean configuration configuration
<bean id="dicCBBAction" class="com.asiainfo.migration.struts2.action.cbb.DictionaryCBBAction" scope="prototype"> <property name="dataService"> <ref bean="tPubDictionaryService" /> </property> </bean>
Solution:
Modify the spring configuration to:
<bean id="dicCBBAction" class="com.asiainfo.migration.struts2.action.cbb.DictionaryCBBAction" autowire="no" autowire-candidate="false" scope="prototype"> <property name="dataService"> <ref bean="tPubDictionaryService" /> </property> </bean>
Added autowire="no" autowire-candidate="false" above, problem solved!
In addition, the details of the integration of struts2.5.5 and spring4.3.3 are attached:
if the dynamic method call of struts is used
]<constant name="struts.enable.DynamicMethodInvocation" value="true" />[/
For struts2.5.5 package need to add strict-method-invocation="false"
<package name="admin" namespace="/admin" extends="struts-default" strict-method-invocation="false">