]
Brian Stansberry reassigned WFLY-6315:
--------------------------------------
Assignee: Paul Ferraro
session.invalidate() throw NullPointerException on invalidated
session with replication-granularity set to ATTRIBUTE
--------------------------------------------------------------------------------------------------------------------
Key: WFLY-6315
URL:
https://issues.jboss.org/browse/WFLY-6315
Project: WildFly
Issue Type: Bug
Components: Clustering
Environment: Wildfly 8.2.1-Final
JDK 1.8.0_66-b17
Windows & Linux
Reporter: Sammy Chu
Assignee: Paul Ferraro
Attachments: session-invalidate-noreplication.war,
session-invalidate-replication-attribute.war, session-invalidate-replication-session.war
We suspected that calling session.invalidate() on an already invalidated session with
replication-granularity set to "ATTRIBUTE" will throw a NullPointerException,
but from the specification it should throw an IllegalStateException instead.
Stack trace as below:
{noformat}
13:12:35,554 ERROR [io.undertow.request] (default task-32) UT005023: Exception handling
request to /<our system url>: java.lang.NullPointerException
at
org.wildfly.clustering.web.infinispan.session.fine.FineSessionFactory$1.invoke(FineSessionFactory.java:103)
at
org.wildfly.clustering.web.infinispan.session.fine.FineSessionFactory$1.invoke(FineSessionFactory.java:100)
at
org.jboss.as.clustering.infinispan.invoker.SimpleCacheInvoker.invoke(SimpleCacheInvoker.java:34)
at
org.jboss.as.clustering.infinispan.invoker.RetryingCacheInvoker.invoke(RetryingCacheInvoker.java:87)
at
org.wildfly.clustering.web.infinispan.session.fine.FineSessionFactory.remove(FineSessionFactory.java:109)
at
org.wildfly.clustering.web.infinispan.session.fine.FineSessionFactory.remove(FineSessionFactory.java:53)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSession.invalidate(InfinispanSession.java:74)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager$SchedulableSession.invalidate(InfinispanSessionManager.java:359)
at
org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:140)
at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:199)
[undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
... // our application code, just calling "session.invalidate()"
{noformat}
We also enclosed the simplified samples to reproduce this issue
(session-invalidate-noreplication.war, session-invalidate-replication-attribute.war,
session-invalidate-replication-session.war). In general they are the same except the
replication-granularity (in jboss-web.xml => replication-granularity) settings.
# session-invalidate-noreplication.war and session-invalidate-replication-session.war
works correctly as they are throwing IllegalStateException.
# session-invalidate-replication-attribute.war is buggy because it throw
NullPointerException instead.
For more information, please refer to
https://developer.jboss.org/message/947295