struts2.5.5与spring3.4.4集成报错:Unable to load config class I18nInterceptor
遇到的问题:
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
问题原因:
这struts2的配置和spring4的action bean配置有关
struts2配置:
spring4的action bean配置配置
解决办法:
修改spring配置为:
上面加上了autowire="no" autowire-candidate="false" ,问题解决!
另外附struts2.5.5与spring4.3.3集成的注意细节:
如果使用了struts的动态方法调用
对于struts2.5.5 package需要加上strict-method-invocation="false"
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
问题原因:
这struts2的配置和spring4的action bean配置有关
struts2配置:
<constant name="struts.objectFactory.spring.autoWire" value="type" />spring4的action bean配置配置
<bean id="dicCBBAction" class="com.asiainfo.migration.struts2.action.cbb.DictionaryCBBAction" scope="prototype">
<property name="dataService">
<ref bean="tPubDictionaryService" />
</property>
</bean>解决办法:
修改spring配置为:
<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>上面加上了autowire="no" autowire-candidate="false" ,问题解决!
另外附struts2.5.5与spring4.3.3集成的注意细节:
如果使用了struts的动态方法调用
<constant name="struts.enable.DynamicMethodInvocation" value="true" />对于struts2.5.5 package需要加上strict-method-invocation="false"
<package name="admin" namespace="/admin" extends="struts-default" strict-method-invocation="false">
...全文
相关推荐
MobaXterm终端工具个人学习版安装包及常用配置备份
资源包含 MobaXterm 个人版的安装包以及日常运维常用的基础配置备份文件。适用于网络工程师及运维人员用于日常的服务器管理、SSH 连接及串口调试。 压缩包内附带了个人整理的软件使用技巧与配置说明(仅供个人学习参考)。请各位同行下载后注意,技术工具请尽量支持官方正版,本资源仅供个人测试与交流使用,切勿用于商业环境。
机械臂的「抽风」自救指南:从万向节死锁到毫米级丝滑抓取
机械臂的「抽风」自救指南:从万向节死锁到毫米级丝滑抓取
科技中介服务机构如何借助平台提升技术撮合服务的专业性与响应速度?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
产业园区如何利用AI技术提升科技成果转化服务的响应速度与转化成功率?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
11232131231231是的
11232131231231是的


