Invalidate Session Error

Anytime I attempt to invalidate a session, I get the following exception:
javax.faces.FacesException: #{backing_userInfo.commandLink1_action}: javax.faces.el.EvaluationException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
Here's my method:
public String commandLink1_action() throws IOException {
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
HttpSession session = (HttpSession)ectx.getSession(false);
session.invalidate();
return null;
Any ideas?
Thanks,
Tim

Hi,
you need to redirect the call after invalidating the session. by returning "null" you pass control back to JSF, which no longer has a session open
Frank

Similar Messages

  • Invalidate session with weblogic.Admin

    Hi,
    I tried to invalidate sessions using weblogic.Admin using the command: java weblogic.Admin -url t3://localhost:8013 -username system -password *** GET -pretty -type ServletSessionRuntime. The output was:
    MBeanName: "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime"
    CachingDisabled: true
    MainAttribute: [email protected]/ps
    Name: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
    ObjectName: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
    Parent: PIA
    Registered: true
    TimeLastAccessed: 1102341410448
    Type: ServletSessionRuntime
    Then tried to invalidate it using:
    java weblogic.Admin -url t3://localhost:8013 -username system -password *** INVOKE -mbean "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime" -method INVALIDATE
    ANd the error message: bash: !1102341400731: event not found
    Do you know how to handle this? Or any other way to invalidate session from weblogic.Admin?
    WLS 8.1 SP1
    Regards
    Tomi

    Hello,
    I have a system consisting of three different departments, each department has its own login page with different username and password.
    from the same browser, all three administrators can log in successfully, during there login, one session is created with different attributes for each of them, if any one administrator logs out, I invalidate the session, which logs out the other two administrators.
    Can I use session Id to log out on administrator while the other two can stay logs in?
    If I am using the wrong approach all together, can anyone suggest an alternative please?
    here is my code to create session:
    // if correct username and password entered then create session
    String financeAdminSess = adminUsername;
    session.setAttribute("financeAdminSess", adminUsername);                                        
    String redirectURL = "finance_admin_home.jsp";
    response.sendRedirect(redirectURL);
    and here is the code for loggin out:
    // get session
    String financeAdminSess=(String) session.getAttribute("financeAdminSess");
    // remove session
    session.removeAttribute("financeAdminSess<br />");
    // invalidate session
    session.invalidate();
    Any suggestion would be much appreciated.
    Thanks
    Shaxo

  • Is it possible to invalidate session when I click my browsers back button

    Hai
    I have a question.
    I am building a jsp page with multiple forms.As of now,
    no login system has been implemented.
    I need my session to time out when the client click on the back
    button on the browser to prevent data corruption.
    Is there a possible way to do this in Java/ Script
    I know the use of session.invalidate() but how to tie it up to the
    browser's back button
    A second problem
    If I use session.invalidate() on Tomcat 3.2
    I find that it is not invalidated.But this same function on tomcat 4
    doesn't have any problem
    Could anyone help on these issues
    Thanks

    You don't mean you want to invalidate session every time you move to a new page, do you? If you do, after implementation of login system the users will be asked for passwords at each page. If you don't, it's better to use headers for your response.
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Expires", "-1");

  • With the new seession in IE gives session error for new user

    Hi,
    In new opened IE if i tries to login with new user. It is switching b/w the files in the status bar(ie., Header1.jsp and ListServicecall.jsp simultaneously) and at end the session error result will arise.
    But for the second time if i login with the same username/password the page is displaying properly. please Can any one help out.
    Thanks,
    Satish R

    First time if the user logins to IE in the HP Service Desk(SD) page. Some of the pages will iteratively loops and give a session expires error. After that the user logins to the page with no error.
    If i create a new copy of the data from the existing folder and if i try to run then the result will be error for that folder also.
    ie., Assume folder 123 where, first time for every new login user the session expire error occurs. later they'll login without any problem.
    If i rename the folder 123 to xyz/create new copy and rename then, the same problem repeats. First time for the new user it will give session expire error and later he can login to the HPSD page with no error.
    Is it require cookies to be programmed in that program.
    Regards,
    Satish R

  • In Production IC AGENT Bussines role ,iam getting error Worker session error in session initialization(SAM_QUEUE NOT SET ) in sap crm?

    Hi Team,
    In Production IC AGENT Bussines role ,I have configured the bussines role.in DEV,and QA system it is working fine...in production ,iam getting error as below.
    Worker session error in session initialization(SAM_QUEUE NOT SET )
    Type = SYSTEM_ERROR,ID = ERROR_SESSOPN_INIT,description=
    Could youe please help here..
    Thanks
    Kalpana

    Hi Kalpana,
    Please take a look at KBA 1954574 - Problems with CRM IC Functionalities related to Communication Session (alerts, greyed out ready/not ready buttons, agent dashboard) in complex system landscapes
    This details a few things you need to check.
    Let me know how you get on. If you have any questions or concerns.
    Kind Regards,
    James

  • Disco10g Viewer session errored on export to excel Javascript1.2 must ena

    Hi,
    Disco Viewer session errored on export of Workbook. The following error is received in exported excel file "Your browser must support Javascript 1.2 and Javascript must be enabled in your browser to run OracleBI Discoverer properly." This report exports OK from Plus and Client.
    Your valuable inputs are highly appreciable.
    Thanks in Advance,
    Venkat,

    To add to Patrick's suggestion....
    What I am suggesting is not the cause of the FLOWS_030000 user existing error, but could be another issue which caused your installation to fail.
    In your post, you said...
    This is the command i gave to configure from SQL prompt:
    @D:\Apex3.0\apexins.sql <Newly Create User> <Newly Created Tablespace> <Newly Created Tablespace> TEMP /i/
    You have specified an absolute path when running the apexins.sql script. In order for the installation to succeed, you must first change your working directory to the directory where you unzipped the apex_3.0.zip file and then run the script. This is because the apexins.sql script subsequently references other sql scripts, using relative paths.
    You have also not included a password in your command, was this just for purposes of the posting, or could this also be an issue, as in:
    @apexins password tablespace_apex tablespace_files tablespace_temp images
    Hope this helps,
    Anthony
    http://anthonyrayner.blogspot.com

  • Invalidate session in BlazeDS

    Hi!
    I need to integrate BlazeDS security with an external security mechanism so I have implemented custom authentication as described in http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_1 .html. Now I need to invalidate user authentication on server upon certain circunstances. When this happens, I invalidate Session contained in Request parameter of invoke method of TomcatValve. This seems to work but I get a nasty "Duplicated Http Session" in Flex client telling that cookies where removed in server. Is there any clear way to invalidate current user login from BlazeDS?
    I've also tried invalidating FlexSession but then Flex clients hangs.
    Thank you very much.
    Daniel.

    Ummm - isn't that exactly what a session timeout specifies?
    ie how long should it stick around before it "expires" and should be invalidated?
    You don't need to call session.invalidate() - it will do that all by itself.

  • I am facing "Please re-login to renew your session" error in Blackberry Z30 smartphone

    After updating my OS y2 days ago, when I am logging in to Facebook using my Blackberry Z30 smartphone, I am facing "Please re-login to renew your session" error.
    Please help me resolve this problem.

    Ah, you move too fast and too far with restored your backup. Your phone is now re-syncing with all your programs, apps, contacts etc. That's why it's wonky at the moment. Unistall FB app once again, reboot your phone with battery pull while your phone is on and connected to the wall charger. Leave it for 20 minutes and reinsert the battery. Reinstall FB app again. See if there's difference. If still no luck, since you have data backed up, I'd recommend to wipe your phone. Then try to login FB app again. Do not restore your backup. If still fails, please call your carrier. They might able to help you with reset your sim account.
    It's quite weird, never happened with my BB devices. I am thinking it might be related with temporary network problem or temporary app server problem.
    There's another Knowledge Based, just for your additional reference. Article ID: KB35532  Troubleshooting Issues with Social Networking On BlackBerry Smartphones
    Good luck.
    • Click Likes to appreciate those who helps you
    • If your issue solved, mark the best post in your thread as Solution

  • Duplicate session error using Flash Remoting from Air 3.4 Mobile Apps ( IOS and Android ) with CF10

    We're getting the "duplicate session" error using Flash Remoting from Air 3.4 Mobile Apps ( IOS and Android ) with Coldfusion 10 Standard.
    faultCode:Server.Processing.DuplicateSessionDetected faultString:'Detected duplicate HTTP-based FlexSessions,
    generally due to the remote host disabling session cookies.
    Session cookies must be enabled to manage the client connection correctly.' faultDetail:'null'
    Have read most of the docs about this error -all to do with LCDS
    Notes:
    Not using LCDS,
    No Remote Calls from loaded Sub-Apps,
    No Errors from the Flex Web App which is pretty  much identical and calls the same cfcs.
    The error does not happen all the time and is hard to reproduce - say 5% of app sessions at a guess.
    Could it be a two first time remote calls hitting the server together before a session is set up?
    Our remoteObjects are in two places 1) Main Application.mxml and within a class compiled into the main app - can't see how this would be an issue.
    I enabled session management for the CFCs in Application.cfc but still occurs. Is this neccessary - it's not in any docs?
    Could this be something to do with the app not being shut down - as is typical with mobile users? When they resume use after a day or two surely a new session will be created?
    Please advise thank you.

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • Java Session error occurred

    Hi Experts,
    We are in process of upgrading CRM 4.0 to CRM 7.0, sometimes we face " Java session error occurred"  popup in CRM 7 while working on pricing or in some tabs of CRMD_ORDER
    Any idea why this is error is happening, we checked all IPC routines and are also woking fine.
    Expert advise needed.
    Thanks.
    Abhishek

    Thanks for reply Leon,
    Just got the log of the java messages in SM53 Log Administration, and found that Shared Closure has no space to create or save the session. Obviously the problem is lack of space.
    I dont have idea how to set the space profiling for the shared closure, can you please guide me on this or how to find resolution for this space related issue.
    Thanks in advance.
    Abhishek

  • Invalidate session with specific sessionId

    Hi there,
    Is it possible to invalidate session with specific sessionId?
    Thanks.

    Hello,
    I have a system consisting of three different departments, each department has its own login page with different username and password.
    from the same browser, all three administrators can log in successfully, during there login, one session is created with different attributes for each of them, if any one administrator logs out, I invalidate the session, which logs out the other two administrators.
    Can I use session Id to log out on administrator while the other two can stay logs in?
    If I am using the wrong approach all together, can anyone suggest an alternative please?
    here is my code to create session:
    // if correct username and password entered then create session
    String financeAdminSess = adminUsername;
    session.setAttribute("financeAdminSess", adminUsername);                                        
    String redirectURL = "finance_admin_home.jsp";
    response.sendRedirect(redirectURL);
    and here is the code for loggin out:
    // get session
    String financeAdminSess=(String) session.getAttribute("financeAdminSess");
    // remove session
    session.removeAttribute("financeAdminSess<br />");
    // invalidate session
    session.invalidate();
    Any suggestion would be much appreciated.
    Thanks
    Shaxo

  • Invalidate Session at all Cluster Weblogic

    hi all,
    i try to save user session in a hashmap on every cluster. and when i need to invalidate it, i will take specified session id. and invalidate it where the session created with normal way to invalidate session.
    public class SessionListener implements HttpSessionListener {
    public HashMap<String, HttpSession> sessionHolder = new HashMap<String, HttpSession>();
    @Override
    public void sessionCreated(HttpSessionEvent se) {
    sessionHolder.put(se.getSession().getId(), se.getSession());
    public void invalidate(String sessionId){
    if(this.sessionHolder.get(sessionId)!= null){
    System.out.println("Invalidate session ID : " + sessionId);
    HttpSession session = sessionHolder.get(sessionId);
    session.invalidate();
    } else {
    System.out.println("Session is not created in this cluster ID : " + sessionId);
    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
    System.out.println("Session " + se.getSession().getId() + " has been destoryed");
    sessionHolder.remove(se.getSession().getId());
    session will perish where invalidate occur. but on other cluster session is still avaliable.
    why the session on other cluster is still. and how to also invalidate session on other cluster.
    thanks.
    Edited by: jeggy on Jan 20, 2011 8:47 PM

    Can you provide little bit more information on how many servers, clusters you have and what kind of replication etc?

  • Invalidate session in another context

    Hi everyone,
    In a nutshell, how to invalidate session of another context residing in another server?
    If it is not possible, what is the best approach to achieve something similar to that?
    Thanks for reading this.
    Z

    u can as well use the MBean interface implementations for Tomcat (JBoss)
    and call some public method of a MBean under name "jboss.web:type=Manager,path=/,host=localhost,*" - like 'expireSession' passing the sessionId string as param
    Rafal Baton Zaczynski
    http://baton.pop.e-wro.pl - Java/JSF/JavaScript - tips&tuts

  • Reload Page + Invalidate Session

    (ADF 11gR1 ADFBC) I have an ADF application which can be run with different contexts.
    Every user has a “last_selected_context” stored in the database.
    When launching the application, I fetch this “last selected context” and in the “beforePhase” of the “PagePhaseListener”, I set all my session variables for this context.
    Users may swap from a context to another by selecting it from a popup.
    My problem is : when a user select another context, I have to invalidate the session and reload the page.
    I did this in a function “reloadThePage()”
        public static void reloadThePage()
          FacesContext fContext = FacesContext.getCurrentInstance();
          String viewId = fContext.getViewRoot().getViewId();
          String actionUrl = fContext.getApplication().getViewHandler().getActionURL(fContext, viewId);
          try
            ExternalContext eContext = fContext.getExternalContext();
            String resourceUrl = actionUrl;
           // Invalidate Session
           HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
            if (session != null) {
                session.invalidate();
            eContext.redirect(resourceUrl);
          catch (IOException ioe)
            System.err.println("Problem trying to reload the page:");
            ioe.printStackTrace();
        }It is working fine, but I have this Warning message every time a change the context: Because of inactivity, your session has timed out and is no longer active.  Click OK to reload the page+.
    Is there a way to avoid this Warning message?
    Thanks & Regards
    Nicolas

    Hi Timo,
    Thanks for your help.
    I've tried this but I still have the same warning message.
        public static void reloadThePage()
          FacesContext fContext = FacesContext.getCurrentInstance();
          try
            ExternalContext eContext = fContext.getExternalContext();
            String resourceUrl = "/hr2/faces/home"; 
            // Invalidate Session
            HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
            if (session != null) {
                session.invalidate();
            eContext.redirect(resourceUrl);
          catch (IOException ioe)
            System.err.println("Problem trying to reload the page:");
            ioe.printStackTrace();
        }Any other suggestion ?
    Thanks & Regards
    Nicolas

  • [svn] 1502: Bug: BLZ-148 - Repeat invocation of invalidate() on HttpFlexSession throws java.lang.IllegalStateException: invalidate: Session already invalidated

    Revision: 1502
    Author: [email protected]
    Date: 2008-04-30 16:36:53 -0700 (Wed, 30 Apr 2008)
    Log Message:
    Bug: BLZ-148 - Repeat invocation of invalidate() on HttpFlexSession throws java.lang.IllegalStateException: invalidate: Session already invalidated
    QA: Yes
    Doc: No
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-148
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/HttpFlexSession.java

Maybe you are looking for