0 Replies Latest reply on Mar 12, 2010 2:34 PM by Roger Cruz

    Getting IllegalArgumentException when using Aggregator

    Roger Cruz Newbie

      Hello

       

      I'm using JBoss ESB v4.2.1 in JBossAS v4.2.3.

       

      I'm trying to use org.jboss.soa.esb.actions.Aggregator but get IllegalArgumentException: value must be serializable.  Anyone know what I'm doing wrong?

       

      <?xml version="1.0"?>

      <jbossesb parameterReloadSecs="5"

      xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">

      <providers>

        <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">

         <jms-bus busid="JMSGatewayBus">

          <jms-message-filter dest-name="queue/queue_GW" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="ESBAwareBus">

          <jms-message-filter dest-name="queue/queue_notGW" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="OneBus">

          <jms-message-filter dest-name="queue/one_queue" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="TwoBus">

          <jms-message-filter dest-name="queue/two_queue" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="AggregationBus">

          <jms-message-filter dest-name="queue/aggregation_queue" dest-type="QUEUE"/>

         </jms-bus>

        </jms-provider>

      </providers>

      <services>

        <service category="MyService"

         description="Service for messages coming in." name="IncomingService">

         <listeners>

          <jms-listener busidref="JMSGatewayBus" is-gateway="true" name="JMSGatewayListener"/>

          <jms-listener busidref="ESBAwareBus" is-gateway="false" name="ESBAwareListener"/>

         </listeners>

         <actions mep="OneWay">

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action_1">

           <property name="message" value="Incoming: "/>

          </action>

          <action class="org.jboss.soa.esb.actions.StaticRouter" name="routeToProcesses">

           <property name="destinations">

            <route-to destination-name="one"

             service-category="MyService" service-name="OneService"/>

            <route-to destination-name="two"

             service-category="MyService" service-name="TwoService"/>

           </property>

          </action>

         </actions>

        </service>

        <service category="MyService"

         description="Service to execute process one." name="OneService">

         <listeners>

          <jms-listener busidref="OneBus" is-gateway="false" name="OneListener"/>

         </listeners>

         <actions mep="OneWay">

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action_1">

           <property name="message" value="One: "/>

          </action>

          <action class="org.jboss.soa.esb.actions.StaticRouter" name="routeToAggregation">

           <property name="destinations">

            <route-to destination-name="aggr"

             service-category="MyService" service-name="AggregationService"/>

           </property>

          </action>

         </actions>

        </service>

        <service category="MyService"

         description="Service to execute process two" name="TwoService">

         <listeners>

          <jms-listener busidref="TwoBus" is-gateway="false" name="TwoListener"/>

         </listeners>

         <actions mep="OneWay">

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action_1">

           <property name="message" value="Two: "/>

          </action>

          <action class="org.jboss.soa.esb.actions.StaticRouter" name="routeToAdjudication">

           <property name="destinations">

            <route-to destination-name="aggr"

             service-category="MyService" service-name="AggregationService"/>

           </property>

          </action>

         </actions>

        </service>

        <service category="MyService"

         description="Service to aggregate" name="AggregationService">

         <listeners>

          <jms-listener busidref="AggregationBus" is-gateway="false" name="AggregationListener"/>

         </listeners>

         <actions mep="OneWay">

          <action class="org.jboss.soa.esb.actions.Aggregator" name="Aggregator">

           <property name="timeoutInMillies" value="60000"/>

          </action>

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action_1">

           <property name="message" value="Aggregation: "/>

          </action>

         </actions>

        </service>

      </services>

      </jbossesb>

       

       

      I get the following output when run:

      14:04:29,362 INFO  [STDOUT] Incoming: :

      14:04:29,362 INFO  [STDOUT] [Test Message].

      14:04:29,410 INFO  [STDOUT] One: :

      14:04:29,411 INFO  [STDOUT] [Test Message].

      14:04:29,470 INFO  [STDOUT] Two: :

      14:04:29,470 INFO  [STDOUT] [Test Message].

      14:04:29,523 WARN  [ActionProcessingPipeline] Unexpected exception caught while

      processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Addr

      ess jms://localhost/queue/aggregation_queue/>, <wsa:ReferenceProperties jbossesb

      :destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-ver

      sion : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionF

      actory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceP

      roperties jbossesb:acknowledge-mode : 1/> > ] MessageID: ID:16-12684206694814 Re

      latesTo: jms:correlationID#ID:17-12684206693301 ]

      java.lang.IllegalArgumentException: value must be Serializable

              at org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl.addItem(

      AttachmentImpl.java:100)

              at org.jboss.soa.esb.actions.Aggregator.createAggregateMessage(Aggregato

      r.java:236)

              at org.jboss.soa.esb.actions.Aggregator.process(Aggregator.java:185)

              at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(

      ActionProcessingPipeline.java:316)

              at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(Messag

      eAwareListener.java:303)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec

      utor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:908)

              at java.lang.Thread.run(Thread.java:619)

      14:04:29,531 WARN  [ActionProcessingPipeline] Unexpected exception caught while

      processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Addr

      ess jms://localhost/queue/aggregation_queue/>, <wsa:ReferenceProperties jbossesb

      :destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-ver

      sion : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionF

      actory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceP

      roperties jbossesb:acknowledge-mode : 1/> > ] MessageID: ID:16-12684206695185 Re

      latesTo: jms:correlationID#ID:17-12684206693301 ]

      java.lang.IllegalArgumentException: value must be Serializable

              at org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl.addItem(

      AttachmentImpl.java:100)

              at org.jboss.soa.esb.actions.Aggregator.createAggregateMessage(Aggregato

      r.java:236)

              at org.jboss.soa.esb.actions.Aggregator.process(Aggregator.java:185)

              at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(

      ActionProcessingPipeline.java:316)

              at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(Messag

      eAwareListener.java:303)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec

      utor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:908)

              at java.lang.Thread.run(Thread.java:619)

       

      Thanks