Announcement Announcement Module
Collapse
No announcement yet.
Spring -Weblogic java.lang.IllegalArgumentException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring -Weblogic java.lang.IllegalArgumentException

    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

  • #2
    Do you have jms set up properly in weblogic?

    Apparenly what you have in your jndi tree under jms/queue is a JMSConnectionFactory, not a queue. You need to set up a queue after setting up a server under jms in the console. Setting that up wasn't obvious to me the first time.

    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

    Comment

    Working...
    X