[jcifs] Having problem with simply connecting with release 1.2.9

Michael B Allen mba2000 at ioplex.com
Mon Apr 24 19:04:20 GMT 2006

On Mon, 24 Apr 2006 10:24:04 -0500
"Dalton, Tim" <Daltontf at AGEDWARDS.com> wrote:

> The following beanshell code works just fine with 1.2.7:
> import jcifs.smb.*; 
> import java.io.*;
> file = new SmbFile("smb://HOME;daltontf:xxxxxxx@tdms1.agedwards.com/root/home/daltontf/testsmb.txt");
> smbout = new PrintStream(new SmbFileOutputStream(file, true));
> smbout.println("This is a test - " + new java.util.Date().toString());
> smbout.close();
> But with release 1.2.9, I get:
> java.lang.NullPointerException
>         at jcifs.smb.SmbComSessionSetupAndX.writeParameterWordsWireFormat(SmbComSessionSetupAndX.java:58)
>         at jcifs.smb.AndXServerMessageBlock.writeAndXWireFormat(AndXServerMessageBlock.java:94)
>         at jcifs.smb.AndXServerMessageBlock.encode(AndXServerMessageBlock.java:65)
>         at jcifs.smb.SmbTransport.doSend(SmbTransport.java:402)
>         at jcifs.util.transport.Transport.sendrecv(Transport.java:70)
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:602)
>         at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:269)
>         at jcifs.smb.SmbSession.send(SmbSession.java:225)
>         at jcifs.smb.SmbTree.treeConnect(SmbTree.java:147)
>         at jcifs.smb.SmbFile.connect(SmbFile.java:791)
>         at jcifs.smb.SmbFile.connect0(SmbFile.java:761)
>         at jcifs.smb.SmbFile.queryPath(SmbFile.java:1167)
>         at jcifs.smb.SmbFile.length(SmbFile.java:2160)
>         at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:129)
>         at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
> Am I doing something fundamentally wrong ?

No. The client should never throw a NullPointerException (except perhaps
if an inappropriate null parameter is passed to a method). So there's a
bug somewhere.

The place where the exception is occuring indicates that
NtlmPasswordAuthentication.accountPassword is null. Given the example
code and the claim that this does not occur in 1.2.7 the only change
that I think could have an impact is the jcifs.encoding default being
changed to Cp850. But even then I don't see how this can happen. I could
not reproduce the error using the attached example program.

1) Crank up jcifs.loglevel and see if there are any other exceptions
2) Try setting jcifs.encoding=ASCII or jcifs.encoding=Cp1252

Otherwise, I can only guess that your report is inaccurate and that you
are in fact setting other properties and/or the environemnt has changed
and that the bug actually exists in 1.2.7 as well. In this case you will
need to reanalyze and resubmit your issue.

Also, is DFS somehow involved?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.java
Type: application/octet-stream
Size: 394 bytes
Desc: not available
Url : http://lists.samba.org/archive/jcifs/attachments/20060424/013e7d36/Test.obj

More information about the jcifs mailing list