[jcifs] newbie problems

Michael B Allen mba2000 at ioplex.com
Thu Jul 14 15:18:39 GMT 2005

On Thu, 14 Jul 2005 08:07:06 -0400
Mark Shifman <mark.shifman at yale.edu> wrote:

> 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.ssn139(SmbTransport.java:178)
>     at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:226)
>     at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:269)
>     at jcifs.util.transport.Transport.run(Transport.java:204)
>     at java.lang.Thread.run(Thread.java:534)

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.


More information about the jcifs mailing list