简体   繁体   English

Weblogic和Spring JMS配置抛出java.lang.IllegalStateException

[英]Weblogic and Spring JMS configuration throws java.lang.IllegalStateException

Converting EJB MDB application to Spring base JMS service. 将EJB MDB应用程序转换为Spring基本JMS服务。

JMS Queue configuration is in Weblogic server. JMS队列配置位于Weblogic服务器中。

Have following in configuration in applicationContext XML file. 在applicationContext XML文件中进行以下配置。

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">


    <bean id="vTMessageQueueListener" class="com.collection.mom.sink.EventMessageBean" />

    <bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>
        <property name="jndiName">
            <value>/jms/FilingTopicConnFact</value>
        </property>
    </bean>

    <bean id="jmsDestinationResolver"
        class="org.springframework.jms.support.destination.JndiDestinationResolver">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>
        <property name="cache">
            <value>true</value>
        </property>
    </bean>

    <bean id="QueueTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory">
            <ref bean="queueConnectionFactory" />
        </property>
        <property name="destinationResolver">
            <ref bean="jmsDestinationResolver" />
        </property>
    </bean>

    <bean id="SMMessageQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
        <!--<property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>-->
        <property name="jndiName">
            <value>com/vx/jms/vTMessageQueue</value>
        </property>
    </bean>


    <bean id="V3JMSlistener" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="concurrentConsumers" value="5" />
        <property name="connectionFactory" ref="queueConnectionFactory" />
        <property name="destinationName" ref="SMMessageQueue"/>
        <property name="messageListener" ref="vTMessageQueueListener" />
    </bean>

</beans>

.

<HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'V3JMSlistener' defined in class path resource [SpringJMSContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName': no matching editors or conversion strategy found.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'V3JMSlistener' defined in class path resource [SpringJMSContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName': no matching editors or conversion strategy found
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:584)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName': no matching editors or conversion strategy found
        at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:590)
        at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:604)
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:219)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1697)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1653)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalStateException: Cannot convert value of type 'weblogic.jms.common.DestinationImpl' to required type 'java.lang.String' for property 'destinationName': no matching editors or conversion strategy found
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:299)
        at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:585)
        at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:604)
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:219)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1697)
        Truncated. see log file for complete stacktrace

Any help will be appreciated!!! 任何帮助将不胜感激!!!

Use 采用

<property name="destination" ref="SMMessageQueue"/>

instead of destinationName . 而不是destinationName

Spring can resolve a destination from its name but since you have the destination, you should inject that directly. Spring可以从其名称解析目标,但由于你有目的地,你应该直接注入。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 春季-引发java.lang.IllegalStateException异常-JUnit - Spring - Throws java.lang.IllegalStateException Exception - JUnit Spring Ehcache 配置:java.lang.IllegalStateException:错误 - Spring Ehcache configuration : java.lang.IllegalStateException: error Spring 3.1.1 中的@Configuration 标记给出 java.lang.IllegalStateException - @Configuration tag in Spring 3.1.1 gives java.lang.IllegalStateException Spring JPA测试java.lang.IllegalStateException - Spring JPA Test java.lang.IllegalStateException 春季启动 java.lang.IllegalStateException - Spring boot java.lang.IllegalStateException Spring Boot 集成测试抛出错误“java.lang.IllegalStateException: Timeout on blocking read for 5000 MILLISECONDS” - Spring Boot Integration test throws error "java.lang.IllegalStateException: Timeout on blocking read for 5000 MILLISECONDS" java.lang.IllegalStateException - java.lang.IllegalStateException 获取 java.lang.IllegalStateException:在 Spring 启动中执行测试 class 时检测到 Logback 配置错误 - Getting java.lang.IllegalStateException: Logback configuration error detected while executing Test class in Spring boot Spring 应用程序无法启动,出现异常 java.lang.IllegalStateException:无法加载配置 class:SpringAnnotPckg.JavaConfig - Spring application failing to start with the exception java.lang.IllegalStateException: Cannot load configuration class: SpringAnnotPckg.JavaConfig JavaFX .getChildren()。add(root)抛出java.lang.IllegalStateException - JavaFX .getChildren().add(root) throws java.lang.IllegalStateException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM