2 Replies Latest reply on Jan 5, 2011 5:44 AM by seb.wytt

    [resolved] NotifySQLTable notifier issue

    seb.wytt

      Hi,

       

      I'm currently doing a proof of concept (JBoss ESB vs Mule) using SOA platform 5.0 + IDE.

      My scenario consist of a "one-way" flow as follow:

      - 1 service retrieve message from fflat files in a directory and tranform then to the "common format"

      - then another service process messages coming from the the previous service to insert them into a database.

       

      By reading the documentation I found that the only out-of-the-box action to do that was the SQL notifier. However I didn't managed to have it work correctly. I surrounded this notifier by 2 "println" actions. I see the 2 println actions being executed but an error happens for the SQL Notifier. I'm using a custom java class to create a DOMDocument from the content of my flat file and then I put this DOMDocument in the message: maybe here is part of the issue? I should only consider String values?

       

      Here is the code of my Service:

       

      <service category="poc-scenario-2-eai" description="Output message payload" invmScope="GLOBAL" name="HandleMessageTreatment">

       

                  <listeners>
                      <fs-listener busidref="fs.xml.in.GwChannel" is-gateway="true" name="fs.xml.in.GwList" />
                      <fs-listener busidref="fs.flat.in.GwChannel" is-gateway="true" name="fs.flat.in.GwList" />
                  </listeners>

       

                  <actions mep="OneWay">

       

                      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="HandleMessageTreatment-trace1.println-action">
                          <property name="message" value="HandleMessageTreatment-trace1.println-action ==> Message in the ESB:" />
                      </action>

       

                      <action class="org.jboss.soa.esb.actions.Notifier" name="HandleMessageTreatment-sqlNotifier.action">
                          <property name="okMethod" value="notifyOK" />
                          <property name="exceptionMethod" value="notifyError" />

       

                          <property name="destinations">
                              <NotificationList type="OK">
                                  <target class="NotifySQLTable" connection-url="jdbc:oracle:thin:@localhost:1521:xe" dataColumn="PAYLOAD"
                                      driver-class="oracle.jdbc.driver.OracleDriver" password="poc-esb" table="MESSAGES" user-name="poc-esb" />
                              </NotificationList>
                          </property>
                      </action>

       

                      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="HandleMessageTreatment-trace2.println-action">
                          <property name="message" value="HandleMessageTreatment-trace2.println-action ==> Message in the ESB:" />
                      </action>

       

                  </actions>

       

              </service>

       

      Here is the ouput on the console:

       

      20:17:26,489 INFO  [STDOUT] HandleMessageTreatment-trace1.println-action ==> Message in the ESB::
      20:17:26,489 INFO  [STDOUT] [org.dom4j.dom.DOMDocument@e5f028 [Document: name pivotEmployee]].
      20:17:26,489 INFO  [STDOUT] HandleMessageTreatment-trace2.println-action ==> Message in the ESB::
      20:17:26,489 INFO  [STDOUT] [org.dom4j.dom.DOMDocument@e5f028 [Document: name pivotEmployee]].
      20:17:26,619 ERROR [NotificationList] Can't instantiate target <target class="NotifySQLTable" connection-url="jdbc:oracle:thin:@localhost:1521:xe" dataColumn="PAYLOAD" driver-class="oracle.jdbc.driver.OracleDriver" password="poc-esb" table="MESSAGES" user-name="poc-esb"/>
      org.jboss.soa.esb.ConfigurationException: Invalid class <NotifySQLTable>, or missing library
          at org.jboss.soa.esb.notification.NotificationTarget.fromParams(NotificationTarget.java:127)
          at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:162)
          at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processSuccess(ActionProcessorMethodInfo.java:165)
          at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(OverriddenActionLifecycleProcessor.java:108)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessingPipeline.java:951)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:725)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:589)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:419)
          at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)

       

      Can you please tell me if I forgot something?

       

      Thank you very much,

      Seb!