Cannot convert value of type com solacesystems jms impl SolQueueImpl
Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property ‘targetConnectionFactory’: no matching editors or conversion strategy found
WARNING: Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solaceCachedConnectionFactory' defined in class path resource [solace-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.solacesystems.jms.impl.SolQueueImpl' to required type 'javax.jms.ConnectionFactory' for property 'targetConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.javahonk.SolaceMessageProducerApp.main(SolaceMessageProducerApp.java:21) Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.solacesystems.jms.impl.SolQueueImpl' to required type 'javax.jms.ConnectionFactory' for property 'targetConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:476) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:506) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1515) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1474) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 11 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:287) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:461) ... 17 more Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solaceCachedConnectionFactory' defined in class path resource [solace-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.solacesystems.jms.impl.SolQueueImpl' to required type 'javax.jms.ConnectionFactory' for property 'targetConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.javahonk.SolaceMessageProducerApp.main(SolaceMessageProducerApp.java:21) Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.solacesystems.jms.impl.SolQueueImpl' to required type 'javax.jms.ConnectionFactory' for property 'targetConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:476) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:506) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1515) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1474) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 11 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.solacesystems.jms.impl.SolQueueImpl] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:287) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:461) ... 17 more
Solution: You get this exception while trying to integrate Solace with Spring using JMS. This happens if you use JNDI name in place of JMS-Persistent Connection Factory. If you are not sure then visit my this tutorial. But little more details here:
First either you or your company administrator on-board Solace VPN they will send you all information something as below:
- VPNName
- MessagingURL
- JMS-Persistent Connection Factory(Window size 1) – Use this in place of JNDI name for Queue
- JMS-NonPersistent Connection Factory(Window size 255)
- JMS-Direct Connection Factory(direct-no Ack back) – Use this in place of JNDI name for Topic
And once VPN creation is done then you could create your own queue. During creation of the queue you provide JNDI name as well so don’t get confuse while using Spring JMS or directly JMS and use JNDI name. Use JMS-Persistent Connection Factory. If you are suing topic then use JMS-Direct Connection Factory.
Reference: