[jcifs] java.io.IOException: Failed to establish session

Shon Vella svella at idauto.net
Fri Jun 12 14:35:37 MDT 2015

I have a customer that is seeing this exact problem. In his case it appears
that CALLED_NOT_PRESENT is a result of not being able to properly resolve
the ip address to the netbios name so we're working on making sure that the
right name is available.

With regards to M.D.'s proposed solution, it isn't quite right. ssn139()
loops through the available names for the address, so resetting the port to
445 on the first CALLED_NOT_PRESENT or NOT_LISTENING_CALLED would be
premature. It need to wait at least until the loop exit, which only happens
after all the names have been tried, though I'm not sure even there is the
right place. I think if it were me I would put the error code in a variable
outside the loop, and then if I even completed the loop, rather than throw
IOError, I would throw NbtException using that error code rather than
throwing IOError. I would than add a catch of NbtException doConnect and
handle it similarly to ConnectException and NoRouteToHostException when the
code is CALLED_NOT_PRESENT or NOT_LISTENING_CALLED. It also seems that an
invalid or incomplete nbt response (e.g. the EOF case) might be also be a
good excuse to try 445 again.


View this message in context: http://samba.2283325.n4.nabble.com/java-io-IOException-Failed-to-establish-session-tp4682548p4687202.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.

More information about the jCIFS mailing list