[jcifs] newbie problems

Michael B Allen mba2000 at ioplex.com
Fri Jul 15 17:06:34 GMT 2005


On Fri, 15 Jul 2005 10:24:05 -0400
Mark Shifman <mark.shifman at yale.edu> wrote:

> Hi:
> I tried what you said but I get the same error.

There's something more fundamentally wrong. This bascially shows that you can't even create a socket. Can you do $ telnet server 139? Are you running in within a VM or have a firewall? Try a very simple program that just does:

  Socket sock = new Socket( serverip, 139 );

Otherwise, I'm stumped. There's definately something odd about your environment because jcifs isn't even creating a socket to the remote host.

Mike

> doFindFirstNext: \
> Exception in thread "main" jcifs.smb.SmbException:
> jcifs.util.transport.TransportException
> java.net.SocketException: Invalid argument or cannot assign requested 
> address
>     at java.net.PlainSocketImpl.socketConnect(Native Method)
>     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>     at java.net.Socket.connect(Socket.java:452)
>     at java.net.Socket.connect(Socket.java:402)
>     at java.net.Socket.<init>(Socket.java:309)
>     at java.net.Socket.<init>(Socket.java:184)
>     at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:228)
>     at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:266)
>     at jcifs.util.transport.Transport.run(Transport.java:204)
>     at java.lang.Thread.run(Thread.java:534)
> 
>     at jcifs.util.transport.Transport.run(Transport.java:220)
>     at java.lang.Thread.run(Thread.java:534)
> 
>     at jcifs.smb.SmbTransport.connect(SmbTransport.java:256)
>     at jcifs.smb.SmbTree.treeConnect(SmbTree.java:122)
>     at jcifs.smb.SmbFile.connect(SmbFile.java:791)
>     at jcifs.smb.SmbFile.connect0(SmbFile.java:761)
>     at jcifs.smb.SmbFile.send(SmbFile.java:660)
>     at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1679)
>     at jcifs.smb.SmbFile.list(SmbFile.java:1544)
>     at jcifs.smb.SmbFile.list(SmbFile.java:1436)
>     at smbtest.main(smbtest.java:49)
> 
> >This is a low-level socket error that doesn't have anything to do with
> >jCIFS. The bug you cited was about failure to fall back from port 445
> >to port 139 but this exception shows port 139 so the fallback is working
> >properly in your case. It's more likely that the parameters given to the
> >socket are wrong because the URL is being interpreted incorrectly. Use
> >a properties file to increase the log level to 10. See if you can see
> >what the servername is that is being used just before the exception. If
> >you do not know how to interpret the output send be the last 1000 lines
> >of the log and I'll take a look.
> >
> >Also, try different credentials that do NOT have a '/' in the password. I
> >have a feeling that might be the culprit even if you URL decode it.
> >
> >Mike
> >
> >  
> >
> 
> 
> -- 
>  Mark Shifman MD. Ph.D.
>  Yale Center for Medical Informatics
>  Phone (203)737-5219
>  mark.shifman at yale.edu
> 


More information about the jcifs mailing list