Hi Alex, and everybody.

I get the same error, but it has the more exactly cause above:
"Caused by: jcifs.smb.SmbException: Failed to connect: 0.0.0.0<00>/192.168.28.4"

It isn't to found the samba server. But it exist, I can connect by nautilus.

Here my complete thread:

org.apache.commons.vfs.FileSystemException: Could not determine the type of file "smb://192.168.28.4/ernesto-home/Documentos". at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:931) at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractFileObject.java:468) at com.kneobase.driver.commons.vfs.samba.SambaTest.testBasic(SambaTest.java:24)
        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:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: jcifs.smb.SmbException: Failed to connect: 0.0.0.0<00>/192.168.28.4
jcifs.util.transport.TransportException
java.net.NoRouteToHostException: No existe ninguna ruta hasta el `host'
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at java.net.Socket.<init>(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:189)
        at jcifs.smb.SmbTransport.ssn139(SmbTransport.java:185)
        at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:240)
        at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:308)
        at jcifs.util.transport.Transport.run(Transport.java:232)
        at java.lang.Thread.run(Thread.java:662)

        at jcifs.util.transport.Transport.run(Transport.java:249)
        at java.lang.Thread.run(Thread.java:662)

        at jcifs.smb.SmbTransport.connect(SmbTransport.java:292)
        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:156)
        at jcifs.smb.SmbFile.doConnect(SmbFile.java:906)
        at jcifs.smb.SmbFile.connect(SmbFile.java:949)
        at jcifs.smb.SmbFile.connect0(SmbFile.java:875)
        at jcifs.smb.SmbFile.queryPath(SmbFile.java:1328)
        at jcifs.smb.SmbFile.exists(SmbFile.java:1410)
at org.apache.commons.vfs.provider.smb.SmbFileObject.doGetType(SmbFileObject.java:107) at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:919)
        ... 21 more



Thanks,
Ernesto.


El 31/05/11 04:03, Alex Xin escribió:
Hi, All

I'm new to VFS, and I'm trying to use VFS and SMB file provider to access
Windows smb shares. I can use JCIFS to access my shares directly, but when I
was working with VFS, I always got an error message like
"*org.apache.commons.vfs2.FileSystemException:
Could not determine the type of file "smb://192.168.0.104/Work/"*"

Here's the code that I used to access shares.

                         fsm = VFS.getManager();
FileObject smbFile = fsm.resolveFile( "smb://192.168.0.104/Work" );
FileObject files[] = smbFile.getChildren();

I can successfully access the local file system without problems.

Thanks,

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to