0 Replies Latest reply on Sep 27, 2017 12:10 AM by Ross Tang

    IdentityBeanDefinition destory on domain mode clustered environment exception

    Ross Tang Newbie

      Hi,

       

      We use jboss eap 7.0 domain mode with picketlink 2.7.1.Final.

      When we login our front side page(session create) and keep stay in one page(waiting timeout).

      Then we restart back side server before session time out.

      After session timeout, we submit the waiting page and got exception:

       

      [Server:backend22] 11:00:30,747 ERROR [io.undertow.request] (default task-18) UT005071: Undertow request failed HttpServerExchange{ GET /test-web/test.jsf request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8], Accept-Language=[zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,zh-CN;q=0.2], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate], User-Agent=[Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36], Connection=[keep-alive], Cookie=[JSESSIONID=zMQH-d9SWWtmThB6YTYtHUScun1bxSE8t24JPT0N.node22], Referer=[http://10.0.0.1:8080/test-web/], Upgrade-Insecure-Requests=[1], Host=[10.0.0.1:8080]} response {Content-Type=[text/html;charset=UTF-8], Content-Length=[80], Date=[Wed, 27 Sep 2017 11:00:30 GMT]}}: java.lang.NullPointerException

      [Server:backend22] at org.picketlink.internal.IdentityBeanDefinition.destroy(IdentityBeanDefinition.java:147)

      [Server:backend22] at org.picketlink.internal.IdentityBeanDefinition.destroy(IdentityBeanDefinition.java:51)

      [Server:backend22] at org.jboss.weld.util.bean.IsolatedForwardingBean.destroy(IsolatedForwardingBean.java:50)

      [Server:backend22] at org.jboss.weld.context.AbstractContext.destroyContextualInstance(AbstractContext.java:147)

      [Server:backend22] at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:161)

      [Server:backend22] at org.jboss.weld.context.AbstractManagedContext.deactivate(AbstractManagedContext.java:58)

      [Server:backend22] at org.jboss.weld.context.AbstractBoundContext.deactivate(AbstractBoundContext.java:72)

      [Server:backend22] at org.jboss.weld.context.http.HttpSessionContextImpl.destroy(HttpSessionContextImpl.java:60)

      [Server:backend22] at org.jboss.weld.servlet.HttpContextLifecycle.sessionDestroyed(HttpContextLifecycle.java:175)

      [Server:backend22] at org.jboss.weld.servlet.WeldInitialListener.sessionDestroyed(WeldInitialListener.java:129)

      [Server:backend22] at io.undertow.servlet.core.ApplicationListeners.sessionDestroyed(ApplicationListeners.java:311)

      [Server:backend22] at io.undertow.servlet.core.SessionListenerBridge.sessionDestroyed(SessionListenerBridge.java:67)

      [Server:backend22] at io.undertow.server.session.SessionListeners.sessionDestroyed(SessionListeners.java:61)

      [Server:backend22] at org.wildfly.clustering.web.undertow.session.UndertowSessionExpirationListener.sessionExpired(UndertowSessionExpirationListener.java:56)

      [Server:backend22] at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:243)

      [Server:backend22] at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:148)

      [Server:backend22] at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:726)

      [Server:backend22] at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:756)

      [Server:backend22] at io.undertow.servlet.spec.ServletContextImpl.updateSessionAccessTime(ServletContextImpl.java:760)

      [Server:backend22] at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:565)

      [Server:backend22] at io.undertow.servlet.spec.HttpServletResponseImpl.doErrorDispatch(HttpServletResponseImpl.java:170)

      [Server:backend22] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:320)

      [Server:backend22] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)

      [Server:backend22] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

      [Server:backend22] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)

      [Server:backend22] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

      [Server:backend22] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792)

      [Server:backend22] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      [Server:backend22] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      [Server:backend22] at java.lang.Thread.run(Thread.java:748)

       

      To avoid NPE, we add the null check code:

       

          @Override
          public void destroy(DefaultIdentity instance, CreationalContext<DefaultIdentity> creationalContext) {
              if (this.injectionTarget != null && instance != null) {
                  this.injectionTarget.preDestroy(instance);
                  this.injectionTarget.dispose(instance);
              }
              creationalContext.release();
          }