Announcement Announcement Module
Collapse
No announcement yet.
error in loading xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • error in loading xml

    Hi,
    I'm seeing this error in loading xml
    Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.integration.MessageChannel' for property 'defaultOutputChannel'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.MessageChannel] for property 'defaultOutputChannel': no matching editors or conversion strategy found



    <bean id="errorException"
    class="org.springframework.integration.router.Erro rMessageExceptionTypeRouter">
    <property name="channelMappings">
    <util:map>
    <entry key="java.lang.Exception" value="retrySftpCahnnel" />
    <entry key="java.io.IOException" value="retrySftpCahnnel" />
    <entry key="java.net.SocketException" value="retrySftpChannel" />
    <entry key="com.jcraft.jsch.JSchException" value="retrySftpChannel" />
    </util:map>
    </property>
    <property name="defaultOutputChannel" ref="processChannel"/>
    </bean>

    <int:channel id="processChannel" />
    <int:service-activator input-channel="processChannel"
    ref="errorHandler" method="handleMessageException" />

    <bean id="errorHandler" class="......">
    </bean>

    What could be wrong?
    thanks

  • #2
    There is nothing wrong. I just ran it and it works fine. Perhaps you are not including everything there is

    Comment


    • #3
      Also, you can simplify configuration by using namespace support for exception type router http://static.springsource.org/sprin...ception-router

      Comment


      • #4
        no luck..

        I consistently see this error...something to do with editor...

        Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'errorException' defined in ServletContext resource [/WEB-INF/spring/ftp-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedEx ception: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.integration.MessageChannel' for property 'defaultOutputChannel'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.MessageChannel] for property 'defaultOutputChannel': no matching editors or conversion strategy found

        Comment


        • #5
          Try this config and see what's different
          Code:
          <beans xmlns="http://www.springframework.org/schema/beans"
          	xmlns:int="http://www.springframework.org/schema/integration"
          	xmlns:int-gfe="http://www.springframework.org/schema/integration/gemfire"
          	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
          	xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd
          		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
          		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
          
          	<bean id="errorException"
          		class="org.springframework.integration.router.ErrorMessageExceptionTypeRouter">
          		<property name="channelMappings">
          			<util:map>
          				<entry key="java.lang.Exception" value="retrySftpCahnnel" />
          			</util:map>
          		</property>
          		<property name="defaultOutputChannel" ref="processChannel" />
          	</bean>
          
          	<int:channel id="processChannel" />
          	<int:channel id="retrySftpCahnnel" />
          
          </beans>

          Comment


          • #6
            his config actually worked.Any idea what could be the issue with the first one?

            Thank you

            Comment


            • #7
              I don't see the entire XML so I can't say

              Comment


              • #8
                Question regarding injection...

                So I'm injecting the sftpsession factory bean from the config file
                But in case of channeld ,how do I autowire or inject them from theconfig file

                Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.config.ServiceAct ivatorFactoryBean#0': Cannot resolve reference to bean 'myMessageHandler' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myMessageHandler': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.springframework.integration.MessageChannel com.fujitsu.alpine.app.pm.impl.PMExporter.sftpChan nel; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No unique bean of type [org.springframework.integration.MessageChannel] is defined: expected single matching bean but found 9: [inboundAdapter, sendChannel, processChannel, retrySftpCahnnel, inboundFailedFiles, nullChannel, errorChannel, retrySftpChannel, retryChannel]

                Comment

                Working...
                X