为了账号安全,请及时绑定邮箱和手机立即绑定

WARN | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsContainer' defined in class path resource [consumer.xml]: Initialization of

WARN | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsContainer' defined in class path resource [consumer.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsContainer' defined in class path resource [consumer.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)

at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:161)

at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:51)

at com.easylab.jms.producer.AppConsumer.main(AppConsumer.java:28)

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found

at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:591)

at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:603)

at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:204)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1527)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

... 11 more

Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found

at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:302)

at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)

... 17 more


正在回答

1 回答

错误原因找到是属性写错了

<bean id="jmsContainer" class=" org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ="queueDestination"/>
    
    
 <property name="destination" ref="queueDestination"/>这是正确的
    
    <property name="destination" ref="queueDestination"/>
    <property name="messageListener" ref="consumerMessageListener"/>
</bean>


1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

WARN | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsContainer' defined in class path resource [consumer.xml]: Initialization of

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信