11 Replies Latest reply on Mar 17, 2016 5:05 PM by Helen Chen

    how is session associated with a request

    Helen Chen Novice

      Hi there,

      We are migrating code from  JBoss 4.2 GA to Wildfly 9.0.2 now. And in the meantime we are upgrading java from 1.6 to 1.8.


      We have some code that uses struts2  2.3.1version. What we did is : we have a main application which has context root /app1, and struts 2 application uses another context root /app2.  Page1 in /app1 needs to call  actions in /app2, so before page1 calls actions in /app2 , page1 saves data into serveltContext. Then in the action from /app2, the action will retrieve data from serveltContext, save it to the session associated with the request, this is the way we pass data between context.


      In struts action class, we have the following line, it gets session associated with the request. we used param "false" here.

      HttpSession hsession = ServletActionContext.getRequest().getSession(false) ;

       

      In JBoss 4.2, this request always return a session, so the  code can retrieve data from serveltContext and then save to session.

      But with Wildfly 9, this line does not return session, I got null.  I verified ServletActionContext.getRequest()  always have request, but ServletActionContext.getRequest().getSession(false) always return null.  So the code broke, since there is no session the data cannot be passed through.

       

      I'm not sure if this is related to Java upgrade, or Wildfly upgrade. Since we have many places with this kind of code, I'm trying to avoid changing code during upgrade.


      Does anyone know any walk around solutions? like any configuration? or any clues? If you can give me some directions that will be greatly appreciated.


      Thanks, Helen

        • 1. Re: how is session associated with a request
          Paul Ferraro Master

          The ServletContext does not span applications.  See:

          http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html

           

          "There is one context per "web application" per Java Virtual Machine."

           

          If you want to share sessions across web applications, use the shared session feature:

          Web (Undertow) Reference Guide - WildFly 10 - Project Documentation Editor

          • 2. Re: how is session associated with a request
            Helen Chen Novice

            Hi Paul,

             

            From the document, it seems the shared session feature only applies to the wars inside the same ear.

             

            We have web apps in different ears, and some apps are at exploded directory structures . Does the shared session feature also applies to this situation? I tried to add jboss-all.xml to each ear, but it doesn't seem the session can be shared between different ears.  I'm wondering if I missed anything.

             

            Thanks, Helen

            • 3. Re: how is session associated with a request
              Paul Ferraro Master

              Is there any reason why you can't repackage your web apps that want to share sessions into a single enterprise application?  Otherwise, shared sessions only apply to web applications within an enterprise application.

              • 4. Re: how is session associated with a request
                Helen Chen Novice

                Hi Paul,

                 

                I did repackage to make some existing ears into one ear, the shared session works great.

                 

                But the problem for me is we have some applications that are in the exploded directory structure, due to historic reason,  we have some user data under the application directory and it is dynamically changed by user usages. So we cannot package this directory structure into war or ear yet. 

                 

                These web apps with exploded directory structure needs to call the web apps in the ear, since they are not in the same ear, shared session feature does not apply to this.

                For example, I have app /app1 which is in directory structure, I have /app2 and /app3 packaged into same ear. From /app1, I need to call /app2, and also hope the session data can be shared.

                 

                Is there any way to make shared session work for my situation?

                 

                Thanks a lot,

                 

                Helen

                • 5. Re: how is session associated with a request
                  Paul Ferraro Master

                  Why not use an exploded EAR (i.e. the same way you use an exploded WAR)?

                  • 6. Re: how is session associated with a request
                    Helen Chen Novice

                    That's an good idea. I didn't think of it. I'll try it and let you know.

                     

                    Thanks a lot,

                    Helen

                    • 7. Re: how is session associated with a request
                      Helen Chen Novice

                      Hi Paul,

                       

                      I'm using standalone mode.

                       

                      I created an exploded ear directory and put apps. I got the following exception.  I tried to move the the configuration from standalone.xml

                      <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>

                      But I still get similiar errors .

                       

                      Do you have any clue?  The log is long, I don't know how to upload the file .If you want the configuration file and server.log file, I can try to send to you.

                       

                       

                      2016-03-10 16:24:57,464 DEBUG [com.kwi.mainmenu] (default task-17) MainMenu2_jsp :sessionId:VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh -METHOD3:FIRST TIME:TRY-READKEYFILE:69871457645096

                      2016-03-10 16:24:57,466 INFO  [stdout] (default task-17) URLstring: /kwi_demo/generic_jsp/rungen13.jsp?shellscript=/usr2/generic2/Java/readKey.sh&numpar=1&par1=69871457645096.key&thisdir=null&clientName=generic2

                      2016-03-10 16:24:57,466 INFO  [stdout] (default task-17) execScript makeConnection: codeBase http://127.0.0.1/kwi_demo/

                      2016-03-10 16:24:57,466 INFO  [stdout] (default task-17) execScript makeConnection: URLString /kwi_demo/generic_jsp/rungen13.jsp?shellscript=/usr2/generic2/Java/readKey.sh&numpar=1&par1=69871457645096.key&thisdir=null&clientName=generic2

                      2016-03-10 16:24:57,466 INFO  [stdout] (default task-17) execScript makeConnection: JSESSIONID VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh

                      2016-03-10 16:24:57,468 INFO  [stdout] (default task-17) execScript makeConnection: JSESSIONID:VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh

                      2016-03-10 16:25:12,477 DEBUG [org.infinispan.util.concurrent.locks.LockManagerImpl] (default task-18) Failed to acquire lock VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh, owner is GlobalTransaction:<null>:2:local

                      2016-03-10 16:25:12,478 DEBUG [org.infinispan.util.concurrent.locks.LockManagerImpl] (default task-18) This transaction (GlobalTransaction:<null>:3:local) already owned locks []

                      2016-03-10 16:25:12,478 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (default task-18) ISPN000136: Execution error: org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 15 seconds for key VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh and requestor GlobalTransaction:<null>:3:local. Lock is held by GlobalTransaction:<null>:2:local, while request came from local

                              at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:198)

                              at org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLock(LockManagerImpl.java:171)

                              at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:183)

                              at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataReadCommand(PessimisticLockingInterceptor.java:68)

                              at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitGetKeyValueCommand(AbstractLockingInterceptor.java:70)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                              at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

                              at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:86)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                              at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:346)

                              at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:318)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                              at org.infinispan.interceptors.CacheMgmtInterceptor.visitDataReadCommand(CacheMgmtInterceptor.java:103)

                              at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:91)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                              at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102)

                              at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)

                              at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:86)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)

                              at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:430)

                              at org.infinispan.cache.impl.DecoratedCache.get(DecoratedCache.java:427)

                              at org.infinispan.cache.impl.AbstractDelegatingCache.get(AbstractDelegatingCache.java:287)

                              at org.wildfly.clustering.web.infinispan.session.coarse.CoarseSessionFactory.findValue(CoarseSessionFactory.java:120)

                              at org.wildfly.clustering.web.infinispan.session.coarse.CoarseSessionFactory.findValue(CoarseSessionFactory.java:56)

                              at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:232)

                              at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:115)

                              at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:723)

                              at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:753)

                              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:64)

                              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

                              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

                              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

                              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

                              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

                              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

                              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                              at java.lang.Thread.run(Thread.java:745)

                       

                       

                      2016-03-10 16:25:12,481 ERROR [io.undertow.request] (default task-18) UT005023: Exception handling request to /kwi_demo/generic_jsp/rungen13.jsp: org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 15 seconds for key VLdJ6HxnkggUozprMVyfCRty733aGOQlW51zIZRh and requestor GlobalTransaction:<null>:3:local. Lock is held by GlobalTransaction:<null>:2:local, while request came from local

                              at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:198)

                              at org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLock(LockManagerImpl.java:171)

                              at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:183)

                              at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataReadCommand(PessimisticLockingInterceptor.java:68)

                              at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitGetKeyValueCommand(AbstractLockingInterceptor.java:70)

                              at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)

                              at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                       

                       

                      Thanks a lot,

                       

                      Helen

                      • 8. Re: how is session associated with a request
                        Paul Ferraro Master

                        Can you reproduce the issue with the latest stable release (i.e. 10.0.0.Final)?

                        • 9. Re: how is session associated with a request
                          Helen Chen Novice

                          Ok, I'll try it and get back to you.

                           

                          Thanks a lot,

                          Helen

                          • 10. Re: how is session associated with a request
                            Helen Chen Novice

                            Hi Paul,

                             

                            Finally I got environment for Wildfly 1-.0.0.Final set up and reproduced the problem. This time I didn't disable line

                            <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>

                             

                            The following is the log. Please let me know if there is anything I can do to solve this issue.

                             

                            2016-03-16 13:52:00,169 INFO  [stdout] (default task-1) URLstring: /kwi_demo/generic_jsp/rungen13.jsp?shellscript=/usr2/generic2/Java/readKey.sh&numpar=1&par1=238191458150717.key&thisdir=null&clientName=generic2

                            2016-03-16 13:52:00,169 INFO  [stdout] (default task-1) execScript makeConnection: codeBase http://127.0.0.1/kwi_demo/

                            2016-03-16 13:52:00,169 INFO  [stdout] (default task-1) execScript makeConnection: URLString /kwi_demo/generic_jsp/rungen13.jsp?shellscript=/usr2/generic2/Java/readKey.sh&numpar=1&par1=238191458150717.key&thisdir=null&clientName=generic2

                            2016-03-16 13:52:00,169 INFO  [stdout] (default task-1) execScript makeConnection: JSESSIONID hT5W_55hKxlP2fTpmYH9cmBNyr8g6E1qqD5Yps-J

                            2016-03-16 13:52:00,172 INFO  [stdout] (default task-1) execScript makeConnection: JSESSIONID:hT5W_55hKxlP2fTpmYH9cmBNyr8g6E1qqD5Yps-J

                            2016-03-16 13:52:06,385 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kwi30

                            2016-03-16 13:52:15,184 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (default task-2) ISPN000136: Error executing command LockControlCommand, writing keys []: org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 15 seconds for key hT5W_55hKxlP2fTpmYH9cmBNyr8g6E1qqD5Yps-J and requestor GlobalTransaction:<null>:3:local. Lock is held by GlobalTransaction:<null>:2:local

                                    at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.lock(DefaultLockManager.java:236)

                                    at org.infinispan.interceptors.locking.AbstractLockingInterceptor.lockAllAndRecord(AbstractLockingInterceptor.java:199)

                                    at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.checkPendingAndLockAllKeys(AbstractTxLockingInterceptor.java:199)

                                    at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockAllOrRegisterBackupLock(AbstractTxLockingInterceptor.java:165)

                                    at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitLockControlCommand(PessimisticLockingInterceptor.java:184)

                                    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.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.InterceptorChain.invoke(InterceptorChain.java:336)

                                    at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:828)

                                    at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:810)

                                    at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.getValue(InfinispanSessionMetaDataFactory.java:84)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.findValue(InfinispanSessionMetaDataFactory.java:69)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.findValue(InfinispanSessionMetaDataFactory.java:39)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.findValue(InfinispanSessionFactory.java:61)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.findValue(InfinispanSessionFactory.java:40)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:234)

                                    at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:140)

                                    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:726)

                                    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:756)

                                    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69)

                                    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                                    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

                                    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)

                                    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

                                    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)

                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                                    at java.lang.Thread.run(Thread.java:745)

                             

                             

                            2016-03-16 13:52:15,185 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /kwi_demo/generic_jsp/rungen13.jsp: org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 15 seconds for key hT5W_55hKxlP2fTpmYH9cmBNyr8g6E1qqD5Yps-J and requestor GlobalTransaction:<null>:3:local. Lock is held by GlobalTransaction:<null>:2:local

                                    at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.lock(DefaultLockManager.java:236)

                                    at org.infinispan.interceptors.locking.AbstractLockingInterceptor.lockAllAndRecord(AbstractLockingInterceptor.java:199)

                                    at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.checkPendingAndLockAllKeys(AbstractTxLockingInterceptor.java:199)

                                    at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockAllOrRegisterBackupLock(AbstractTxLockingInterceptor.java:165)

                                    at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitLockControlCommand(PessimisticLockingInterceptor.java:184)

                                    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.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.InterceptorChain.invoke(InterceptorChain.java:336)

                                    at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:828)

                                    at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:810)

                                    at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.getValue(InfinispanSessionMetaDataFactory.java:84)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.findValue(InfinispanSessionMetaDataFactory.java:69)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.findValue(InfinispanSessionMetaDataFactory.java:39)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.findValue(InfinispanSessionFactory.java:61)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.findValue(InfinispanSessionFactory.java:40)

                                    at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:234)

                                    at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:140)

                                    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:726)

                                    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:756)

                                    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69)

                                    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                                    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)

                                    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

                                    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)

                                    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

                                    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)

                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                                    at java.lang.Thread.run(Thread.java:745)

                             

                             

                            2016-03-16 13:52:15,197 INFO  [stdout] (default task-1) execScript makeConnection: exception

                            2016-03-16 13:52:15,197 ERROR [stderr] (default task-1) java.io.IOException: Server returned HTTP response code: 500 for URL: http://127.0.0.1/kwi_demo/generic_jsp/rungen13.jsp?shellscript=/usr2/generic2/Java/readKey.sh&numpar=1&par1=238191458150717.key&thisdir=null&clientName=generic2

                            2016-03-16 13:52:15,197 ERROR [stderr] (default task-1)         at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at com.kwi.generic_classes.execScript.makeConnection(execScript.java:73)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at com.kwi.generic_classes.execScript.execScriptCommand(execScript.java:47)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at com.kwi.generic_classes.execScript.getScriptData(execScript.java:41)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at com.kwi.generic_classes.execScript.getReportData(execScript.java:36)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at org.apache.jsp.MainMenu2_jsp._jspService(MainMenu2_jsp.java:251)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346)

                            2016-03-16 13:52:15,198 ERROR [stderr] (default task-1)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at filters.ProgramNameFilter.doFilter(ProgramNameFilter.java:109)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)

                            2016-03-16 13:52:15,199 ERROR [stderr] (default task-1)         at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                             

                            Thanks a lot for your help,

                             

                            Helen

                            • 11. Re: how is session associated with a request
                              Helen Chen Novice

                              I used the standalone mode, and did some customization based on the default standalone.xml. I disabled the line <transaction mode="BATCH"/>, it seems that the exception is gone.  Not sure if I disabled too much and have any side effect. The detail is as following:

                               

                              originally the config is as:

                                      <subsystem xmlns="urn:jboss:domain:infinispan:4.0">

                                          <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">

                                              <local-cache name="default">

                                                  <transaction mode="BATCH"/>

                                              </local-cache>

                                          </cache-container>

                                          <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">

                                              <local-cache name="passivation">

                                                  <locking isolation="REPEATABLE_READ"/>

                                                  <transaction mode="BATCH"/>

                                                  <file-store passivation="true" purge="false"/>

                                              </local-cache>

                                              <local-cache name="persistent">

                                                  <locking isolation="REPEATABLE_READ"/>

                                                  <transaction mode="BATCH"/>

                                                  <file-store passivation="false" purge="false"/>

                                              </local-cache>

                                          </cache-container>

                                          ......

                               

                              I removed the line for <transaction mode="BATCH"/>, now it is as :

                                      <subsystem xmlns="urn:jboss:domain:infinispan:4.0">

                                          <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">

                                              <local-cache name="default">

                                              </local-cache>

                                          </cache-container>

                                          <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">

                                              <local-cache name="passivation">

                                                  <locking isolation="REPEATABLE_READ" />

                                                  <file-store passivation="true" purge="false"/>

                                              </local-cache>

                                              <local-cache name="persistent">

                                                  <locking isolation="REPEATABLE_READ" />

                                                  <file-store passivation="false" purge="false"/>

                                              </local-cache>

                                          </cache-container>

                               

                              Thanks, Helen