Bug 51739 - If landingpage is a XHTML (JSF/CDI), nullpointer exception.
If landingpage is a XHTML (JSF/CDI), nullpointer exception.
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.20
PC All
: P2 minor (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-08-29 13:47 UTC by Flávio Henrique
Modified: 2011-08-29 18:30 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Flávio Henrique 2011-08-29 13:47:09 UTC

    
Comment 1 Mark Thomas 2011-08-29 13:48:46 UTC
No information provided.
Comment 2 Flávio Henrique 2011-08-29 13:52:47 UTC
	<Valve className="org.apache.catalina.authenticator.FormAuthenticator"
		landingPage="/restrito/principal.xhtml" />

A workaround is the use of a jsp page that redirect to the xhtml page (JSF page).

java.lang.NullPointerException: Name is null
	at java.lang.Enum.valueOf(Unknown Source)
	at javax.faces.webapp.FacesServlet$HttpMethod.valueOf(FacesServlet.java:172)
	at javax.faces.webapp.FacesServlet.isHttpMethodValid(FacesServlet.java:627)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:549)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:582)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
29/08/2011 10:42:35 org.apache.catalina.core.ApplicationDispatcher invoke
GRAVE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException: Name is null
	at java.lang.Enum.valueOf(Unknown Source)
	at javax.faces.webapp.FacesServlet$HttpMethod.valueOf(FacesServlet.java:172)
	at javax.faces.webapp.FacesServlet.isHttpMethodValid(FacesServlet.java:627)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:549)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:473)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
	at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:466)
	at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:315)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:179)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
29/08/2011 10:42:35 org.apache.catalina.core.StandardHostValve custom
GRAVE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/erro_servidor.xhtml]
java.lang.NullPointerException: Name is null
	at java.lang.Enum.valueOf(Unknown Source)
	at javax.faces.webapp.FacesServlet$HttpMethod.valueOf(FacesServlet.java:172)
	at javax.faces.webapp.FacesServlet.isHttpMethodValid(FacesServlet.java:627)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:549)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:473)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
	at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:466)
	at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:315)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:179)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Comment 3 Flávio Henrique 2011-08-29 13:55:34 UTC
(In reply to comment #1)
> No information provided.

Sorry, save the information before entering futher information.
Comment 4 Mark Thomas 2011-08-29 14:23:06 UTC
That is not a Tomcat problem.
Comment 5 Christopher Schultz 2011-08-29 17:10:52 UTC
To elaborate in order to avoid a REOPEN:

Flávio, you must have an enumerated type that is broken.
Comment 6 Konstantin Kolinko 2011-08-29 18:07:50 UTC
(In reply to comment #5)
> To elaborate in order to avoid a REOPEN:
> 
> Flávio, you must have an enumerated type that is broken.

From stacktrace and message it seems that valueOf(null) was called with null as a value of HTTP method.

Looking at o.a.c.authenticator.FormAuthenticator class, there are three places where "new SavedRequest()" constructor is called:
 one is in #saveRequest(),
 two are in #authenticate().

When in #saveRequest() the created SavedRequest object is filled with data, but in #authenticate() only requestURI is set and thus SavedRequest#method remains null.
Comment 7 Mark Thomas 2011-08-29 18:30:46 UTC
I take it back. It is a Tomcat problem. This has been fixed in 7.0.x and trunk and will be included in 7.0.21 onwards.