Bug 993566 - NPE from HttpConversationContextImpl.setSessionAttribute() on server shutdown
NPE from HttpConversationContextImpl.setSessionAttribute() on server shutdown
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Clustering (Show other bugs)
6.1.1
Unspecified Unspecified
unspecified Severity high
: GA
: EAP 6.2.0
Assigned To: Radoslav Husar
Jitka Kozana
Russell Dickenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-06 04:05 EDT by Jitka Kozana
Modified: 2013-12-12 11:01 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-12 11:01:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jitka Kozana 2013-08-06 04:05:05 EDT
Setup: 4-node cluster, cache REPL_SYNC, EAP 6.1.1.ER4, failover functionality testing. 

Application uses 
<replication-granularity>ATTRIBUTE</replication-granularity>
as a replication setup. We did not see this NPE with a "SESSION" replication granularity. 

We have observed the NPE during server shutdown:

17:32:11,172 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host]] (ajp-perf21/10.16.90.60:8009-75) JBWEB000233: Exception sending request initialized lifecycle event to listener instance of class org.jboss.weld.servlet.WeldListener: java.lang.NullPointerException
	at org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:17) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:12) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.context.AbstractConversationContext.associate(AbstractConversationContext.java:130) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:135) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.1.Final-redhat-1.jar:7.2.1.Final-redhat-1]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

The client was presented with 500 and the following error:
 Invalid response code: 500 Content: <html><head><title>JBoss Web/7.2.1.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000066: Exception report</p><p><b>JBWEB000068: message</b> <u></u></p><p><b>JBWEB000069: description</b> <u>JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>JBWEB000070: exception</b> <pre>java.lang.NullPointerException
	org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:17)
	org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:12)
	org.jboss.weld.context.AbstractConversationContext.associate(AbstractConversationContext.java:130)
	org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:135)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
	org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488)
	org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
	java.lang.Thread.run(Thread.java:662)
</pre></p><p><b>JBWEB000072: note</b> <u>JBWEB000073: The full stack trace of the root cause is available in the JBoss Web/7.2.1.Final-redhat-1 logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.1.Final-redhat-1</h3></body></html>>
        org.jboss.smartfrog.loaddriver.RequestProcessingException: Invalid response code: 500 Content: <html><head><title>JBoss Web/7.2.1.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000066: Exception report</p><p><b>JBWEB000068: message</b> <u></u></p><p><b>JBWEB000069: description</b> <u>JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>JBWEB000070: exception</b> <pre>java.lang.NullPointerException
	org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:17)
	org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:12)
	org.jboss.weld.context.AbstractConversationContext.associate(AbstractConversationContext.java:130)
	org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:135)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
	org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488)
	org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
	java.lang.Thread.run(Thread.java:662)
</pre></p><p><b>JBWEB000072: note</b> <u>JBWEB000073: The full stack trace of the root cause is available in the JBoss Web/7.2.1.Final-redhat-1 logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.1.Final-redhat-1</h3></body></html>
	at org.jboss.smartfrog.loaddriver.http.HttpRequestProcessorFactoryImpl$HttpRequestProcessor.processRequest(HttpRequestProcessorFactoryImpl.java:158)
	at org.jboss.smartfrog.loaddriver.CompoundRequestProcessorFactoryImpl$CompoundRequestProcessor.processRequest(CompoundRequestProcessorFactoryImpl.java:52)
	at org.jboss.smartfrog.loaddriver.Runner.run(Runner.java:87)
	at java.lang.Thread.run(Thread.java:662)

Links to server log:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-6x-failover-http-granular-shutdown-repl-sync/24/artifact/report/config/jboss-perf21/server.log
Link to client log:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-6x-failover-http-granular-shutdown-repl-sync/24/console-perf17/
Comment 1 Jozef Hartinger 2013-08-06 04:32:14 EDT
Can you reliably reproduce the error or is it an intermittent issue? 

The error does not look to be a bug in Weld but a rather a problem in the servlet container as the NPE comes from https://github.com/weld/core/blob/1.1.13.Final/impl/src/main/java/org/jboss/weld/context/http/HttpConversationContextImpl.java#L17 and per Servlet specification a call to request.getSession(true) should never ever return null.
Comment 2 Radoslav Husar 2013-08-06 06:40:28 EDT
This is indeed a clustering issue. Is this a regression?
Comment 3 Ladislav Thon 2013-08-06 08:41:03 EDT
QA note: this is [probably] impossible to distinguish from BZ 900549 with LogParser as the error messages are identical, the only difference is in the stack trace. Will have to find some way around this.
Comment 4 Jitka Kozana 2013-08-06 10:13:38 EDT
A note on frequency of this issue: I have run the test twice, so there were in total 8 * 2 = 16 shutdowns of server. During these two runs, this NPE was seen only once.

Note You need to log in before you can comment on or make changes to this bug.