[jcifs] Null Pointer Exception on using NTLM Authenticaion wi th jcifs 0.7 .0 b3 w/Tomcat 4.1.12

Glass, Eric eric.glass at capitalone.com
Fri Sep 27 17:16:27 EST 2002


Just looking over the source (and paraphrasing),

111.    ntlm = (NtlmHttpSesson)ssn.getAttribute( "NtlmHttpSession" );
112.    msg = req.getHeader( "Authorization" );

......  // some stuff to handle an invalid message

123.    src = Base64.decode( msg.substring( 5 ));
124.
125.    if( src[8] == 1 ) {

......  // processing the type 1 message

160.    } else if( src[8] == 3 ) {
161.
162.        ntlm.decodeType3Message( Base64.decode( msg.substring( 5 )));


The ntlm object is null in your case, which indicates that it was unable to
be retrieved from the session -- my guess is you have session cookies
disabled in your browser.  As a side note, the "Base64.decode(
msg.substring( 5 )));" in line 162 is redundant -- this could be rewritten
as "Base64.decode(src);" to avoid the overhead of re-decoding the message
content.

> -----Original Message-----
> From: anshuman_aggarwal at non.agilent.com
> [mailto:anshuman_aggarwal at non.agilent.com]
> Sent: Thursday, September 26, 2002 7:31 PM
> To: jcifs at lists.samba.org
> Subject: [jcifs] Null Pointer Exception on using NTLM 
> Authenticaion with
> jcifs 0.7 .0 b3 w/Tomcat 4.1.12
> 
> 
> Hi,
>  I am using Tomcat 4.1.12 with NTLM Authenticaion via the 
> jcifs NTLM filter class. Unfortunately I was running the 
> instructions given at 
> http://jcifs.samba.org/src/docs/ntlmhttpauth.html with the 
> version 0.7.0b3 of jcifs and I get the following error when I 
> hit the examples application when I had set up the NTLM 
> authentication. 
> 
> java.lang.NullPointerException
> 	at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:162)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:213)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:193)
> 	at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:260)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:191)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
> 	at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Aut
> henticatorBase.java:471)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at 
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2396)
> 	at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
> 	at 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.java:170)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
> 	at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:174)
> 	at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at 
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.
> java:223)
> 	at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:405)
> 	at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConnection(Http11Protocol.java:380)
> 	at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:508)
> 	at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:533)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> The steps I followed:
> Installed Tomcat 4.1.12 and saw the homepage show up at port 8080
> Copied the jcifs-0.7.0b3.jar file to the lib directory in 
> web-inf in examples
> Modified web.xml of web-inf in examples to include the filter 
> as mentioned at the documentation site given above.
> Restarted the webserver
> Hit the examples site to get the above error
> 
> Is this a known issue with the jcifs 0.7b3? Does anybody have 
> any clues about how to fix this?
> 
> 
> Thanks,
> Anshuman
> 
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.



More information about the jcifs mailing list