Results 1 to 9 of 9

Thread: Spring Integration - Sonic MQ

  1. #1
    Join Date
    Apr 2008
    Posts
    6

    Default Spring Integration - Sonic MQ

    Hi everybody,
    I'm trying to make an "simple" hello world using Spring Integration with Sonic MQ 7.5. I where being reading documentation in pdf file, running the samples, reading some post here and nothing. I guess the error is the interface between the computer and the chair I know is a bad joke but I'm at this stage now... ).
    Im working with M3, I just modified the Hello World example to get information for a Sonic Queue called SampleQ1.

    thanks in advance!!!!

    <?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"
    ...
    >

    <message-bus/>

    <channel id="inputChannel" />
    <channel id="outputChannel" />

    <endpoint input-channel="inputChannel"
    default-output-channel="outputChannel"
    handler-ref="helloService"
    handler-method="sayHello"/>

    <beans:bean id="helloService" class="org.springframework.integration.samples.hel loworld.HelloService"/>

    <channel id="queueChannel" />

    <jms-source connection-factory="connectionFactory" destination="MySourceAdapter" channel="queueChannel"/>

    <beans:bean id="MySourceAdapter" class="org.springframework.integration.adapter.jms .JmsMessageDrivenSourceAdapter">
    <beans:property name="connectionFactory" ref="connectionFactory" />
    <beans:property name="destination" ref="destinationSa" />
    <beans:property name="channel" ref="inputChannel" />
    </beans:bean>

    <beans:bean id="connectionFactory" class="progress.message.jclient.ConnectionFactory" >
    <!--beans:property name="initialcontext" value="com.sonicsw.jndi.mfcontext.MFContextFactory " /-->
    <!--beans:property name="factoryname" value="SpringFactory" /-->
    <beans:property name="brokerURL" value="tcp://localhost:2506" />
    <!--beans:property name="user" value="Administrator" />
    <beans:property name="password" value="Administrator" />
    <beans:property name="clientid" value="SpringClient" /-->
    </beans:bean>

    <beans:bean id="destinationSa" class="javax.jms.Destination">
    <beans:constructor-arg>
    <beans:value>SampleQ1</beans:value>
    </beans:constructor-arg>
    </beans:bean>

    </beans:beans>

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Based on a quick glance, it looks like the problem is probably in your destination bean definition, since "javax.jms.Destination" is an interface (not a class). You probably intended to have something like "progress.message.jclient.Queue" there instead?

    If possible, include your error message in the post. I would imagine that you're seeing a bean instantiation error for that destination bean?

  3. #3
    Join Date
    Apr 2008
    Posts
    6

    Default

    Mark,
    first of all thank you so much for your reply. Well previously I tryied with some classes, but I always had same error: "Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found".




    Next are just 30 lines in the log file:

    Apr 28, 2008 10:50:52 AM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]; startup date [Mon Apr 28 10:50:52 CDT 2008]; root of context hierarchy
    Apr 28, 2008 10:50:52 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [helloWorldDemo.xml]
    Apr 28, 2008 10:50:52 AM org.springframework.context.support.AbstractApplic ationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3
    Apr 28, 2008 10:50:52 AM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Apr 28, 2008 10:50:53 AM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'errorChannel'
    Apr 28, 2008 10:50:53 AM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'inputChannel'
    Apr 28, 2008 10:50:53 AM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'outputChannel'
    Apr 28, 2008 10:50:53 AM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'queueChannel'
    Apr 28, 2008 10:50:53 AM org.springframework.integration.bus.MessageBus registerEndpoint
    INFO: registered endpoint 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0'
    Apr 28, 2008 10:50:53 AM org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'internal.MessageBus': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.adapter.jms.JmsMe ssageDrivenSourceAdapter#0': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:470)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:404)
    at java.security.AccessController.doPrivileged(Native Method)

  4. #4
    Join Date
    Apr 2008
    Posts
    6

    Default

    Mark,
    I downloaded ActiveMQ5, and tried with it but I got same error:

    Apr 29, 2008 12:32:55 PM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]; startup date [Tue Apr 29 12:32:55 CDT 2008]; root of context hierarchy
    Apr 29, 2008 12:32:55 PM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [helloWorldDemo.xml]
    Apr 29, 2008 12:32:55 PM org.springframework.context.support.AbstractApplic ationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3
    Apr 29, 2008 12:32:55 PM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Apr 29, 2008 12:32:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'errorChannel'
    Apr 29, 2008 12:32:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'inputChannel'
    Apr 29, 2008 12:32:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'outputChannel'
    Apr 29, 2008 12:32:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'queueChannel'
    Apr 29, 2008 12:32:56 PM org.springframework.integration.bus.MessageBus registerEndpoint
    INFO: registered endpoint 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0'
    Apr 29, 2008 12:32:56 PM org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'internal.MessageBus': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.adapter.jms.JmsMe ssageDrivenSourceAdapter#0': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:470)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:404)
    at java.security.AccessController.doPrivileged(Native Method)

  5. #5
    Join Date
    Apr 2008
    Posts
    6

    Default

    this is how xml file looks, any idea?


    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    ...
    >

    <message-bus/>
    <channel id="inputChannel" />
    <channel id="outputChannel" />

    <endpoint input-channel="inputChannel"
    default-output-channel="outputChannel"
    handler-ref="helloService"
    handler-method="sayHello"/>
    <beans:bean id="helloService" class="org.springframework.integration.samples.hel loworld.HelloService"/>

    <channel id="queueChannel" />
    <jms-source connection-factory="connectionFactory" destination="MySourceAdapter" channel="queueChannel"/>
    <beans:bean id="MySourceAdapter" class="org.springframework.integration.adapter.jms .JmsMessageDrivenSourceAdapter">
    <beansroperty name="connectionFactory" ref="connectionFactory" />
    <beansroperty name="destination" ref="destinationSa" />
    <beansroperty name="channel" ref="inputChannel" />
    </beans:bean>
    <beans:bean id="connectionFactory" class="progress.message.jclient.ConnectionFactory" >
    <beansroperty name="brokerURL" value="tcp://localhost:61616" />
    </beans:bean>

    <beans:bean id="destinationSa" class="org.apache.activemq.command.ActiveMQQueue">
    <beans:constructor-arg>
    <beans:value>SampleQ1</beans:value>
    </beans:constructor-arg>
    </beans:bean>
    </beans:beans>

  6. #6
    Join Date
    Apr 2008
    Posts
    6

    Default

    I had a mistake
    <beans:bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFacto ry">
    <!--beans:bean id="connectionFactory" class="progress.message.jclient.ConnectionFactory"-->


    but still don't working:


    Apr 29, 2008 1:00:56 PM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]; startup date [Tue Apr 29 13:00:56 CDT 2008]; root of context hierarchy
    Apr 29, 2008 1:00:56 PM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [helloWorldDemo.xml]
    Apr 29, 2008 1:00:56 PM org.springframework.context.support.AbstractApplic ationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext@ec16a4]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3
    Apr 29, 2008 1:00:56 PM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Apr 29, 2008 1:00:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'errorChannel'
    Apr 29, 2008 1:00:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'inputChannel'
    Apr 29, 2008 1:00:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'outputChannel'
    Apr 29, 2008 1:00:56 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'queueChannel'
    Apr 29, 2008 1:00:56 PM org.springframework.integration.bus.MessageBus registerEndpoint
    INFO: registered endpoint 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0'
    Apr 29, 2008 1:00:57 PM org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@d80be3: defining beans [internal.MessageBus,inputChannel,outputChannel,org .springframework.integration.scheduling.Subscripti on#0,org.springframework.integration.handler.Defau ltMessageHandlerAdapter#0,org.springframework.inte gration.endpoint.DefaultMessageEndpoint#0,helloSer vice,queueChannel,org.springframework.integration. adapter.jms.JmsMessageDrivenSourceAdapter#0,MySour ceAdapter,connectionFactory,destinationSa]; root of factory hierarchy
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'internal.MessageBus': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.adapter.jms.JmsMe ssageDrivenSourceAdapter#0': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.adapter.jms.JmsMes sageDrivenSourceAdapter] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.scheduling.Schedul e]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'org.springframework.integration.scheduling.Subscr iption#0': Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.integration.channel.MessageCha nnel]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: Failed to convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.channel.MessageCha nnel]: no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:470)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:404)
    at java.security.AccessController.doPrivileged(Native Method)


    Thanks

  7. #7
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    You should provide the JMS Destination reference in the jms-source's destination attribute.

    Currently you have:
    <jms-source connection-factory="connectionFactory" destination="MySourceAdapter" channel="queueChannel"/>

    Try changing it to:
    <jms-source connection-factory="connectionFactory" destination="destinationSa" channel="queueChannel"/>

    Also, the <jms-source/> element creates the same class that you are defining in the 'MySourceAdapter' bean definition. I think you want to remove that bean definition altogther. Then, it looks like you might want to set the "channel" attribute of the <jms-source/> element to be "inputChannel" (and you won't need the "queueChannel" anymore).

  8. #8
    Join Date
    Apr 2008
    Posts
    6

    Default

    Mark,
    thx for your answer again, follow your advices but it still donīt working. So I follow this example: http://forum.springframework.org/showthread.php?t=50742
    and it works for me!!! well more less :s, because it works fine with ActiveMQ but with Sonic nop, I suppouse why, but I dont know how. This is the log:

    Apr 29, 2008 7:02:39 PM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@1c29ab2: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@1c29ab2]; startup date [Tue Apr 29 19:02:39 CDT 2008]; root of context hierarchy
    Apr 29, 2008 7:02:39 PM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [sa2.xml]
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext@1c29ab2]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@1434234
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'inputChannel1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'errorChannel'
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus registerChannel
    INFO: registered channel 'inputChannel1'
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'org.springframework.integration.scheduling.Subscr iption#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'MyMdp' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'org.springframework.integration.handler.DefaultMe ssageHandlerAdapter#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus registerEndpoint
    INFO: registered endpoint 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0'
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'connectionFactory' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'destinationSa' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'MySourceAdapter' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus registerSourceAdapter
    INFO: registered source adapter 'MySourceAdapter'
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus activateEndpoint
    INFO: activated subscription to channel 'inputChannel1' for endpoint 'org.springframework.integration.endpoint.DefaultM essageEndpoint#0'
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus start
    INFO: started dispatcher 'org.springframework.integration.dispatcher.Defaul tMessageDispatcher@162dbb6'
    Apr 29, 2008 7:02:40 PM org.springframework.integration.bus.MessageBus start
    INFO: started dispatcher 'org.springframework.integration.dispatcher.Defaul tMessageDispatcher@1cac6db'
    Apr 29, 2008 7:02:41 PM org.springframework.integration.bus.MessageBus start
    INFO: started source adapter 'org.springframework.integration.adapter.jms.JmsMe ssageDrivenSourceAdapter@a613f8'
    Apr 29, 2008 7:02:41 PM org.springframework.integration.bus.MessageBus start
    INFO: message bus started
    Apr 29, 2008 7:02:41 PM org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'internal.MessageBus' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    Apr 29, 2008 7:02:41 PM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@1434234: defining beans [internal.MessageBus,internal.PublisherAnnotationPo stProcessor,internal.SubscriberAnnotationPostProce ssor,internal.MessageEndpointAnnotationPostProcess or,inputChannel1,org.springframework.integration.s cheduling.Subscription#0,org.springframework.integ ration.handler.DefaultMessageHandlerAdapter#0,org. springframework.integration.endpoint.DefaultMessag eEndpoint#0,MyMdp,connectionFactory,MySourceAdapte r,destinationSa]; root of factory hierarchy
    Exception in thread "main" java.lang.NullPointerException
    at org.springframework.integration.samples.helloworld .HelloWorldDemo.main(HelloWorldDemo.java:42)
    Apr 29, 2008 7:02:46 PM org.springframework.jms.listener.DefaultMessageLis tenerContainer refreshConnectionUntilSuccessful
    INFO: Could not refresh JMS Connection - retrying in 5000 ms
    javax.jms.JMSSecurityException: Inauthentic Client
    at progress.message.jimpl.JMSExceptionUtil.createJMSS ecurityException(JMSExceptionUtil.java:134)
    at progress.message.jimpl.JMSExceptionUtil.createJMSS ecurityException(JMSExceptionUtil.java:117)
    at progress.message.jimpl.JMSExceptionUtil.createJMSS ecurityException(JMSExceptionUtil.java:103)
    at progress.message.jimpl.Connection.<init>(Connectio n.java:745)
    at progress.message.jclient.ConnectionFactory.createC onnection(ConnectionFactory.java:2055)
    at progress.message.jclient.ConnectionFactory.createC onnection(ConnectionFactory.java:2028)
    at org.springframework.jms.support.JmsAccessor.create Connection(JmsAccessor.java:188)
    at org.springframework.jms.listener.AbstractJmsListen ingContainer.createSharedConnection(AbstractJmsLis teningContainer.java:209)
    at org.springframework.jms.listener.AbstractJmsListen ingContainer.refreshSharedConnection(AbstractJmsLi steningContainer.java:197)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer.refreshConnectionUntilSuccessful(De faultMessageListenerContainer.java:764)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer.recoverAfterListenerSetupFailure(De faultMessageListenerContainer.java:746)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.run(Def aultMessageListenerContainer.java:875)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: [2101] progress.message.client.EInauthenticClient: Inauthentic Client
    at progress.message.zclient.Connection.connectWithRec overyOpt(Connection.java:941)
    at progress.message.zclient.ReconnectHelper.connectAn dChaseSingleFailoverRedirect(ReconnectHelper.java: 534)
    at progress.message.zclient.Connection.connect(Connec tion.java:1503)
    at progress.message.jimpl.Connection.<init>(Connectio n.java:536)
    ... 9 more


    In the xml file, i have this

    <beans:bean id="connectionFactory" class="progress.message.jclient.ConnectionFactory" >
    <beansroperty name="brokerURL" value="tcp://localhost:2506" />
    <!--beansroperty name="user" value="Administrator" />
    <beansroperty name="password" value="Administrator" /-->
    </beans:bean>

    In order to be able to connect to sonic I need to provide user and password, besides the broker, do you know how could I send it? is possible? I suppose I have to change a xml file, or properties file some thing like that, I guess.

    Thanks

  9. #9
    Join Date
    May 2009
    Posts
    18

    Default

    I know this is an old thread but wanted to provide a current example in the event someone else runs into the same issue...

    Here are the details to connect to sonicmq 8 and pass credentials:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:jee="http://www.springframework.org/schema/jee" xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
    	xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xmlns:int="http://www.springframework.org/schema/integration"
    	xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.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/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
    	
    	<util:properties id="sonicEnvironment">
    		<prop key="java.naming.factory.initial">com.sonicsw.jndi.mfcontext.MFContextFactory</prop> 
    		<prop key="java.naming.provider.url">tcp://localhost:2506</prop> 
    		<prop key="java.naming.security.principal">Admin</prop> 
    		<prop key="java.naming.security.credentials">asmin</prop> 
    		<prop key="com.sonicsw.jndi.mfcontext.domain">Domain1</prop> 
        </util:properties>
       <int:channel id="outputChannel"/>
       <int:channel id="transformedChannel"/>
        
        
        	<jee:jndi-lookup id="connectionFactory"
    		jndi-name="MyConnectionFactory" environment-ref="sonicEnvironment" />
    		
    	<bean id="jmsTransactionManager"
    		class="org.springframework.jms.connection.JmsTransactionManager">
    		<property name="connectionFactory" ref="connectionFactory" />
    	</bean>
    
    <int:transformer input-channel="outputChannel" expression="'Receiving node - APP-NODE-2: payload = '.concat(payload)" output-channel="transformedChannel"/>
    	<int-jms:message-driven-channel-adapter
    		id="c.11isales.salesorder.messagedrivenchanneladapter" error-channel="errorChannel"
    		connection-factory="connectionFactory"
    		destination-name="SampleQ" channel="outputChannel"
    		transaction-manager="jmsTransactionManager"
    		max-concurrent-consumers="1" />
        
        <int-stream:stdout-channel-adapter   append-newline="true"  channel="transformedChannel"/>
        
        
    </beans>
    Enjoy!
    Brian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •