Bug 51277 - NPE during the form authentication when form-login-config is missed
NPE during the form authentication when form-login-config is missed
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.12
All All
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-05-27 12:04 UTC by Michael
Modified: 2011-05-31 13:06 UTC (History)
0 users



Attachments
Log from a browser (1018 bytes, application/octet-stream)
2011-05-27 12:04 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2011-05-27 12:04:07 UTC
Created attachment 27075 [details]
Log from a browser

Hi!
There is NPE during the form authentication when form-login-config is missed

I missed form-login-config by mistake (converted it from the BASIC):

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Tomcat Manager Application</realm-name>
  </login-config>
Unfortunately I get NPE (see below and attached).
I do understand that Form authentication can not work, but I think NPE is bad output.
I think better is HTTP 500.

Best regards,
   Michael


java.lang.NullPointerException
	org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:373)
	org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:267)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:539)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	java.lang.Thread.run(Thread.java:662)
Comment 1 Mark Thomas 2011-05-31 13:06:04 UTC
Check the response again. You do get a 500 response.

I agree that the stack traced is not ideal. I have modified this to provide a more useful error message.

The fix has been made to 7.0.x and will be included in 7.0.15 onwards.