Hi Martin,
Thanks for the feedback, I will commit fix for commons-vfs bundle very
soon.
Freeman
On 2010-6-2, at 上午4:10, Martin S. wrote:
Freeman, Lars
Adding the javax.crypto to Import-Package in META-INF/MANIFEST.MF
did the
trick! I tested it sucessfully. However manipulating the MANIFEST.MF
with an
editor and then repackage it did not work first. The MANIFEST.MF was
always
invalid after this. So I checked out
http://svn.apache.org/repos/asf/servicemix/smx4/bundles/trunk/commons-vfs-1.0
,
changed pom.xml and then build it. I added the javax.crypto package
insinde
the <servicemix.osgi.import.pkg> element. Then bundle was okay and it
worked!
During the process of finding this bug two issues gave me a headache
and I
have two proposals for enhancements:
1) The class StandardFileSystemManager which configures the different
FileProviders for webdav, SFTP, etc. is only create once after
startup of
servicemix. This this is the case because the instance is retrieved
from a
static singelton. See FileObjectResolver.java:46
if (manager == null) {
manager = VFS.getManager().;
}
This is bad because StandardFileSystemManager will never reconfigure
itself
and be able to detect necessary support classes which have probaly
added
later with new bundles.
I think FileObjectResolver should better create its own instance of
StandardFileSystemManager instead of getting the static one.
Otherwise one
would have to restart servicemix completely to add new FileProviders.
2) It was very hard to track connection problems because
resolveToFileObject() throws only IOExceptions without the root
Exception.
All details about a problem (wrong credentials, unknown host for SFTP
connections, etc.) are not available for logging and tracking.
I had to run a dedicated test with the jsch Library to find out that a
connection failed because of a missing entry in .ssh/known_hosts.
There was
no chance to make this visible in the servicemix log.
I think resolveToFileObject() should log those root exceptions or
pass them
along with the IOException.
But most important I would like to thank both of you for your
support. Now
my proof-of-concept works and chances are high that I will use
servicemix in
our next customer project.
Martin
--
View this message in context:
http://old.nabble.com/Exception-when-using-vsf%3Apoller-with-sftp-%28ServiceMix-4.2%29-tp28700187p28746884.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com