Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi Quinton,The problem is I don't return anything like in your example. I return a simple component.Here is my DirectAction method :public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } }ThanksEnvoyé depuis iCloudLe 11 déc. 2013 à 22:59, Quinton Dolan a écrit :If you do something like 'return new DirectActionClass(request()).someAction();’ in your direct action method it can cause this.On 6 Dec 2013, at 3:59 pm, Chuck Hillwrote:Try logging out a stack trace in Application.restoreSessionWithID(). You must be doing something, this is not an easy error to produce.-- Chuck Hill Executive Managing Partner, VP Development and Technical ServicesPractical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjectsGlobal Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!On 2013-12-05 1:01 AM, "Raymond NANEON" wrote:Hi List, I get this Exception "java.lang.IllegalStateException : Trying to check out a session twice in one RR loop " after using a specific method in my DirectAction, then close the page and go to my apps home. I don't understand what going on. Thanks for your helpEnvoyé depuis iCloud___Do not post admin requests to the list. They will be ignored.Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)Help/Unsubscribe/Update your Subscription:https://lists.apple.com/mailman/options/webobjects-dev/qdolan%40gmail.comThis email sent to qdo...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
If you do something like 'return new DirectActionClass(request()).someAction();’ in your direct action method it can cause this. On 6 Dec 2013, at 3:59 pm, Chuck Hill wrote: > Try logging out a stack trace in Application.restoreSessionWithID(). You > must be doing something, this is not an easy error to produce. > > > -- > Chuck Hill > Executive Managing Partner, VP Development and Technical Services > > Practical WebObjects - for developers who want to increase their overall > knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/gvc/practical_webobjects > > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing > Companies in B.C! > > Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of > Canada’s Fastest-Growing Companies by PROFIT Magazine! > > On 2013-12-05 1:01 AM, "Raymond NANEON" wrote: > > Hi List, > > I get this Exception "java.lang.IllegalStateException : Trying to check out a > session twice in one RR loop " after using a specific method in my > DirectAction, then close the page and go to my apps home. > > I don't understand what going on. > > Thanks for your help > Envoyé depuis iCloud > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/qdolan%40gmail.com > > This email sent to qdo...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
I second Chuck. You are trying to hide or run around another problem. The session() method should succeed, if it raise, fix the real problem instead of trying to hide it. Samuel Le 2013-12-09 à 10:29, Chuck Hill a écrit : > > On 2013-12-09 1:20 AM, "Raymond NANEON" wrote: > > Hi Samuel, > > I surrounded the mySession() by "try - catch" because the Exception appear > when sess = (Session) session(), so I catch the Exception and create a new > session. > The problem is not in creating new session but in checking old session. > > I initialized mySession with session which come from my DirectAction but I > get the same Exception : Trying to check out a session twice in one RR loop. > > I go to override restoreSessionWithID method and not throwing an Exception, > to see what will happens. > > That is a very bad idea. You are doing something very wrong somewhere in > your app that is causing this error. > > > Chuck > > > Envoyé depuis iCloud > > Le 6 déc. 2013 à 19:21, Samuel Pelletier a écrit : > >> Hi Raymond, >> >> I think the problem come from the "mySession()" method. You are not supposed >> to create session with new Session(). Why not use the session() method in >> the DirecAction base class? >> >> If the regular session() method throw, there is a problem somewhere else. >> >> Samuel >> >> Le 2013-12-06 à 03:30, Raymond NANEON a écrit : >> >>> Hi Samuel and Chuck, >>> >>> Here is how the exception is occured. >>> When I use the directAction link generated by my apps to access to a >>> specific page all is fine. >>> >>> Example of my DA : >>> >>> public WOActionResults visaProjectAction() { >>> directVisa = true; >>> WOActionResults nextPage = null; >>> String login = ""; >>> String password = ""; >>> NSDictionary actionParams = getParamsFromRequest(request(), null); >>> String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); >>> String directVisa = (String) actionParams.valueForKey(DIRECTVISA); >>> NSMutableDictionary params = new NSMutableDictionary(); >>> if (!MyStringCtrl.isEmpty(projetId)) { >>> params.put(PROJET_ID_KEY, new Integer(projetId)); >>> } >>> if (!MyStringCtrl.isEmpty(directVisa)) { >>> if (directVisa.equals("O") || directVisa.equals("OUI")) { >>> params.put(DIRECTVISA, new Boolean(true)); >>> params.put(DIRECTVALIDATE, new Boolean(false)); >>> } >>> } >>> laSession().setActionParams(params.immutableClone()); >>> if (useCasService()) { >>> return loginCASPage(); >>> } else { >>> nextPage = pageWithName(DAVisaMain.class.getName()); >>> return nextPage; >>> } >>> } >>> >>> And then When I go to my apps Home, I get the Exception : >>> >>> Example myHome method : >>> >>> public WOActionResults myHome() { >>> mySession().resetAll(); >>> ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class >>> .getName()); >>> //mySession().reset(); >>> redirect.setComponent(mySession().myHome()); >>> return redirect; >>> } >>> >>> public Session mySession() { >>> if (sess == null) { >>> try { >>> sess = (Session) session(); >>> } catch (Exception e) { >>> sess = new Session(); >>> e.printStackTrace(); >>> } >>> } >>> return sess; >>> } >>> The Exception occur when to go my apps Home, my apps re-call the session >>> before display homePage. >>> Important : My app use Wrapper. >>> Before using DirectAction to access to my app I never had this kind of >>> exception. >>> >>> Exception : >>> java.lang.IllegalStateException: Trying to check out a session twice in one >>> RR loop: tjRpYltVknbeqG0Eimzt1M >>> at >>> er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) >>> at com.webobjects.appserver.WOContext.session(WOContext.java:364) >>> at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) >>> at >>> utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) >>> at >>> utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) >>> 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 >>> com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) >>> at >>> com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDe
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi Chuck,anySession() is a method which come from ERXSession classpublic static WOSession anySession() { return (WOSession) ERXThreadStorage.valueForKey("session"); }ThanksEnvoyé depuis iCloudLe 9 déc. 2013 à 16:31, Chuck Hill a écrit :\On 2013-12-09 2:37 AM, "Raymond NANEON" wrote:Hi, I always have the Exception, so I rewrote mySession() method. After catching Exception, I don't create a new session but use the same like this : public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = (Session) Session.anySession();What is anySession()? sess.awake(); e.printStackTrace(); } } return sess; } If I comment the argument "e.printStackTrace()", the Exception is transparent. Time to resolved the issue What do you think? ThanksEnvoyé depuis iCloud Le 9 déc. 2013 à 10:20, Raymond NANEONa écrit : Hi Samuel, I surrounded the mySession() by "try - catch" because the Exception appear when sess = (Session) session(), so I catch the Exception and create a new session. The problem is not in creating new session but in checking old session. I initialized mySession with session which come from my DirectAction but I get the same Exception : Trying to check out a session twice in one RR loop. I go to override restoreSessionWithID method and not throwing an Exception, to see what will happens. ThanksEnvoyé depuis iCloud Le 6 déc. 2013 à 19:21, Samuel Pelletier a écrit : Hi Raymond,I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class?If the regular session() method throw, there is a problem somewhere else.SamuelLe 2013-12-06 à 03:30, Raymond NANEON a écrit :Hi Samuel and Chuck, Here is how the exception is occured. When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA : public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } } And then When I go to my apps Home, I get the Exception : Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; } public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; } The Exception occur when to go my apps Home, my apps re-call the session before display homePage. Important : My app use Wrapper. Before using DirectAction to access to my app I never had this kind of exception. Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
\On 2013-12-09 2:37 AM, "Raymond NANEON" wrote: Hi, I always have the Exception, so I rewrote mySession() method. After catching Exception, I don't create a new session but use the same like this : public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = (Session) Session.anySession(); What is anySession()? sess.awake(); e.printStackTrace(); } } return sess; } If I comment the argument "e.printStackTrace()", the Exception is transparent. Time to resolved the issue What do you think? Thanks Envoyé depuis iCloud Le 9 déc. 2013 à 10:20, Raymond NANEON mailto:rnan...@me.com>> a écrit : Hi Samuel, I surrounded the mySession() by "try - catch" because the Exception appear when sess = (Session) session(), so I catch the Exception and create a new session. The problem is not in creating new session but in checking old session. I initialized mySession with session which come from my DirectAction but I get the same Exception : Trying to check out a session twice in one RR loop. I go to override restoreSessionWithID method and not throwing an Exception, to see what will happens. Thanks Envoyé depuis iCloud Le 6 déc. 2013 à 19:21, Samuel Pelletier mailto:sam...@samkar.com>> a écrit : Hi Raymond, I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class? If the regular session() method throw, there is a problem somewhere else. Samuel Le 2013-12-06 à 03:30, Raymond NANEON mailto:rnan...@me.com>> a écrit : Hi Samuel and Chuck, Here is how the exception is occured. When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA : public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } } And then When I go to my apps Home, I get the Exception : Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; } public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; } The Exception occur when to go my apps Home, my apps re-call the session before display homePage. Important : My app use Wrapper. Before using DirectAction to access to my app I never had this kind of exception. Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOC
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
On 2013-12-09 1:20 AM, "Raymond NANEON" wrote: Hi Samuel, I surrounded the mySession() by "try - catch" because the Exception appear when sess = (Session) session(), so I catch the Exception and create a new session. The problem is not in creating new session but in checking old session. I initialized mySession with session which come from my DirectAction but I get the same Exception : Trying to check out a session twice in one RR loop. I go to override restoreSessionWithID method and not throwing an Exception, to see what will happens. That is a very bad idea. You are doing something very wrong somewhere in your app that is causing this error. Chuck Envoyé depuis iCloud Le 6 déc. 2013 à 19:21, Samuel Pelletier mailto:sam...@samkar.com>> a écrit : Hi Raymond, I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class? If the regular session() method throw, there is a problem somewhere else. Samuel Le 2013-12-06 à 03:30, Raymond NANEON mailto:rnan...@me.com>> a écrit : Hi Samuel and Chuck, Here is how the exception is occured. When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA : public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } } And then When I go to my apps Home, I get the Exception : Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; } public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; } The Exception occur when to go my apps Home, my apps re-call the session before display homePage. Important : My app use Wrapper. Before using DirectAction to access to my app I never had this kind of exception. Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544) at com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642) at com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332) at com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:1346) at utt.rec.projet.server.Session.myHome(Session.java:4265) at utt.rec.projet.server.components.EditNextProject.annuler(EditNextProject.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi, I always have the Exception, so I rewrote mySession() method. After catching Exception, I don't create a new session but use the same like this : public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = (Session) Session.anySession(); sess.awake(); e.printStackTrace(); } } return sess; }If I comment the argument "e.printStackTrace()", the Exception is transparent. Time to resolved the issueWhat do you think?ThanksEnvoyé depuis iCloudLe 9 déc. 2013 à 10:20, Raymond NANEON a écrit :Hi Samuel,I surrounded the mySession() by "try - catch" because the Exception appear when sess = (Session) session(), so I catch the Exception and create a new session.The problem is not in creating new session but in checking old session.I initialized mySession with session which come from my DirectAction but I get the same Exception : Trying to check out a session twice in one RR loop.I go to override restoreSessionWithID method and not throwing an Exception, to see what will happens.ThanksEnvoyé depuis iCloudLe 6 déc. 2013 à 19:21, Samuel Pelletier a écrit :Hi Raymond,I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class?If the regular session() method throw, there is a problem somewhere else.SamuelLe 2013-12-06 à 03:30, Raymond NANEONa écrit :Hi Samuel and Chuck,Here is how the exception is occured.When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA :public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } }And then When I go to my apps Home, I get the Exception :Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; }public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; }The Exception occur when to go my apps Home, my apps re-call the session before display homePage.Important : My app use Wrapper.Before using DirectAction to access to my app I never had this kind of exception.Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544) at com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642) at com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332) at com.webobjects.appserver.WOCom
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi Samuel,I surrounded the mySession() by "try - catch" because the Exception appear when sess = (Session) session(), so I catch the Exception and create a new session.The problem is not in creating new session but in checking old session.I initialized mySession with session which come from my DirectAction but I get the same Exception : Trying to check out a session twice in one RR loop.I go to override restoreSessionWithID method and not throwing an Exception, to see what will happens.ThanksEnvoyé depuis iCloudLe 6 déc. 2013 à 19:21, Samuel Pelletier a écrit :Hi Raymond,I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class?If the regular session() method throw, there is a problem somewhere else.SamuelLe 2013-12-06 à 03:30, Raymond NANEONa écrit :Hi Samuel and Chuck,Here is how the exception is occured.When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA :public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } }And then When I go to my apps Home, I get the Exception :Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; }public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; }The Exception occur when to go my apps Home, my apps re-call the session before display homePage.Important : My app use Wrapper.Before using DirectAction to access to my app I never had this kind of exception.Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544) at com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642) at com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332) at com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:1346) at utt.rec.projet.server.Session.myHome(Session.java:4265) at utt.rec.projet.server.components.EditNextProject.annuler(EditNextProject.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInOb
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi Raymond, I think the problem come from the "mySession()" method. You are not supposed to create session with new Session(). Why not use the session() method in the DirecAction base class? If the regular session() method throw, there is a problem somewhere else. Samuel Le 2013-12-06 à 03:30, Raymond NANEON a écrit : > Hi Samuel and Chuck, > > Here is how the exception is occured. > When I use the directAction link generated by my apps to access to a specific > page all is fine. > > Example of my DA : > > public WOActionResults visaProjectAction() { > directVisa = true; > WOActionResults nextPage = null; > String login = ""; > String password = ""; > NSDictionary actionParams = getParamsFromRequest(request(), null); > String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); > String directVisa = (String) actionParams.valueForKey(DIRECTVISA); > NSMutableDictionary params = new NSMutableDictionary(); > if (!MyStringCtrl.isEmpty(projetId)) { > params.put(PROJET_ID_KEY, new Integer(projetId)); > } > if (!MyStringCtrl.isEmpty(directVisa)) { > if (directVisa.equals("O") || directVisa.equals("OUI")) { > params.put(DIRECTVISA, new Boolean(true)); > params.put(DIRECTVALIDATE, new Boolean(false)); > } > } > laSession().setActionParams(params.immutableClone()); > if (useCasService()) { > return loginCASPage(); > } else { > nextPage = pageWithName(DAVisaMain.class.getName()); > return nextPage; > } > } > > And then When I go to my apps Home, I get the Exception : > > Example myHome method : > > public WOActionResults myHome() { > mySession().resetAll(); > ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class > .getName()); > //mySession().reset(); > redirect.setComponent(mySession().myHome()); > return redirect; > } > > public Session mySession() { > if (sess == null) { > try { > sess = (Session) session(); > } catch (Exception e) { > sess = new Session(); > e.printStackTrace(); > } > } > return sess; > } > The Exception occur when to go my apps Home, my apps re-call the session > before display homePage. > Important : My app use Wrapper. > Before using DirectAction to access to my app I never had this kind of > exception. > > Exception : > java.lang.IllegalStateException: Trying to check out a session twice in one > RR loop: tjRpYltVknbeqG0Eimzt1M > at > er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) > at com.webobjects.appserver.WOContext.session(WOContext.java:364) > at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) > at > utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) > at > utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) > 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 > com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) > at > com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544) > at > com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642) > at > com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332) > at > com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:1346) > at utt.rec.projet.server.Session.myHome(Session.java:4265) > at > utt.rec.projet.server.components.EditNextProject.annuler(EditNextProject.java:82) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) > at > com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) > at > com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) > at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) > at > com.webobjects.
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Hi Samuel and Chuck,Here is how the exception is occured.When I use the directAction link generated by my apps to access to a specific page all is fine. Example of my DA :public WOActionResults visaProjectAction() { directVisa = true; WOActionResults nextPage = null; String login = ""; String password = ""; NSDictionary actionParams = getParamsFromRequest(request(), null); String projetId = (String) actionParams.valueForKey(PROJET_ID_KEY); String directVisa = (String) actionParams.valueForKey(DIRECTVISA); NSMutableDictionary params = new NSMutableDictionary(); if (!MyStringCtrl.isEmpty(projetId)) { params.put(PROJET_ID_KEY, new Integer(projetId)); } if (!MyStringCtrl.isEmpty(directVisa)) { if (directVisa.equals("O") || directVisa.equals("OUI")) { params.put(DIRECTVISA, new Boolean(true)); params.put(DIRECTVALIDATE, new Boolean(false)); } } laSession().setActionParams(params.immutableClone()); if (useCasService()) { return loginCASPage(); } else { nextPage = pageWithName(DAVisaMain.class.getName()); return nextPage; } }And then When I go to my apps Home, I get the Exception :Example myHome method : public WOActionResults myHome() { mySession().resetAll(); ERXRedirect redirect = (ERXRedirect) pageWithName(ERXRedirect.class .getName()); //mySession().reset(); redirect.setComponent(mySession().myHome()); return redirect; }public Session mySession() { if (sess == null) { try { sess = (Session) session(); } catch (Exception e) { sess = new Session(); e.printStackTrace(); } } return sess; }The Exception occur when to go my apps Home, my apps re-call the session before display homePage.Important : My app use Wrapper.Before using DirectAction to access to my app I never had this kind of exception.Exception : java.lang.IllegalStateException: Trying to check out a session twice in one RR loop: tjRpYltVknbeqG0Eimzt1M at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2389) at com.webobjects.appserver.WOContext.session(WOContext.java:364) at com.webobjects.appserver.WOComponent.session(WOComponent.java:1324) at utt.rec.projet.server.components.MonComposant.mySession(MonComposant.java:117) at utt.rec.projet.server.components.EnseignantsChercheursView.(EnseignantsChercheursView.java:52) 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640) at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544) at com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642) at com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332) at com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:1346) at utt.rec.projet.server.Session.myHome(Session.java:4265) at utt.rec.projet.server.components.EditNextProject.annuler(EditNextProject.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804) at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50) at com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:98) at er.extensions.components._private.ERXHyperlink.invokeAction(ERXHyperlink.java:60) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynami
Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop
Try logging out a stack trace in Application.restoreSessionWithID(). You must be doing something, this is not an easy error to produce. -- Chuck Hill Executive Managing Partner, VP Development and Technical Services Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! On 2013-12-05 1:01 AM, "Raymond NANEON" wrote: Hi List, I get this Exception "java.lang.IllegalStateException : Trying to check out a session twice in one RR loop " after using a specific method in my DirectAction, then close the page and go to my apps home. I don't understand what going on. Thanks for your help Envoyé depuis iCloud ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com