0
votes

I am new to Spring Integration, currently I am facing one issue with Spring-JMS integration for IBM MQ. Currently only problem with Spring-JMS integration. Below mentioned are the Jar's considered for build. Kindly help me to resolve this issue.

org.springframework.integration-1.0.3.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-integration-core-2.0.5.RELEASE.jar
spring-integration-jms-2.0.5.RELEASE.jar
spring-integration-stream-2.0.5.RELEASE.jar
spring-jms-3.0.6.RELEASE.jar
spring-xml-2.0.3.RELEASE.jar
org.springframework.integration-1.0.3.RELEASE.jar



   Code Snippet Starts: 
<?xml version="1.0" encoding="UTF-8"?>

<beans:beans xmlns="http://www.springframework.org/schema/integration" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns:ctx="http://www.springframework.org/schema/context" 
    xmlns:jms="http://www.springframework.org/schema/integration/jms" 
    xmlns:stream="http://www.springframework.org/schema/integration/stream" 
    xmlns:si-xml="http://www.springframework.org/schema/integration/xml" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-2.5.xsd 
            http://www.springframework.org/schema/integration 
            http://www.springframework.org/schema/integration/spring-integration-2.0.xsd 
            http://www.springframework.org/schema/integration/jms 
            http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.0.xsd 
            http://www.springframework.org/schema/integration/stream 
            http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd 
            http://www.springframework.org/schema/integration/xml 
            http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd 
            http://www.springframework.org/schema/util 
            http://www.springframework.org/schema/util/spring-util.xsd">

    <ctx:component-scan base-package="com.iflexsolutions.fcpb"/>    

    <channel id="InputJMSChannel"/> 

    <jms:message-driven-channel-adapter id="TestJMSAdapter"
            destination="requestQueue" extract-payload="true" 
            connection-factory="connectionFactory" 
            channel="InputJMSChannel" 
    />

    <service-activator id="TestJMSServiceActivator" 
        input-channel="InputJMSChannel" 
        output-channel="stdout"
        ref="wmXMLTransformerBean"
        method="validateAndTransform"/>

    <stream:stdout-channel-adapter id="stdout"/>

</beans:beans>
    Code Snippet Starts: 

Error Details: 
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.jms.ChannelPublishingJmsMessageListener#0': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.integration.channel.DirectChannel' to required type 'org.springframework.integration.MessageChannel' for property 'requestChannel'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.integration.channel.DirectChannel] to required type [org.springframework.integration.MessageChannel] for property 'requestChannel': no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at com.iflexsolutions.fcpb.mobilebanking.jms.test.LoadApp.main(LoadApp.java:11)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.integration.channel.DirectChannel' to required type 'org.springframework.integration.MessageChannel' for property 'requestChannel'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.integration.channel.DirectChannel] to required type [org.springframework.integration.MessageChannel] for property 'requestChannel': no matching editors or conversion strategy found
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:481)
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:518)
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    ... 11 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.integration.channel.DirectChannel] to required type [org.springframework.integration.MessageChannel] for property 'requestChannel': no matching editors or conversion strategy found
    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:233)
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:466)
    ... 17 more
1

1 Answers

0
votes

It looks like you have classpath issues - specifically...

spring-integration-core-2.0.5.RELEASE.jar org.springframework.integration-1.0.3.RELEASE.jar

1.0.x is not compatible with 2.0.x.

Aside from this mismatch, I would recommend you use the current versions of Spring Framework (4.1.4) and Spring Integration (4.1.2).