1 Reply Latest reply on May 22, 2008 3:23 AM by Janne Mattila

    ClassCastException from NotifyFTP

    Janne Mattila Newbie

      I want to end my pipeline by sending the processed message to FTP server.

      I am trying this by modifying quickstart example webservice_producer. I have simply added a Notifier action after the call to the webservice. I was thinking this would send the webservice response to FTP, but it seems not to be working.

      The NotifyConsole notifier seems to work ok, but NotifyFTP gives ClassCastException.

      actions from jboss-esb.xml:

      <actions>
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
       </action>
      
       <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
       <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
       </action>
      
       <!-- configure a notifier action which stores the message in FTP server -->
       <action name="notificationAction"
       class="org.jboss.soa.esb.actions.Notifier">
       <property name="okMethod" value="notifyOK" />
       <property name="notification-details">
       <NotificationList type="ok">
       <target class="NotifyConsole" />
       <target class="NotifyFTP">
       <ftp URL="ftp://janne:janne@localhost"
       filename="someFile.txt" />
       </target>
       </NotificationList>
       <NotificationList type="err">
       <target class="NotifyConsole" />
       </NotificationList>
       </property>
       </action>
      
       <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint"/>
       </action>
       </actions>


      Server log:

      10:12:01,093 INFO [STDOUT] [Quickstart_webservice_producer] AFTER invoking jbossws endpoint:
      10:12:01,093 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayGoodbyeResponse
       xmlns:ns2="http://webservice_producer/goodbyeworld"><return>... Ah Goodbye then!!!! - Goodbye!!</return></ns2:sayGoodbyeResponse></env:Body></env:Envelope
      >].
      10:12:01,125 INFO [STDOUT] ConsoleNotifier 2008/05/22 10:12:01.125<<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:H
      eader><env:Body><ns2:sayGoodbyeResponse xmlns:ns2="http://webservice_producer/goodbyeworld"><return>... Ah Goodbye then!!!! - Goodbye!!</return></ns2:sayGo
      odbyeResponse></env:Body></env:Envelope>>
      10:12:01,140 ERROR [NotificationList] Can't instantiate target <target class="NotifyFTP">
       <ftp URL="ftp://janne:janne@localhost" filename="someFile.txt"/>
       </target>
      java.lang.ClassCastException: java.lang.String
       at org.jboss.soa.esb.notification.NotifyFTP.sendNotification(NotifyFTP.java:193)
       at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:164)
       at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)
       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.processSuccess(ActionProcessorMethodInfo.java:154)
       at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(OverriddenActionLifecycleProcessor.java:108)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessingPipeline.java:610)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:384)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
       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)