[jcifs] RE: JCFIS java.lang.NullPointerException

Michael B Allen mba2000 at ioplex.com
Tue Nov 7 17:15:05 GMT 2006


This error has been discussed before. You can google the jCIFS archives
very easily with search parameters like:

  site:lists.samba.org/archive/jcifs writeParameterWordsWireFormat NullPointerException

The JRE you're using doesn't support the Cp850 encoding but the NetBeans
one does because it's the JDK. Set jcifs.encoding to ASCII (or it might
be "US-ASCII", can't remember) like:

  jcifs.Config.setProperty("jcifs.encoding", "ASCII");

Note that this is not a bug but the UnsupportedEncoding exception being
caught and ignored is (thanks Chuck). That is on The List. Also, since
this should only occur when the client communicates with a server that
doesn't support Unicode (e.g. old Samba servers, Windows 98, etc) I think
I should change the encoding used when computing the ASNI password hash
from ServerMessageBlock.OEM_ENCODING to "ASCII".

Mike

On Tue, 7 Nov 2006 08:23:32 -0600
"Daniel Rychlik" <drychlik at securustech.net> wrote:

> I don___t understand this at all...  I am getting down to the wire to get this project completed but this doesn___t work when compiled into a jar file...  Even this simple example fails in a jar, but works in Netbeans IDE...  Anyone have any advice?
> 
> C:\>java -jar "Documents and Settings\drychlik\smbStuff\dist\smbStuff.jar"
> Exception in thread "main" java.lang.NullPointerException
>         at jcifs.smb.SmbComSessionSetupAndX.writeParameterWordsWireFormat(SmbComSessionSetupAndX.jav
> a: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)

-- 
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/


More information about the jcifs mailing list