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

anshuman_aggarwal at non.agilent.com anshuman_aggarwal at non.agilent.com
Sat Sep 28 04:48:54 EST 2002


 Session Cookies are not disabled in my browser and the problem persists all the cookies are enabled. I also set the security setting in IE to Low for internet and Lan just to make sure. I agree about the redundancy in the code and it should be rewritten the way you have mentioned. 

> -----Original Message-----
> From: AGGARWAL,ANSHUMAN (Non-A-Americas,ex1) 
> Sent: Friday, September 27, 2002 11:44 AM
> To: AGGARWAL,ANSHUMAN (Non-A-Americas,ex1)
> Subject: 
> 
> 
> 
> 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
> 



More information about the jcifs mailing list