[jboss-jira] [JBoss JIRA] (WFLY-6052) NPE on session.invalidate()

Juan AMAT (JIRA) issues at jboss.org
Sat Jan 23 20:20:00 EST 2016


    [ https://issues.jboss.org/browse/WFLY-6052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152755#comment-13152755 ] 

Juan AMAT commented on WFLY-6052:
---------------------------------

undertow 1.3.14.Final does fix my issue.

I do have though another problem with session.invalidate().

This is related to the problem described here:  https://developer.jboss.org/thread/254200
If I use the configuration that is described in this discussion:
                <replicated-cache name="repl" mode="ASYNC" batching="true">  
                    <transaction locking="OPTIMISTIC"/>  
                    <locking isolation="READ_COMMITTED"/>  
                    <file-store/>  
                </replicated-cache> 
then everything is fine until I call session.invalidate(). In this case I get an exception:

Caused by: java.lang.UnsupportedOperationException: Calling lock() on non-transactional caches is not allowed
	at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:820)
	at org.infinispan.cache.impl.DecoratedCache.lock(DecoratedCache.java:136)
	at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:124)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:39)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:89)
        at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:40)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSession.invalidate(InfinispanSession.java:67)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager$SchedulableSession.invalidate(InfinispanSessionManager.java:439)
	at org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:181)
	at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:199)

Now I modify the configuration and specify <transaction mode="BATCH" locking="OPTIMISTIC"/>, I do get another exception:

Caused by: org.infinispan.InvalidCacheUsageException: Explicit locking is not allowed with optimistic caches!
	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitLockControlCommand(OptimisticLockingInterceptor.java:142)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
	at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:157)
	at org.infinispan.interceptors.TxInterceptor.visitLockControlCommand(TxInterceptor.java:215)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
	at org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:163)
	at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitLockControlCommand(TransactionSynchronizerInterceptor.java:78)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
	at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:238)
	at org.infinispan.statetransfer.StateTransferInterceptor.visitLockControlCommand(StateTransferInterceptor.java:102)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107)
	at org.infinispan.interceptors.InvocationContextInterceptor.visitLockControlCommand(InvocationContextInterceptor.java:81)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
	at org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:163)
	at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
	at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:828)
	at org.infinispan.cache.impl.DecoratedCache.lock(DecoratedCache.java:136)
	at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:124)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:39)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:89)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:40)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSession.invalidate(InfinispanSession.java:67)
	at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager$SchedulableSession.invalidate(InfinispanSessionManager.java:439)
	at org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:181)
	at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:199)

Is there some other configuration that I should use?


> NPE on session.invalidate()
> ---------------------------
>
>                 Key: WFLY-6052
>                 URL: https://issues.jboss.org/browse/WFLY-6052
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web (Undertow)
>    Affects Versions: 10.0.0.CR5
>            Reporter: Juan AMAT
>            Assignee: Stuart Douglas
>
> I created a discussion about the issue some time ago but got not answer.
> See: https://developer.jboss.org/message/946976#946976
> The problem is that when a webapp is not marked as 'distributable' the undertow InMemorySessionManager is used.
> As mentioned in the discussion the 'getSession' of this manager does not like to be called with a null parameter, which is what willdfy does.
> This happens when single-sign-on is enable and multiple sessions are associated to the same sso session and 'invalidate' is called on one of the session.
> The workaround is to marked all our webapps as distributable but this will have a performance impact.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list