\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
Le 9 déc. 2013 à 10:20, Raymond NANEON < email@hidden> 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
Le 6 déc. 2013 à 19:21, Samuel Pelletier < email@hidden> 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 < email@hidden> 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.<init>(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(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java:218)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction(WOHTMLURLValuedElement.java:149)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745)
at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:119)
at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1988)
at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedPage(ERXComponentRequestHandler.java:157)
at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedSession(ERXComponentRequestHandler.java:235)
at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedApplication(ERXComponentRequestHandler.java:268)
at er.extensions.appserver.ERXComponentRequestHandler._handleRequest(ERXComponentRequestHandler.java:302)
at er.extensions.appserver.ERXComponentRequestHandler.handleRequest(ERXComponentRequestHandler.java:375)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2109)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2074)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:695)
Thanks for help
Envoyé depuis iCloud
Le 5 déc. 2013 à 21:44, Samuel Pelletier < email@hidden> a écrit :
Hi,
I suggest you put some code and a stack trace, maybe the action method. With the information you provided, it is impossible to help, we only know you have a problem with Session.
Samuel
Le 2013-12-05 à 04:01, Raymond NANEON < email@hidden> a écrit :
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ( email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to
email@hidden
|