7 Replies Latest reply on May 21, 2008 6:20 AM by Patrick Pussar

    FS-listener IOException

    Patrick Pussar Newbie

      Hi,
      I have a problem with the FS-Listener, I plan to read a xml-file and want to output the content on the command line.
      Here is my jboss-esb.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
       parameterReloadSecs="5"
       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
      
      D:\Tools\jbossesb-server-4.3.CR1\docs\schema\jbossesb-1.0.1.xsd">
       <providers>
       <fs-provider name="file_inbound">
       <fs-bus busid="inbound_channel">
       <fs-message-filter directory="d:/temp/inbound"
       input-suffix=".xml"
       work-suffix=".esbInProcess"
       post-delete="false"
       post-directory="d:/temp/inbound"
       post-suffix=".sentToEsb"
       error-delete="false"
       error-directory="d:/temp/inbound"
       error-suffix=".IN_ERROR"/>
       </fs-bus>
       </fs-provider>
      
       </providers>
       <services>
       <service category="myCategory" name="HOH" description="Hand-Off-Handler">
       <listeners>
       <fs-listener name="File-Gateway"
       busidref="inbound_channel"
       maxThreads="1"
       is-gateway="false"
       poll-frequency-seconds="5"/>
       </listeners>
      
       <actions>
       <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="printfull" value="true"/>
       </action>
       </actions>
       </service>
       </services>
      </jbossesb>
      


      But I getting this error in the server log:
      2008-05-21 11:13:38,128 DEBUG [org.jboss.internal.soa.esb.couriers.FileCourier] No valid work suffix found in EPR - using default of .esbInProcess
      2008-05-21 11:13:48,128 DEBUG [org.jboss.internal.soa.esb.couriers.FileCourier] FileCourier.pickup caught exception during readOneMessage: org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException: java.io.IOException
      


      What is wrong???
      Unfortunaly the log messages are not very verbose.

      Thanks for any help!

        • 1. Re: FS-listener IOException
          Daniel Bevenius Master

          Hi ama1,

          try setting the 'is-gateway' to 'true'.

          Regards,

          Daniel

          • 2. Re: FS-listener IOException
            Patrick Pussar Newbie

            Hi Daniel,
            if I set gateway to true I get this deployment error:

            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
            ObjectName: jboss.esb:deployment=jboss-esb.xml
             State: FAILED
             Reason: java.lang.RuntimeException: org.jboss.soa.esb.ConfigurationException: Service configuration for Service 'myCategory:HOH' doesn't define a Message-Aware Listener (i.e. is-gateway='false').
             I Depend On:
             jboss.esb:deployment=jbossesb.esb
            


            • 3. Re: FS-listener IOException
              Daniel Bevenius Master

              If you take a look at the helloworld_file_action quickstart you can see an example of this. You should be able to modify it to suite your needs.

              Let me know if you have any problems.

              Regards,

              Daniel

              • 4. Re: FS-listener IOException
                Patrick Pussar Newbie

                Hi Daniel,
                yes I had a look into that example. But the only think which looks different is the JMS-Listener. But it looked for me that this listener is just an alternative input channel for the actions?
                Or is it mandatory? And if yes what exactly does the JMS do in this example?

                • 5. Re: FS-listener IOException
                  Tom Fennelly Master

                   

                  "ama1" wrote:
                  Hi Daniel,
                  yes I had a look into that example. But the only think which looks different is the JMS-Listener. But it looked for me that this listener is just an alternative input channel for the actions?
                  Or is it mandatory? And if yes what exactly does the JMS do in this example?


                  You're right... this is one of the more confusing parts of the ESB configuration. Pre 4.3.GA (just about to be released - available from SVN), every service needed to have at least 1 "message aware listener" configured. Gateways are there to get message payloads onto the bus, but most of them do it via a message aware listener. If you think this is confusing, don't worry... you're not the only one :-)

                  So it works something like this:
                  message --> [gateways-listener] --> [message-aware-listener] --> [action-pipeline]
                  


                  So you need the message aware listener to get the message payload from the gateway to the action processing pipeline.

                  The good news is that v4.3 will make this a lot easier (and more performant) because it adds support for an InVM transport, which means that by default, every service will have an InVM message aware listener. For the user, this means they just need to configure the gateway and it will work - no need to configure the extra JMS message aware listener.

                  So you need to configure that JMS message aware listener for now, but you can remove it when you move to 4.3.

                  • 6. Re: FS-listener IOException
                    Daniel Bevenius Master

                     

                    But it looked for me that this listener is just an alternative input channel for the actions?

                    The JMS listener is a ESB-aware listener and not a gateway. The file listener in that example is a gateway and used to get messages into an ESB bus. This gateway takes the content in the file and packages it in an ESB Message object. It then passes the Message object to the JMS listener, which a ESB-aware listener.

                    Or is it mandatory?

                    Well it has been, but there is a new feature in the main trunk for a in-vm transport where you don't need to configure the extra listener. Take a look at invm_transport1 for more details about this.

                    Regards,

                    Daniel

                    • 7. Re: FS-listener IOException
                      Patrick Pussar Newbie

                      Okay I understand the concept. I added a jms aware listener and my project works now :-)

                      Thanks to both of you!