Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.3.0
    • Component/s: Bundles
    • Labels:
      None
    • Environment:

      Description

      When defining and running a vsf:poller using an sftp URL the following exception is thrown:

      java.io.IOException: Failed to initialize file system manager: org.apache.commons.vfs.FileSystemException: Badly formed URI "sftp://user:somepw@111.111.111.111/HOME/OUT/".
      at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(FileObjectResolver.java:66)
      at org.apache.servicemix.vfs.VFSPollingEndpoint.poll(VFSPollingEndpoint.java:229)
      at org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedulerTask$1.run(PollingEndpoint.java:202)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

      configuration used:

      <?xml version="1.0"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:proj="http://servicemix.org/demo/"
      xmlns:file="http://servicemix.apache.org/file/1.0"
      xmlns:vfs="http://servicemix.apache.org/vfs/1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://servicemix.apache.org/file/1.0 http://servicemix.apache.org/schema/servicemix-file-3.1.2.xsd
      http://servicemix.apache.org/vfs/1.0 http://servicemix.apache.org/schema/servicemix-vfs-2009.01.xsd">

      <file:sender service="proj:fileSender" endpoint="endpoint"
      directory="file:///C:/Temp/outbox" autoCreateDirectory="true">
      <property name="marshaler">
      <bean class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
      </property>
      </file:sender>

      <vfs:poller service="proj:filePoller" endpoint="poller"
      path="sftp://user:somepw@111.111.111.111/HOME/OUT" targetService="proj:fileSender" period="10000"
      deleteFile="true" recursive="false">

      <property name="marshaler">
      <bean class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
      </property>

      </vfs:poller>

      <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

      </beans>

      After discussing this in the forum it seems that the sftp protocol handler for vfs is not registered. See http://old.nabble.com/Exception-when-using-vsf%3Apoller-with-sftp-%28ServiceMix-4.2%29-tp28700187p28706201.html

        Activity

        Hide
        Martin Schäfer added a comment - - edited

        I did some further investigation. I enabled the debug log for the class org.apache.commons.vfs.impl.StandardFileSystemManager I can see this entry:

        Skipping provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider" because required class "javax.crypto.Cipher" is not available.

        This seems strange because I can see the package javax.crypto being imported for Java 1.6 in etc/config.properties:

        jre-1.6=, \
        com.sun.org.apache.xalan.internal.xsltc.trax, \
        com.sun.org.apache.xerces.internal.dom, \
        com.sun.org.apache.xerces.internal.jaxp, \
        com.sun.org.apache.xerces.internal.xni, \
        com.sun.jndi.ldap, \
        javax.accessibility, \
        # javax.activation, \
        javax.activity, \
        # javax.annotation, \
        # javax.annotation.processing, \
        javax.crypto, \
        javax.crypto.interfaces, \
        javax.crypto.spec, \
        javax.imageio, \
        ...

        what's up here?

        Show
        Martin Schäfer added a comment - - edited I did some further investigation. I enabled the debug log for the class org.apache.commons.vfs.impl.StandardFileSystemManager I can see this entry: Skipping provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider" because required class "javax.crypto.Cipher" is not available. This seems strange because I can see the package javax.crypto being imported for Java 1.6 in etc/config.properties: jre-1.6=, \ com.sun.org.apache.xalan.internal.xsltc.trax, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.jaxp, \ com.sun.org.apache.xerces.internal.xni, \ com.sun.jndi.ldap, \ javax.accessibility, \ # javax.activation, \ javax.activity, \ # javax.annotation, \ # javax.annotation.processing, \ javax.crypto, \ javax.crypto.interfaces, \ javax.crypto.spec, \ javax.imageio, \ ... what's up here?
        Hide
        Martin Schäfer added a comment -

        The solution is to add javax.crypto as an Import-Package in META-INF/MANIFEST.MF

        Show
        Martin Schäfer added a comment - The solution is to add javax.crypto as an Import-Package in META-INF/MANIFEST.MF
        Show
        Freeman Fang added a comment - commit fix http://svn.apache.org/viewvc?rev=950325&view=rev

          People

          • Assignee:
            Freeman Fang
            Reporter:
            Martin Schäfer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development