[jcifs] Random problems connecting to DFS server
Michael B Allen
ioplex at gmail.com
Fri Apr 20 08:03:37 MDT 2012
Ok. Your description is actually an interest clue in itself. So it was
a worthwhile exercise. Thanks for trying it.
On Fri, Apr 20, 2012 at 8:15 AM, Gabor Herr <gabor.e.herr at googlemail.com> wrote:
> Hi Mike,
> I've just tried your suggested workaround with my test case. Unfortunately
> it does not fix the problem. It looks like some method called from
> Dfs.resolve gets delayed (maybe waiting for some server response) and in the
> meanwhile tconHostname is set to null.
> Am 19.04.2012 17:51 schrieb "Michael B Allen" <ioplex at gmail.com>:
>> On Tue, Apr 17, 2012 at 5:17 PM, Gabor Herr <gabor.e.herr at googlemail.com>
>> > I don't know about any bug tracker for jcifs, so hopefully Mike has
>> > noticed
>> > this post...
>> There is a bug tracker. But it's just a web-based sortable "TODO list"
>> that only I have access to. If someone wants to +1 something just do
>> it on the list.
>> But this NPE is already listed high on the TODO list and, as I eluded
>> to in my initial response, the proposed "patch" is absolutely not
>> correct. I will have to investigate how the tconHostName can be null
>> after connect0 was called successfully.
>> A safer workaround for now might be to try something in
>> SmbFile.java:isConnected() like:
>> return tree != null && tree.connectionState == 2 &&
>> tree.session.transport.tconHostName != null;
>> The rational is that if tconHostName is null, something called
>> doDisconnect so isConnected should probably return false. Then again,
>> if this is a concurrency issue this "workaround" could just cause the
>> code to go around in circles.
>> Michael B Allen
>> Java Active Directory Integration
Michael B Allen
Java Active Directory Integration
More information about the jCIFS