7 Replies Latest reply on Dec 13, 2009 7:38 PM by suresh pamujula

    Error in ContentBasedRouting

    suresh pamujula Newbie

      Im getting a following exception when Im using ContentBasedRouter. Attached are the .drl and .esb files for your reference.

      Also below is the message body if it would help.

      Any help would be appreciated.


      2009-12-08 15:41:48,125 DEBUG [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: InVMEpr [ PortReference < <wsa:Address invm://4f7261636c6541515f45534224242424242424242424242453696d706c654c697374656e6572/false?false#10000/>, <wsa:ReferenceProperties jbossesb:passByValue : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/invm/> > ] MessageID: 2d950609-53f2-4d4d-ae08-37d26b76c849 ]
      org.jboss.soa.esb.actions.ActionProcessingException: org.jboss.soa.esb.services.routing.MessageRouterException
      at org.jboss.soa.esb.actions.ContentBasedWiretap.process(ContentBasedWiretap.java:159)
      at org.jboss.soa.esb.actions.ContentBasedRouter.process(ContentBasedRouter.java:58)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:634)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:586)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:420)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:545)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.soa.esb.services.routing.MessageRouterException
      at org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter.route(JBossRulesRouter.java:128)
      at org.jboss.soa.esb.actions.ContentBasedWiretap.executeRules(ContentBasedWiretap.java:171)
      at org.jboss.soa.esb.actions.ContentBasedWiretap.process(ContentBasedWiretap.java:143)
      ... 8 more
      Caused by: org.jboss.internal.soa.esb.services.rules.RuleServiceException
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.getNewRuleBaseWithPackage(DroolsRuleBaseHelper.java:272)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleBaseFromRuleFiles(DroolsRuleBaseHelper.java:134)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseForFileBasedRules(DroolsRuleService.java:546)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRules(DroolsRuleService.java:133)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:150)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:65)
      at org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter.route(JBossRulesRouter.java:123)
      ... 10 more
      Caused by: java.lang.NullPointerException
      at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:434)
      at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.getNewRuleBaseWithPackage(DroolsRuleBaseHelper.java:267)
      ... 16 mor

        • 1. Re: Error in ContentBasedRouting
          suresh pamujula Newbie

          Following is the .drl file

          #created on: Dec 8, 2009
          package com.jboss.soa.esb.routing.cbr

          #list any import classes here.
          import org.jboss.soa.esb.message.Message;
          import org.jboss.soa.esb.message.format.MessageType;

          expander XPathLanguage.dsl

          #declare any global variables here
          global java.util.List destinations;

          rule "Routing Rule using XPATH"

          when
          xpathEquals "command_type", "INSERT"
          then
          System.out.println("Filtered INSERT Message");
          Destination : "pocInsert";

          end

          rule "Routing Rule using XPATH"
          when
          xpathEquals "command_type", "UPDATE"
          then
          System.out.println("Filtered UPDATE Message");
          Destination : "pocUpdate";
          end


          Following is the .esb file

          <?xml version = "1.0" encoding = "UTF-8"?>



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








          <jms-bus busid="AQGwChannel">
          <jms-message-filter dest-type="QUEUE" dest-name="MY_JQUEUE" />
          </jms-bus>
          </jms-provider>
          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
          <jms-bus busid="AQEsbChannel">
          <jms-message-filter dest-type="QUEUE" dest-name="queue/EventQueue" />
          </jms-bus>
          </jms-provider>





          <jms-listener name="JMS-Gateway" busidref="AQGwChannel"
          is-gateway="true" />
          <jms-listener name="JMS-ESBListener" busidref="AQEsbChannel" />


          <!-- Display the RAW message from AQ -->



          <!-- Publish the message from AQ on pocTopic -->










          <!-- Transform the RAW message from AQ into BusinessEvent -->








          <!-- Perform Content based routing -->





          <!-- If the message is for INSERTs publish on pocInsert Topic -->
          <route-to destination-name="pocInsert" service-category="InsertMessage" service-name="pocInsertService"/>
          <!-- If the message is for UPDATEs publish on pocUpdate Topic -->
          <route-to destination-name="pocUpdate" service-category="UpdateMessage" service-name="pocUpdateService"/>




          <!-- Insert Messages -->














          <!-- Update Messages -->

















          • 2. Re: Error in ContentBasedRouting
            suresh pamujula Newbie

            <?xml version = "1.0" encoding = "UTF-8"?>



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








            <jms-bus busid="AQGwChannel">
            <jms-message-filter dest-type="QUEUE" dest-name="MY_JQUEUE" />
            </jms-bus>
            </jms-provider>
            <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
            <jms-bus busid="AQEsbChannel">
            <jms-message-filter dest-type="QUEUE" dest-name="queue/EventQueue" />
            </jms-bus>
            </jms-provider>





            <jms-listener name="JMS-Gateway" busidref="AQGwChannel"
            is-gateway="true" />
            <jms-listener name="JMS-ESBListener" busidref="AQEsbChannel" />


            <!-- Display the RAW message from AQ -->



            <!-- Publish the message from AQ on pocTopic -->










            <!-- Transform the RAW message from AQ into BusinessEvent -->








            <!-- Perform Content based routing -->





            <!-- If the message is for INSERTs publish on pocInsert Topic -->
            <route-to destination-name="pocInsert" service-category="InsertMessage" service-name="pocInsertService"/>
            <!-- If the message is for UPDATEs publish on pocUpdate Topic -->
            <route-to destination-name="pocUpdate" service-category="UpdateMessage" service-name="pocUpdateService"/>




            <!-- Insert Messages -->














            <!-- Update Messages -->
















            • 3. Re: Error in ContentBasedRouting
              Martin Vecera Novice

              Hello,
              could you please provide more details, like ESB version, and a working example - you commented out too much information (e.g. CBR router definition)...

              • 4. Re: Error in ContentBasedRouting
                suresh pamujula Newbie

                Martin - I sent you an email on the info you requested. Somehow I can't attach files to the ticket.

                • 5. Re: Error in ContentBasedRouting
                  Martin Vecera Novice

                  Try omitting the DSL reference from the DRL file.

                  The exception is about the package. Try removing the package definition or using a different package.

                  Please note that those are just blind shots...

                  • 6. Re: Error in ContentBasedRouting
                    suresh pamujula Newbie

                    martin -
                    I removed the package definition in the .drl file, but I still get the same error.

                    • 7. Re: Error in ContentBasedRouting
                      suresh pamujula Newbie

                      I got it working. The prefix for the namespace was missing. This caused drools rules to fail.