Results 1 to 10 of 10

Thread: getting poller exception

  1. #1
    Join Date
    Sep 2011
    Posts
    167

    Default getting poller exception

    Hi,

    I am using header type router in my application, but on finally executing the application i am getting the error that...


    log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlA pplicationContext).
    log4j:WARN Please initialize the log4j system properly.
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.config.ConsumerEn dpointFactoryBean#1': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'org.springframework.integration.config.ConsumerEn dpointFactoryBean#1', and no default poller is available within the context.
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 93)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:290 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:567)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at com.apress.prospringintegration.test.main(test.jav a:38)
    Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'org.springframework.integration.config.ConsumerEn dpointFactoryBean#1', and no default poller is available within the context.
    at org.springframework.util.Assert.notNull(Assert.jav a:112)
    at org.springframework.integration.config.ConsumerEnd pointFactoryBean.initializeEndpoint(ConsumerEndpoi ntFactoryBean.java:180)
    at org.springframework.integration.config.ConsumerEnd pointFactoryBean.afterPropertiesSet(ConsumerEndpoi ntFactoryBean.java:135)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1417)
    ... 12 more



    can u please let me know where I am wrong..?

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    The input channel of your router is a QueueChannel and that is why you need poller configuration on your router. If you want a direct handoff, than remove the 'queue' subelement from your channel so it will become a DirectChannel.

  3. #3
    Join Date
    Sep 2011
    Posts
    167

    Default Still the problem is not solved...!!!

    Hi,

    My coding of input channel is (that is named as output)

    <int:channel id="output" >
    <int:queue capacity="10"/>
    </int:channel>

    Now as u can see there is no queue sub element in my output named channel and also tell me how to make it as a DirectChannel. ..?

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    This is the queue sub-element...

    Code:
    <int:queue capacity="10"/>
    Remove it to make it direct, or add a <poller default="true".../> element to poll for messages in the queue.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Sep 2011
    Posts
    167

    Default

    hi,

    I have done that and thanks a lot, but after doing that i am still stuck up with this any error

    org.springframework.integration.MessageDeliveryExc eption: Dispatcher has no subscribers.
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :104)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at org.springframework.integration.core.MessagingTemp late.doSend(MessagingTemplate.java:288)
    at org.springframework.integration.core.MessagingTemp late.send(MessagingTemplate.java:149)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendMessage(AbstractRep lyProducingMessageHandler.java:176)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendReplyMessage(Abstra ctReplyProducingMessageHandler.java:160)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.produceReply(AbstractRe plyProducingMessageHandler.java:125)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleResult(AbstractRe plyProducingMessageHandler.java:119)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:101)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at org.springframework.integration.core.MessagingTemp late.doSend(MessagingTemplate.java:288)
    at org.springframework.integration.core.MessagingTemp late.send(MessagingTemplate.java:149)
    at org.springframework.integration.router.AbstractMes sageRouter.handleMessageInternal(AbstractMessageRo uter.java:220)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at org.springframework.integration.core.MessagingTemp late.doSend(MessagingTemplate.java:288)
    at org.springframework.integration.core.MessagingTemp late.send(MessagingTemplate.java:149)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendMessage(AbstractRep lyProducingMessageHandler.java:176)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendReplyMessage(Abstra ctReplyProducingMessageHandler.java:160)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.produceReply(AbstractRe plyProducingMessageHandler.java:125)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleResult(AbstractRe plyProducingMessageHandler.java:119)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:101)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at com.apress.prospringintegration.test.main(test.jav a:56)


    Any idea what is going rite now..?

  6. #6
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    That means there is no element consuming the output channel.

    You need to provide us with more of your configuration.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  7. #7
    Join Date
    Sep 2011
    Posts
    167

    Default

    Hi,

    but i have attached the header type router to the output channel, in other words whatever the outcome of the outer channel will be further consumed by the header type route and it will fillter on the bais of the incoming headers ...I am sending u the xml code generated by STS.....


    <?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:int="http://www.springframework.org/schema/integration"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/integration
    http://www.springframework.org/schema/integration/spring-integration-1.0.xsd">


    <!-- <context:annotation-config/>
    <context:component-scan base-package="com.apress.prospringintegration" />
    <int:channel id="input" />
    <jms:outbound-channel-adapter channel="input" destination-name="requestQueue" /> -->
    <!-- <jms:message-driven-channel-adapter channel="output" destination-name="requestQueue" /> -->
    <!-- <int:channel id="output">
    <int:queue capacity="10" />

    </int:channel>
    <int:service-activator input-channel="input" output-channel="output" ref="sh" method="handleMessage" />
    <bean id="sh" class="com.apress.prospringintegration.MessageHand ler"/>

    -->
    <int:channel id="input"/>
    <int:channel id="output" >
    </int:channel>

    <int:service-activator input-channel="input"

    output-channel="output"

    ref="shouter"

    method="shout"/>



    <bean id="shouter" class="com.apress.prospringintegration.Shouter"/>
    <bean id="invact" class="com.apress.prospringintegration.Inventoryac tivator"/>
    <bean id="priact" class="com.apress.prospringintegration.Priceactiva tor"/>






    <int:header-value-router input-channel="output" header-name="type" ignore-channel-name-resolution-failures="true" >
    <int:mapping value="inventory" channel="inventory"/>
    <int:mapping value="price" channel="price" />
    </int:header-value-router>






    <int:channel id="inventory"></int:channel>
    <int:channel id="price"></int:channel>





    </beans>

    Have a look at it...and plz let me know where I went wrong....!!!

  8. #8
    Join Date
    Sep 2011
    Posts
    167

    Default

    Quote Originally Posted by SARAL SAXENA View Post
    Hi,

    but i have attached the header type router to the output channel, in other words whatever the outcome of the outer channel will be further consumed by the header type route and it will fillter on the bais of the incoming headers ...I am sending u the xml code generated by STS.....


    <?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:int="http://www.springframework.org/schema/integration"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/integration
    http://www.springframework.org/schema/integration/spring-integration-1.0.xsd">


    <!-- <context:annotation-config/>
    <context:component-scan base-package="com.apress.prospringintegration" />
    <int:channel id="input" />
    <jms:outbound-channel-adapter channel="input" destination-name="requestQueue" /> -->
    <!-- <jms:message-driven-channel-adapter channel="output" destination-name="requestQueue" /> -->
    <!-- <int:channel id="output">
    <int:queue capacity="10" />

    </int:channel>
    <int:service-activator input-channel="input" output-channel="output" ref="sh" method="handleMessage" />
    <bean id="sh" class="com.apress.prospringintegration.MessageHand ler"/>

    -->
    <int:channel id="input"/>
    <int:channel id="output" >
    </int:channel>

    <int:service-activator input-channel="input"

    output-channel="output"

    ref="shouter"

    method="shout"/>



    <bean id="shouter" class="com.apress.prospringintegration.Shouter"/>
    <bean id="invact" class="com.apress.prospringintegration.Inventoryac tivator"/>
    <bean id="priact" class="com.apress.prospringintegration.Priceactiva tor"/>






    <int:header-value-router input-channel="output" header-name="type" ignore-channel-name-resolution-failures="true" >
    <int:mapping value="inventory" channel="inventory"/>
    <int:mapping value="price" channel="price" />
    </int:header-value-router>






    <int:channel id="inventory"></int:channel>
    <int:channel id="price"></int:channel>





    </beans>

    Have a look at it...and plz let me know where I went wrong....!!!


    Any idea of this prblm...?

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

    Default

    Please do not repeat your own post here.

    If this is the full configuration, it looks like you have no subscribers on either the 'inventory' or 'price' channels.

  10. #10
    Join Date
    Sep 2011
    Posts
    167

    Default

    How to make subscribers for these two channels then...?

Posting Permissions

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