2 Replies Latest reply on Nov 12, 2010 9:07 AM by garuda

    Problem with (S)FTP Listener in read only mode

    garuda

      Hello experts,


      I try to configure sftp in readonly mode inspired by the quickstart sample. But for any reason my configuration doesn't work properly.

       

      This is working:
      - FTP Listener fetches the test files from sftp server

       

      This is not working:
      - FTP Listener doesn't remember which test files were already caught and which were not


      Please see my ftp-provider and ftp-listener from my jbossesb.xml below:

       

      ...

      <ftp-provider hostname="xxx.xxx.xxx.xx:22" name="FtpGateway">
         <ftp-bus busid="FtpGatewayEdi">
          <ftp-message-filter
          username="monkeyman"
          password="monkeyman"
          read-only="true"
          passive="false"
          directory="/test"
          input-suffix=".txt"
          post-delete="false"
          post-suffix=".archived"
          error-delete="false"
          error-suffix=".has_error"
          protocol="sftp"   work-suffix=".work"/>
         </ftp-bus>
        </ftp-provider>

      ...

      <ftp-listener busidref="FtpGatewayEdi" is-gateway="true"

            maxThreads="1" name="FTP-GWListener" schedule-frequency="999999">
           <property name="remoteFileSystemStrategy-configFile" value="/config/ftpfile-cache-config.xml"/>

           <property name="remoteFileSystemStrategy-cacheListener" value="org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener"/>
      </ftp-listener>

       

      The remoteFileSystemStrategy is configured below ( I have choosen file chache loader only for testing purpose. I won't use it for production ;-))


       

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

       

          <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">

       

              <depends>jboss:service=Naming</depends>
               <depends>jboss:service=TransactionManager</depends>

       

              <!-- Configure the TransactionManager -->
               <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>

       

              <!-- Isolation level : SERIALIZABLE REPEATABLE_READ (default) READ_COMMITTED READ_UNCOMMITTED NONE -->
               <attribute name="IsolationLevel">REPEATABLE_READ</attribute>

       

              <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
               <attribute name="CacheMode">REPL_SYNC</attribute>

       

              <!-- Just used for async repl: use a replication queue -->
               <attribute name="UseReplQueue">false</attribute>

       

              <!-- Replication interval for replication queue (in ms) -->
               <attribute name="ReplQueueInterval">0</attribute>

       

              <!-- Max number of elements which trigger replication -->
               <attribute name="ReplQueueMaxElements">0</attribute>

       

              <!-- Name of cluster. Needs to be the same for all clusters, in order to find each other -->
               <attribute name="ClusterName">FtpFileCache-Cluster</attribute>

       

              <!--attribute name="ClusterConfig">
                   <config>
                       <UDP mcast_addr="228.1.2.3" mcast_port="48866"
                           bind_addr="localhost"
                           receive_on_all_interfaces="true"
                           send_on_all_interfaces="true"
                           ip_ttl="64" ip_mcast="true"
                           mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                           ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                           loopback="false"/>
                       <PING timeout="2000" num_initial_members="2" up_thread="false" down_thread="false"/>
                       <MERGE2 min_interval="10000" max_interval="20000"/>
                       <FD_SOCK/>
                       <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/>
                       <pbcast.NAKACK gc_lag="50"  retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192"  up_thread="false" down_thread="false"/>
                       <UNICAST timeout="600,1200,2400" down_thread="false"/>
                       <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/>
                       <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
                       <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/>
                       <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
                   </config>
               </attribute -->

       

              <!-- Whether or not to fetch state on joining a cluster -->
               <attribute name="FetchStateOnStartup">true</attribute>

       

              <!--
                   The max amount of time (in milliseconds) we wait until the
                   initial state (ie. the contents of the cache) are retrieved from
                   existing members in a clustered environment
               -->
               <attribute name="InitialStateRetrievalTimeout">10000</attribute>

       

              <!--
                   Number of milliseconds to wait until all responses for a
                   synchronous call have been received.
               -->
               <attribute name="SyncReplTimeout">10000</attribute>

       

              <!-- Max number of milliseconds to wait for a lock acquisition -->
               <attribute name="LockAcquisitionTimeout">15000</attribute>

       


               <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
               <attribute name="EvictionPolicyConfig">
                   <config>
                       <attribute name="wakeUpIntervalSeconds">60</attribute>
                       <!-- Cache wide default -->
                       <region name="/_default_">
                       <attribute name="maxNodes">5000</attribute>
                       <attribute name="timeToLiveSeconds">1000</attribute>
                       </region>
                       <region name="/ftp/cache">
                           <attribute name="maxNodes">5000</attribute>
                           <attribute name="timeToLiveSeconds">1000</attribute>
                           <attribute name="maxAgeSeconds">68400</attribute>
                     </region>
                  </config>
               </attribute>
              
               <attribute name="CacheLoaderConfiguration">
                   <config>
                       <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
                       <passivation>false</passivation>
                      
                       <!-- comma delimited FQNs to preload -->
                       <preload>/ftp/cache</preload>
                       <!-- are the cache loaders shared in a cluster? -->
                       <shared>false</shared>
                      
                     <cacheloader>
                           <class>org.jboss.cache.loader.FileCacheLoader</class>
                           <!-- same as the old CacheLoaderConfig attribute -->
                           <properties>
                               location=C:\\TEMP\\myFileStore
                           </properties>
                           <!-- whether the cache loader writes are asynchronous -->
                           <async>false</async>
                           <!-- only one cache loader in the chain may set
                       fetchPersistentState
                   to true.
                               An exception is thrown if more than one cache loader
                   sets this to
                   true. -->
                           <fetchPersistentState>true</fetchPersistentState>
                           <!-- determines whether this cache loader ignores writes -
                       defaults to
                   false. -->
                           <ignoreModifications>false</ignoreModifications>
                           <!-- if set to true, purges the contents of this cache loader
                         when the cache starts up. Defaults to false.  -->
                           <purgeOnStartup>false</purgeOnStartup>
                       </cacheloader>

       

                  </config>
               </attribute>
              
           </mbean>

       

      </server>

       

       

      Please have a look at the snipped server log:

       

      2010-11-10 13:28:05,999 TRACE [org.jboss.cache.TreeCache] Constructing
      2010-11-10 13:28:05,999 INFO  [org.jboss.cache.PropertyConfigurator] Found existing property editor for org.w3c.dom.Element: org.jboss.util.propertyeditor.ElementEditor@16ee755
      2010-11-10 13:28:05,999 INFO  [org.jboss.cache.PropertyConfigurator] configure(): attribute size: 20
      2010-11-10 13:28:05,999 INFO  [org.jboss.cache.TreeCache] setEvictionPolicyConfig(): [config: null]
      2010-11-10 13:28:05,999 INFO  [org.jboss.cache.TreeCache] interceptor chain is:
      class org.jboss.cache.interceptors.CallInterceptor
      class org.jboss.cache.interceptors.PessimisticLockInterceptor
      class org.jboss.cache.interceptors.UnlockInterceptor
      class org.jboss.cache.interceptors.ReplicationInterceptor
      2010-11-10 13:28:05,999 INFO  [org.jboss.cache.TreeCache] cache mode is REPL_SYNC
      2010-11-10 13:28:05,999 DEBUG [org.jboss.cache.TreeCache] setting cluster properties to default value
      2010-11-10 13:28:06,015 TRACE [org.jboss.cache.TreeCache] cache properties: UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;mcast_send_buf_size=150000;mcast_recv_buf_size=80000):PING(timeout=1000;num_initial_members=2):MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800):UNICAST(timeout=600,1200,2400,4800):pbcast.STABLE(desired_avg_gossip=20000):FRAG(frag_size=8192;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):pbcast.STATE_TRANSFER
      2010-11-10 13:28:06,015 WARN  [org.jgroups.JChannel] option GET_STATE_EVENTS has been deprecated (it is always true now); this option is ignored
      2010-11-10 13:28:06,030 WARN  [org.jgroups.protocols.UDP] failed to join /224.0.0.75:7500 on net4: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
      2010-11-10 13:28:06,030 WARN  [org.jgroups.protocols.UDP] failed to join /224.0.0.75:7500 on net5: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
      2010-11-10 13:28:06,046 INFO  [STDOUT]
      -------------------------------------------------------
      GMS: address is 10.11.17.142:57257
      -------------------------------------------------------
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.TreeCache] viewAccepted(): [10.11.17.142:57257|0] [10.11.17.142:57257]
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.TreeCache] my local address is 10.11.17.142:57257
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.TreeCache] state could not be retrieved (must be first member in group)
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.eviction.LRUPolicy] Starting eviction policy using the provider: org.jboss.cache.eviction.LRUPolicy
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.eviction.LRUPolicy] Starting a eviction timer with wake up interval of (secs) 60
      2010-11-10 13:28:07,046 INFO  [org.jboss.cache.TreeCache] Cache is started!!
      2010-11-10 13:28:07,070 INFO  [org.apache.juddi.datastore.jdbc.JDBCDataStore] Generated token 'authToken:5A87EDC0-ECCE-11DF-B40E-D4AAE31AC233' for user: 'jbossesb/JBoss ESB User'
      2010-11-10 13:28:07,133 INFO  [org.quartz.core.QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
      2010-11-10 13:28:07,133 TRACE [com.airpas.esbconfig.session.Service] EDI_FTP_Service.esb's new state: 3
      2010-11-10 13:28:07,491 TRACE [org.jboss.cache.TreeCache] _put(null, "/ftp/cache", test.txt, test.txt)
      2010-11-10 13:28:07,491 TRACE [org.jboss.cache.TreeCache] destination list is empty, discarding call

      Can you please give me advise what I am doing wrong ?


       

      Br,

       

      Dennis

        • 1. Re: Problem with (S)FTP Listener in read only mode
          garuda

          Hi experts,

           

          are there any news to this issue ? Sorry for pushing on this, but it is urgent for me.

           

          Br,

           

          Dennis

          • 2. Re: Problem with (S)FTP Listener in read only mode
            garuda

            Hi experts,

             

            I found the solution on my own now.

             

            The quickstart sample seems to be wrong.

             

            In JBOSS ESB 4.4 jboss-cache 1.2.4 SPA1 is used. Unfortunately the configuration chache config xml file is wrong and in quickstart sample it only works with jboss-cache =>1.3.

             

            I changed the config. to:

             

            <attribute name="CacheLoaderClass">org.jboss.cache.loader.FileCacheLoader </attribute>
                     <attribute name="CacheLoaderShared">false</attribute>
                     <attribute name="CacheLoaderConfig">location=/home/jbossesb/temp</attribute>
                     <attribute name="CacheLoaderPreload">/ftp/cache</attribute>


            now.

             

            And it works fine now for me.

             

            Br,

            Dennis