
Originally Posted by
cags
Hi,
I'm trying to set defaultdestination for jmsTemplate and is giving me
Failed to convert property value of type [weblogic.jms.client.JMSConnectionFactory] to required type [javax.jms.Destination] for property 'defaultDestination'
Can you please advice me on solving this!!
spring-jms.xml
<bean id="jmsSendExample" class="vista.springframework.jmssample.JmsSendExam ple">
<property name="jmsTemplate">
<ref bean="jmsTemplate"/>
</property>
</bean>
<bean id="jmsDestination"
class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName"><value>jms/queue</value></property>
<property name="resourceRef"><value>true</value></property>
</bean>
<!-- JMS Queue Template -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<ref bean="internalJmsQueueConnectionFactory"/>
</property>
<property name="defaultDestination">
<ref bean="jmsDestination"/>
</property>
<property name="receiveTimeout">
<value>30000</value>
</property>
</bean>
<!-- JMS Queue Connection Factory -->
<bean id="internalJmsQueueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName"><value>jms/connectionFactory</value></property>
<property name="resourceRef"><value>true</value></property>
</bean>
Please find the trace :
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jmsSendExample' defined in class path resource [vista/springframework/jmssample/spring-jms.xml]: Cannot resolve reference to bean 'jmsTemplate' while setting bean property 'jmsTemplate'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jmsTemplate' defined in class path resource [vista/springframework/jmssample/spring-jms.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jmsTemplate' defined in class path resource [vista/springframework/jmssample/spring-jms.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
Caused by: PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [weblogic.jms.client.JMSConnectionFactory] to required type [javax.jms.Destination] for property 'defaultDestination'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Thanks,
Chris