Announcement Announcement Module
Collapse
No announcement yet.
Failed to convert [javax.naming.Reference] to [javax.jms.ConnectionFactory] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed to convert [javax.naming.Reference] to [javax.jms.ConnectionFactory]

    Hi,

    I am tring to deploy maven based JMS application in to weblogic 10.0.
    When i deploy it gives below error.

    Code:
    <Nov 4, 2008 1:23:39 PM EST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueConnectionFactory' defined in ServletContext resource [/WEB-INF/Spring-JMS-Context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [javax.naming.Reference] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [javax.naming.Reference] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueConnectionFactory' defined in ServletContext resource [/WEB-INF/Spring-JMS-Context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [javax.naming.Reference] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [javax.naming.Reference] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
    	at java.security.AccessController.doPrivileged(Native Method)
    And i found from another forum that this may be class loaded problem. They suggested to remove jms.jar from war to get rid of this problem.

    I have removed jms.jar file from war file. Still i am getting same error.

    Please suggest me how to make this work?

    Thanks,
    Laks
    Last edited by laknarayan; Nov 4th, 2008, 02:16 PM.

  • #2
    Looks like i need to add com.ibm.mqjms.jar file in the project to get away from this error. but no where the error trace pointing it.

    some how resolved.

    Thanks,
    Laks

    Comment


    • #3
      Thanks for updating the solution. I had to include imq-4.4U1.jar on classpath for Sun MQ. Saved my day!

      Comment


      • #4
        Thanks, it really helps me. I just added imq-4.2.jar to my classpath.

        Comment


        • #5
          Hi, I am having same issue like this and I have those jar file in my class path: com.ibm.mq, com.ibm.mq.headers, com.ibm.mq.jmqi,com.ibm.mq.pcf,com.ibm.mqjms,dhbco re,fscontext,providerutil.
          I am using Spring Release 3.2.1 and is trying to deploy to JBOSS server 7.0.1

          Could someone tell me what I missed here. Thanks in Advance!

          Below is the Spring configuration:


          <bean id="jmsContainer"
          class="org.springframework.jms.listener.DefaultMes sageListenerContainer">

          <property name="connectionFactory" ref="connectionFactory" />
          <property name="destination" ref="destinationIn" />
          <property name="messageListener" ref="jmsMessageListener" />
          </bean>


          <!-- Define JMS listener -->
          <bean id="jmsMessageListener"
          class="com.vermontmutual.neps.thunderhead.message. listener.NepsToThunderheadMessageListener">
          </bean>

          <!-- Define the jndi template specifying the Initial Context -->
          <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
          <property name="environment">
          <props>
          <prop key="java.naming.provider.url">
          file:JNDI-Directory
          </prop>
          <prop key="java.naming.factory.initial">
          com.sun.jndi.fscontext.RefFSContextFactory
          </prop>
          </props>
          </property>
          </bean>

          <!-- Define the JMS Connection Factory -->
          <bean id="connectionFactory"
          class="org.springframework.jndi.JndiObjectFactoryB ean">
          <property name="jndiTemplate" ref="jndiTemplate" />
          <property name="jndiName" value="winsToTranslatorCF" />
          <property name="lookupOnStartup" value="false" />
          <property name="cache" value="true" />
          <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
          </bean>

          <!-- Definite the JMS destination -->
          <bean id="destinationIn"
          class="org.springframework.jndi.JndiObjectFactoryB ean">
          <property name="jndiTemplate" ref="jndiTemplate" />
          <property name="jndiName" value="winsToTranslatorQueueIn" />
          </bean>

          Comment

          Working...
          X