gpt4 book ai didi

java - struts 2.3.16.1 升级为 Spring 框架中的 struts xwork 和 SimpleMessageListenerContainer 提供 TypeMismatchException

转载 作者:行者123 更新时间:2023-11-30 09:09:44 26 4
gpt4 key购买 nike

我已经从 struts 2.0 升级到 2.3.16.1,以便为我的 web 应用程序获取 struts 中的最新安全修复

当我升级部署在 tomcat 服务器时,出现以下错误:

Caused by: Unable to load configuration. - interceptor - jar:file:/C:/Projects/apache-tomcat-7.0.50/webapps/myweb/WEB-INF/lib/struts2-core-2.3.16.1.jar!/struts-default.xml:167:106 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)

Caused by: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.FileUploadInterceptor - interceptor - jar:file:/C:/Projects/apache-tomcat-7.0.50/webapps/myweb/WEB-INF/lib/struts2-core-2.3.16.1.jar!/struts-default.xml:167:106

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.jms.listener.SimpleMessageListenerContainer] to required type [com.opensymphony.xwork2.inject.Container] for property 'container'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.jms.listener.SimpleMessageListenerContainer] to required type [com.opensymphony.xwork2.inject.Container] for property 'container': no matching editors or conversion strategy found

为方便起见,下面给出了我的配置

下面给出了 pom.xml 中的 maven 配置

<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.16.1</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.16.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.16.1</version>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.8</version>
</dependency>

spring bean.xml的配置

<bean id="container" class="org.springframework.jms.listener.SimpleMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="messageListener" ref="listener" />
<property name="destination" ref="requestQueue" />
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="defaultDestination" ref="requestQueue" />
</bean>

<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="MYEMAILQUEUE" />
</bean>
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616?keepAlive=true" />
</bean>

如果有人能提供解决此问题的解决方案或想法,我们将不胜感激。

最佳答案

我猜这与错误的库有关。

仔细查看 Struts2 project dependencies .

这个

<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.3</version>
</dependency>

应该是2.3.16.1,例如其他...

关于java - struts 2.3.16.1 升级为 Spring 框架中的 struts xwork 和 SimpleMessageListenerContainer 提供 TypeMismatchException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22927262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com