1 2 Previous Next 26 Replies Latest reply: Jun 17, 2010 5:37 AM by 557719 RSS

    Configuring session timeout

    Vik Kumar-Oracle
      Well I see below message after a long idle time

      Because of inactivity, your session has timed out and is no longer active. The page will automatically be reloaded in 10 seconds; if not, click here.

      What if I have to show a better customize message as a popup instead of a blank white page?
        • 1. Re: Configuring session timeout
          Timo Hahn
          [http://thepeninsulasedge.com/frank_nimphius/2007/08/22/adf-faces-detecting-and-handling-user-session-expiry/|http://thepeninsulasedge.com/frank_nimphius/2007/08/22/adf-faces-detecting-and-handling-user-session-expiry/] solution is still valid.


          Timo
          • 2. Re: Configuring session timeout
            Frank Nimphius-Oracle
            Hi,

            you can also override the default exception handler in ADFc to redirect the request

            - Create a class that extends AdfcExceptionHandler
            - create a textfile with the name oracle.adf.view.rich.context.Exceptionhandler and store it in .adf\META-DATA\services
            - In the file, add the absolute name of your custom exception handler class
            - In the handleExceptionmethod, check throwable.getMessage() for "ADF_FACES-30108" which indicates the expiry message

            You can then issue a redirect to a nicer expiry page

            Frank
            • 3. Re: Configuring session timeout
              555256
              Hi Frank,
              I am trying to follow, your approach for configuring custom exception handler, as told by you, but could not get any success I have two queries in this approach :
              1) The text file will be in services directory in .*adf/META-INF* or .*adf/META-DATA* ? Because there is no folder with name META-DATA in .adf in project folder.
              2) The text file name would be "oracle.adf.view.rich.context.Exceptionhandler", without file extension or "oracle.adf.view.rich.context.Exceptionhandler.txt"
              3) Lets say my class lies in view-controller in package as x.y.z.XXExceptionHandler, so all I have to write in the file of step2 is x.y.z.XXExceptionHandler? or do i need to mention the complete absolute path like c:/......x/y/z/XXExceptionHandler.

              Please help.
              --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
              • 4. Re: Configuring session timeout
                555256
                Help required..!
                --Mukul                                                                                                                                                                                                                                   
                • 5. Re: Configuring session timeout
                  555256
                  Repost!
                  --Mukul                                                                                                                                                                                                                                               
                  • 6. Re: Configuring session timeout
                    John Stegeman
                    1). the .adf/META-INF folder is usually at the same level as your ".jws" file, but that is the correct directory.

                    2). no ".txt" extension

                    3). x.y.z.XXExceptionHandler is what you need


                    seems pretty simple to test.

                    John
                    • 7. Re: Configuring session timeout
                      555256
                      Hi John,
                      I followed exactly same steps, still getting error :

                      *<ClassLoaderUtils><getServices> Error parsing:file:/C:/Oracle_11g/Middleware/jdeveloper/jdev/system11.1.1.2.36.55.36/o.j2ee/drs/Oms_2_0/adf/META-INF/services/oracle.adf.view.rich.context.ExceptionHandler*
                      *<ClassLoaderUtils><getServices>*
                      *java.lang.ClassNotFoundException: fj.oms.view.error.FjOmExceptionHandler
                      at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:296)
                           at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:269)
                           at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:56)
                           at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                           at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
                           at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:37)
                           at org.apache.myfaces.trinidad.util.ClassLoaderUtils._getClass(ClassLoaderUtils.java:319)
                           at org.apache.myfaces.trinidad.util.ClassLoaderUtils.getServices(ClassLoaderUtils.java:265)
                           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.<init>(LifecycleImpl.java:120)
                           at oracle.adfinternal.view.faces.lifecycle.LifecycleFactoryImpl.<init>(LifecycleFactoryImpl.java:36)
                           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                           at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:519)
                           at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:405)
                           at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135)
                           at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717)
                           at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)
                           at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:186)
                           at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:131)
                           at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
                           at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:195)
                           at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
                           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                           at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                           at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
                           at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
                           at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
                           at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
                           at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
                           at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
                           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
                           at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
                           at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
                           at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
                           at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
                           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
                           at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
                           at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
                           at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
                           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
                           at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
                           at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:54)
                           at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
                           at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
                           at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
                           at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
                           at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
                           at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
                           at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
                           at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
                           at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
                           at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
                           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:67)
                           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)
                      *


                      Here is the summary of steps :
                      1) Created a folder with name "services" in .adf/META-INF folder .
                      2)Create a file with name "oracle.adf.view.rich.context.Exceptionhandler" with .txt extension in this folder.
                      3)Created following FjOmExceptionHandler class for testing :

                      package fj.oms.view.error;

                      import javax.faces.application.FacesMessage;
                      import javax.faces.context.FacesContext;
                      import javax.faces.event.PhaseId;

                      import oracle.adf.view.rich.context.ExceptionHandler;

                      import oracle.adfinternal.controller.application.AdfcExceptionHandler;

                      public class FjOmExceptionHandler
                      extends AdfcExceptionHandler
                      {
                      public FjOmExceptionHandler()
                      {
                      super();
                      }

                      public void handleException(FacesContext facesContext,
                      Throwable throwable, PhaseId phaseId)
                      throws Throwable
                      {
                      System.out.println("testing................");
                      super.handleException(facesContext, throwable, phaseId);
                      }
                      }

                      4) Added "fj.oms.view.error.FjOmExceptionHandler" in file created in step2.

                      Please advise and help!
                      --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                      • 8. Re: Configuring session timeout
                        555256
                        Repost.
                        --Mukul                                                                                                                                                                                                                                               
                        • 9. Re: Configuring session timeout
                          555256
                          Repost.
                          --Mukul                                                                                                                                                                                                                                               
                          • 10. Re: Configuring session timeout
                            555256
                            Repost..!
                            --Mukul                                                                                                                                                                                                                                           
                            • 11. Re: Configuring session timeout
                              Nick Haralabidis
                              Hi there,

                              The solution suggested by Timo on this link http://thepeninsulasedge.com/frank_nimphius/2007/08/22/adf-faces-detecting-and-handling-user-session-expiry/ is a viable solution. Give it a try.

                              Nick
                              • 12. Re: Configuring session timeout
                                555256
                                Hi Nick,
                                Thanks for your reply, but I am aware of the solution on the link suggested by you(for session timeout).But I am trying to do something else, once I get control of exception stack, in exception handler class once the exception handler approach starts working. But exception handler approach is not working as mentioned by frank.
                                --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                                • 13. Re: Configuring session timeout
                                  Nick Haralabidis
                                  Mukul Gupta wrote:

                                  Here is the summary of steps :
                                  1) Created a folder with name "services" in .adf/META-INF folder .
                                  2)Create a file with name "oracle.adf.view.rich.context.Exceptionhandler" with .txt extension in this folder.
                                  3)Created following FjOmExceptionHandler class for testing :
                                  Mukul,

                                  In step 2) above, ensure that the oracle.adf.view.rich.context.Exceptionhandler file has no .txt extension.
                                  • 14. Re: Configuring session timeout
                                    555256
                                    Hi Nick,
                                    Thanks for your response again, but it was my mistake, I mistyped , I created a file with name "oracle.adf.view.rich.context.Exceptionhandler" without .txt extension in this folder. There is when I got the error stack I copy pasted in my previous posts.
                                    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                                    1 2 Previous Next