Results 1 to 4 of 4

Thread: recipientlistrouter not working with 1.0.3 update

  1. #1

    Default recipientlistrouter not working with 1.0.3 update

    a config that was working without issue now seems to have an issue when updating to 1.0.3. I am assuming there is something I need to update in my config, but the errors almost sound like an issue in the framework. any thoughts?

    Code:
    	<!-- chain used in case other actions added -->
    	<si:chain input-channel="channel0">
    		<si:router ref="msgRouter" resolution-required="true"/>
    	</si:chain>
    	
    	<bean id="msgRouter" class="org.springframework.integration.router.RecipientListRouter">
    		<property name="channels">
    			<list>
    				<ref bean="channel1"/>
    				<ref bean="channel2"/>
    				<ref bean="channel3"/>	 
    				<ref bean="channel4"/>	
    			</list>
    		</property>
    	</bean>

    Code:
    20:58:54,800 ERROR [JBossSpringAdapter] [main] **** Failed to start Spring context:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ConsumerEndpointFactoryBean#0': Cannot resolve reference to bean 'org.springframework.integration.handler.MessageHandlerChain#3' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.handler.MessageHandlerChain#3': Cannot resolve reference to bean 'org.springframework.integration.config.RouterFactoryBean#1' while setting bean property 'handlers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: More than one method matches type [boolean]. Consider using annotations or providing a method name.
    .
    Code:
    20:58:54,784 INFO  [MessageMappingMethodInvoker] [main] Failed to find any valid Message-handling methods with annotation [interface org.springframework.integration.annotation.Router] on target class [class org.springframework.integration.router.RecipientListRouter]. Method-resolution will be applied to all eligible methods.

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

    Default

    This is happening because the RecipientListRouter no longer extends AbstractMessageRouter, and this is the check in the RouterFactoryBean:
    Code:
      private AbstractMessageRouter createRouter(Object targetObject, String targetMethodName) {
          if (targetObject instanceof AbstractMessageRouter) {
              ...
              return (AbstractMessageRouter) targetObject;
          }
          MethodInvokingRouter router = ...
    So, it's trying to create a MethodInvokingRouter instance.

    The reason that RecipientListRouter no longer extends AbstractMessageRouter is that it needed to be more flexible to support the 'apply-sequence' attribute:
    http://jira.springframework.org/browse/INT-679

    Unfortunately this caused a regression issue because of that code above.

    Can you please open a JIRA issue for this?

    In the meantime, you should be able to use the new 'recipient-list-router' element directly within the 'chain':
    http://jira.springframework.org/browse/INT-697

    Can you please try that?

  3. #3

    Default

    mark,

    that seems to have resolved the issue. thanks for the quick response. JIRA issue created.

    http://jira.springsource.org/browse/INT-745

  4. #4
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

Posting Permissions

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