3 Replies Latest reply: Feb 26, 2012 5:15 PM by Steve Button-Oracle RSS

    Session share And EAR versioned deploy

    songsb
      I created a EAR with serveral web projects.some days ago, I configured the weblogic-application.xml in EAR to enable session share.
      <session-descriptor>
           <persistent-store-type>memory</persistent-store-type>
           <sharing-enabled>true</sharing-enabled>
      </session-descriptor>

      And I have used the weblogic's versioned deployment feature for a half year. Just add Weblogic-Application-Version to the EAR's MANIFEST.MF file. With the feature, I can redeploy diffrent version ear packages without stop users' session. But after I enable the session share feature, the redeployment always fail.
      Page shows error 500, and The server's log shows:

      <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1324889583810> <BEA-101162> <User defined listener org.apache.beehive.netui.pageflow.HttpSessionMutexListener failed: java.lang.NoClassDefFoundError: org/apache/beehive/netui/util/internal/ServletUtils.
      java.lang.NoClassDefFoundError: org/apache/beehive/netui/util/internal/ServletUtils
           at org.apache.beehive.netui.pageflow.HttpSessionMutexListener.sessionDestroyed(HttpSessionMutexListener.java:51)
           at weblogic.servlet.internal.EventsManager.notifySessionLifetimeEvent(EventsManager.java:265)
           at weblogic.servlet.internal.session.SessionData.remove(SessionData.java:874)
           at weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySessionContext.java:69)
           at weblogic.servlet.internal.session.MemorySessionContext$SessionCleanupAction.run(MemorySessionContext.java:114)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.session.MemorySessionContext.destroy(MemorySessionContext.java:90)
           at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3064)
           at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:241)
           at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:457)
           at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1399)
           at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:493)
           at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:189)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:148)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:139)
           at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:71)
           at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:207)
           at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:124)
           at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:418)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:148)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:139)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:91)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:84)
           at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:642)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:148)
           at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:139)
           at weblogic.application.internal.BaseDeployment.deactivate(BaseDeployment.java:234)
           at weblogic.application.internal.EarDeployment.deactivate(EarDeployment.java:16)
           at weblogic.application.internal.DeploymentStateChecker.deactivate(DeploymentStateChecker.java:200)
           at weblogic.deploy.internal.targetserver.AppContainerInvoker.deactivate(AppContainerInvoker.java:98)
           at weblogic.deploy.internal.targetserver.operations.StopOperation.doCommit(StopOperation.java:65)
           at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
           at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
           at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
           at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
           at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:164)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
           at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

      The Class ServletUtils and HttpSessionMutexListener are in a same jar, Why could not ServletUtils be found? and What's the function of HttpSessionMutexListener ?
      Can somebody help me? Thanks.

      Edited by: songsb on 2011-12-28 下午10:44

      Edited by: songsb on 2011-12-28 下午10:45
        • 1. Re: Session share And EAR versioned deploy
          Pazhanikanthan-Oracle
          NoClassDefFoundError occurs in this instance because one of the dependent class (could be a custom application class) is not visible to classloader during redeployment.

          Just to debug, what happens when:

          1. Restart the managed server with the new application?
          2. Undeploy and redeploy the application?
          • 2. Re: Session share And EAR versioned deploy
            songsb
            The error is :
            java.lang.NoClassDefFoundError: org/apache/beehive/netui/util/internal/ServletUtils
                 at org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler.applyChanges(DeferredSessionStorageHandler.java:196)
                 at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:319)
                 at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                 at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
                 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                 at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
                 at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
                 at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

            I think this happened is because i configured the weblogic-application.xml to share session between projects. The configuration is as following:
            <session-descriptor>
                 <persistent-store-type>memory</persistent-store-type>
                 <sharing-enabled>true</sharing-enabled>
            </session-descriptor>
            • 3. Re: Session share And EAR versioned deploy
              Steve Button-Oracle
              If you're sharing sessions between modules, then you'd need to make sure the classes that any of the classes that can appear in the session are available to all the web modules.

              So it's possible here that the module in which the secondary replica is being de-handled doesn't have access to this class:
              java.lang.NoClassDefFoundError: org/apache/beehive/netui/util/internal/ServletUtils
              You'd need to share the common classes/libraries at the application level to make that happen, or put the common classes/libraries in each web module.

              -steve-