Status: Closed (View Workflow)
Affects Version/s: 10.0.0.Final
Steps to Reproduce:
- Deploy session-invalidate-replication-attribute.war to Wildfly 8.
- Access http://localhost:8080/session-invalidate-replication-attribute/ , you should see the current session ID listed
- Click the "Invalidate It" link
- NullPointerExpcetion occurred
The expected result should be throwing IllegalStateException as others (session-invalidate-noreplication.war, session-invalidate-replication-session.war) does.Deploy session-invalidate-replication-attribute.war to Wildfly 8. Access http://localhost:8080/session-invalidate-replication-attribute/ , you should see the current session ID listed Click the "Invalidate It" link NullPointerExpcetion occurred The expected result should be throwing IllegalStateException as others (session-invalidate-noreplication.war, session-invalidate-replication-session.war) does.
Git Pull Request:
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:
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
Updated in 2016-04-27
Test again in Wildfly 8.2.1.Final, Wildfly 10.0.0.Final and Wildfly 10.1.0.Final-SNAPSHOT (master branch), with HA profile (2 nodes in same machine), with my updated WARs, detail as below:
- session-invalidate-noreplication.war - throwing IllegalStateException in the index.jsp (line 62), which is expected, detail stacktrace as below:
- session-invalidate-replication-session.war - do NOT throw IllegalStateException when invalidating an already invalidated session, which is incorrect. My test just print:
- session-invalidate-replication-attribute.war - throwing NullPointerException in the index.jsp (line 62), which is incorrect. Detail stacktrace as below:
- session-invalidate-noreplication.war - same as Wildfly 8 to throw IllegalStateException which is intended.
- session-invalidate-replication-session.war - throwing IllegalStateException in the filter!!! (Yes, in the filter, NOT in the index.jsp!!!) which is incorrect. Detail as below:
- session-invalidate-replication-session.war - same behaviour as session-invalidate-replication-attribute.war as in Wildfly 10.0.0.Final, which throw exception in filter and do NOT throw exception in index.jsp, which is incorrect.
those 3 cases behaviour identical as Wildfly 10.0.0.Final.