3 Replies Latest reply on Aug 1, 2008 7:46 AM by neha2911

    Problem in Using Notifiers

      Hi,
      Im using jboss-soa-p.4.2.0.I need to notify the failure and success of my processing in JBoss ESb.Hence i used org.jboss.soa.esb.actions.Notifier class.
      When there is success the notifier works but it does not work in case of exception is thrown by my custom action class.
      My Jboss-esb.xml is :

      <?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.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
       <providers>
       <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
       <jms-bus busid="quickstartCalGwChannel">
       <jms-message-filter
       dest-name="queue/quickstart_calculator_Request_gw" dest-type="QUEUE"/>
       </jms-bus>
       <jms-bus busid="quickstartCalEsbChannel">
       <jms-message-filter
       dest-name="queue/quickstart_calculator_Request_esb" dest-type="QUEUE"/>
       </jms-bus>
       <jms-bus busid="quickstartHelloReq">
       <jms-message-filter dest-name="queue/quickstart_hello_Request" dest-type="QUEUE"/>
       </jms-bus>
       <jms-bus busid="quickstartHelloESB">
       <jms-message-filter dest-name="queue/quickstart_hello_Request_esb" dest-type="QUEUE"/>
       </jms-bus>
       </jms-provider>
       </providers>
       <services>
       <service category="CalculatorServiceESB" description="Calculator" name="CalculatorService">
       <listeners>
       <jms-listener busidref="quickstartCalGwChannel" is-gateway="true"
       maxThreads="1" name="JMS-Gateway"/>
       <jms-listener busidref="quickstartCalEsbChannel" maxThreads="1" name="Calculator"/>
       </listeners>
       <actions mep="OneWay">
       <action
       class="org.jboss.soa.esb.samples.quickstart.calculator.MyCalculatorService"
       name="action1" process="displayMessage"/>
       <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action2">
       <property name="printfull" value="true"/>
       </action>
       <!-- The next action is for Continuous Integration testing -->
       <action class="org.jboss.soa.esb.actions.TestMessageStore" name="testStore"/>
       <action class="org.jboss.soa.esb.actions.SystemPrintln" name="action3">
       <property name="printfull" value="true"/>
       </action>
       <action class="org.jboss.soa.esb.actions.Notifier" name="notificationAction">
       <property name="okMethod" value="notifyOK"/>
       <property name="exceptionMethod" value="notifyError"/>
       <property name="notification-details">
       <NotificationList type="OK">
       <target class="NotifyConsole"/>
       <target class="NotifyQueues">
       <messageProp name="quickstart" value="Calculator_Response"/>
       <queue jndiName="queue/quickstart_calculator_Response_esb_Alert"/>
       </target>
       </NotificationList>
       <NotificationList type="err">
       <target class="NotifyConsole"/>
       <target class="NotifyQueues">
       <messageProp name="quickstart" value="Calculator_Response"/>
       <queue jndiName="queue/quickstart_calculator_Response_esb_Alert"/>
       </target>
       <target class="NotifyFiles" >
       <file name="@results.dir@/badresult.log" />
       </target>
       </NotificationList>
       </property>
      
       </action> </actions>
       </service>
       </services>
      </jbossesb>
      

      org.jboss.soa.esb.samples.quickstart.calculator.MyCalculatorService is my custom action class which performs some processing.

      I want to notify the exception that is outcome of some unusual processing done in this class.

      What should i do?

        • 1. Re: Problem in Using Notifiers

          In server log i get following exception but this is not notified in my queue or in my file.


          2008-08-01 09:40:54,018 INFO [org.quartz.core.QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
          2008-08-01 09:41:23,175 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
          2008-08-01 09:41:23,175 INFO [STDOUT] Body: Add:100;55
          2008-08-01 09:41:23,175 INFO [STDOUT] ********************************Length is 10
          2008-08-01 09:41:23,175 INFO [STDOUT] Operation Add
          2008-08-01 09:41:23,175 INFO [STDOUT] ********************************num11is 100
          2008-08-01 09:41:23,175 WARN [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://0.0.0.0:1099/queue/quickstart_calculator_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 0.0.0.0:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: ID:JBM-176640 RelatesTo: jms:correlationID#ID:JBM-176128 ]
          java.lang.NumberFormatException: For input string: ":100"
           at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
           at java.lang.Integer.parseInt(Integer.java:447)
           at java.lang.Integer.parseInt(Integer.java:497)
           at org.jboss.soa.esb.samples.quickstart.calculator.MyCalculatorService.displayMessage(MyCalculatorService.java:45)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
           at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
           at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
           at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
           at java.lang.Thread.run(Thread.java:595)
          2008-08-01 09:41:23,191 WARN [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://0.0.0.0:1099/queue/quickstart_calculator_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 0.0.0.0:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: ID:JBM-176640 RelatesTo: jms:correlationID#ID:JBM-176128
          


          • 2. Re: Problem in Using Notifiers
            kconner

            Put your notifier action first and it will work.

            Your error happens prior to that action so it has no visibility of it.

            • 3. Re: Problem in Using Notifiers

              Thank you....It worked..