Re: Method Being called Twice
Re: Method Being called Twice
- Subject: Re: Method Being called Twice
- From: Owen McKerrow <email@hidden>
- Date: Thu, 17 Aug 2006 13:40:58 +1000
Well Im gonna hang my head in shame on this one.
I stuck a break point in session's awake method and its being invoked
twice for EVERY page !
So Im guess its a problem with my template component that all the
other pages sit inside of.
Stranger still is that I tested it under Safari 2.0.4 and Firefox
1.5.04. It only does the double call under Safari.
Ok Im off to track down what's doing it.
Any suggestions of things to look for ?
Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
"As of tomorrow, employees will only be able to access the building
using individual security cards. Pictures will be taken next
Wednesday employees will receive their cards in two weeks."
- "Dilbert Quotes" Winner, Fred Dales, Microsoft Corp
On 17/08/2006, at 1:28 PM, Chuck Hill wrote:
Now that is a good one...
Both are from invokeAction. Any custom component here? Calling
valueForBinding("action") can trip the action.
Have you verified that the app is only receiving a single request?
Does it do this in all browsers? I am just wondering if bad HTML
or something is making the app think it is getting two requests.
Other than that, no... nothing is coming to mind.
Chuck
On Aug 16, 2006, at 8:14 PM, Owen McKerrow wrote:
Hi All,
I'm having a problem with a method thats being called twice when
it should only be called once.
I have a form, with one submit button, whose action is bound to
the method typeSelectedGoToDetails(). Now I have done search
through the whole project and this method is only lised twice,
once inside the wod file as bound to the submit button and the
second time is its own declaration in the java file.
However upon clicking the submit button it is being called twice.
Listed below are the stack traces from each of the times it is
called, and a copy of the code itself.
Can anyone see what dumb thing i am doing this time ? Or explain
why the method is being called twice.
Thanks
Owen
Code :
/**
Check that the required info has been given, if so check if the
publication title is simialr to any found in the DB.
*/
public WOComponent typeSelectedGoToDetails() throws Exception
{
WOComponent nextPage = null;
int i;
boolean rightToGo = true;
if ( newTitle != null ) { //THE BREAK POINT IS ON THIS LINE
if (!newTitle.trim().equals("") ) {
if ( thePublication.publicationType() == null) {
setMessage("Please select a valid Publication Type.");
} else {
//Check if there is more than 1 author
if ( thePublication.publicationType().hasAuthors().intValue()
== 1 && numNewAuthors < 1 ) {
rightToGo = false;
setMessage("There must be at least 1 Author.");
}
if ( thePublication.publicationType().hasEditors().intValue()
== 1 && numNewEditors < 1 ) {
rightToGo = false;
setMessage("There must be at least 1 Editor.");
}
//Check if they need editors and if so that there is more than 1
if ( rightToGo ) {
setMessage("");
//*** FIX ME *** Need to update so only asks for pubs who's
status is not = to new.
similarPublications = (NSArray)searchForSimilarItems(newTitle);
}
}
} else {
setMessage("You must enter a title for the Publication.");
}
} else {
setMessage("You must enter a title for the Publication.");
}
if ( !similarPublicationsFound && rightToGo ) {
//No similar items found, just go stright to the details.
setupNewPublication();
PublicationDetails newPage = (PublicationDetails) pageWithName
("PublicationDetails");
newPage.setEc(getEc());
newPage.setThePublication(thePublication);
newPage.setUp();
newPage.setAddingNew(true);
newPage.setValideState(false);
nextPage = newPage;
mySession().replaceLastCookie("PublicationDetails","Publication
Details",newPage.pagesState(),true);
} else {
nextPage = context().page();
}
return nextPage;
}
First Time :
#0 0x00000004 in addPublication.typeSelectedGoToDetails() at
addPublication.java:131
#1 sun.reflect.NativeMethodAccessorImpl.invoke0()
#2 0x00000057 in sun.reflect.NativeMethodAccessorImpl.invoke() at
NativeMethodAccessorImpl.java:39
#3 0x00000006 in sun.reflect.DelegatingMethodAccessorImpl.invoke()
at DelegatingMethodAccessorImpl.java:25
#4 0x0000006f in java.lang.reflect.Method.invoke() at Method.java:324
#5 0x00000003 in KeyValueCodingProtectedAccessor.methodValue() at
KeyValueCodingProtectedAccessor.java:54
#6 0x00000009 in com.webobjects.foundation.NSKeyValueCoding
$_MethodBinding.valueInObject() at NSKeyValueCoding.java:1160
#7 0x00000022 in com.webobjects.foundation.NSKeyValueCoding
$DefaultImplementation.valueForKey() at NSKeyValueCoding.java:1268
#8 0x00000002 in com.webobjects.appserver.WOComponent.valueForKey
() at WOComponent.java:1539
#9 0x0000001a in com.webobjects.foundation.NSKeyValueCoding
$Utility.valueForKey() at NSKeyValueCoding.java:498
#10 0x00000013 in
com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath() at
NSKeyValueCodingAdditions.java:212
#11 0x00000002 in
com.webobjects.appserver.WOComponent.valueForKeyPath() at
WOComponent.java:1600
#12 0x00000013 in
com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompon
ent() at WOKeyValueAssociation.java:46
#13 0x00000064 in
com.webobjects.appserver._private.WOSubmitButton.invokeAction() at
WOSubmitButton.java:70
#14 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#15 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#16 0x00000027 in
com.webobjects.appserver._private.WOForm.invokeAction() at
WOForm.java:82
#17 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#18 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#19 0x0000003a in
com.webobjects.appserver._private.WOConditional.invokeAction() at
WOConditional.java:55
#20 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#21 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#22 0x0000003a in
com.webobjects.appserver._private.WOConditional.invokeAction() at
WOConditional.java:55
#23 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#24 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#25 0x00000029 in
com.webobjects.appserver._private.WOComponentContent.invokeAction
() at WOComponentContent.java:31
#26 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#27 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#28 0x00000072 in
com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction
() at WOHTMLURLValuedElement.java:115
#29 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#30 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#31 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction
() at WOComponent.java:945
#32 0x0000000b in
com.webobjects.appserver._private.WOComponentReference.invokeAction
() at WOComponentReference.java:104
#33 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#34 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#35 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction
() at WOComponent.java:945
#36 0x00000014 in com.webobjects.appserver.WOSession.invokeAction
() at WOSession.java:1168
#37 0x0000000f in
com.webobjects.appserver.WOApplication.invokeAction() at
WOApplication.java:1375
#38 0x00000062 in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedPage() at WOComponentRequestHandler.java:196
#39 0x000000ba in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedSession() at WOComponentRequestHandler.java:287
#40 0x00000054 in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedApplication() at WOComponentRequestHandler.java:322
#41 0x0000006d in
com.webobjects.appserver._private.WOComponentRequestHandler._handleRe
quest() at WOComponentRequestHandler.java:358
#42 0x00000017 in
com.webobjects.appserver._private.WOComponentRequestHandler.handleReq
uest() at WOComponentRequestHandler.java:432
#43 0x00000029 in
com.webobjects.appserver.WOApplication.dispatchRequest() at
WOApplication.java:1306
#44 0x00000027 in Application.dispatchRequest() at
Application.java:303
#45 0x000002d9 in
com.webobjects.appserver._private.WOWorkerThread.runOnce() at
WOWorkerThread.java:173
#46 0x00000081 in
com.webobjects.appserver._private.WOWorkerThread.run() at
WOWorkerThread.java:254
#47 0x0000000b in java.lang.Thread.run() at Thread.java:552
2nd Time :
#0 0x00000004 in addPublication.typeSelectedGoToDetails() at
addPublication.java:131
#1 sun.reflect.NativeMethodAccessorImpl.invoke0()
#2 0x00000057 in sun.reflect.NativeMethodAccessorImpl.invoke() at
NativeMethodAccessorImpl.java:39
#3 0x00000006 in sun.reflect.DelegatingMethodAccessorImpl.invoke()
at DelegatingMethodAccessorImpl.java:25
#4 0x0000006f in java.lang.reflect.Method.invoke() at Method.java:324
#5 0x00000003 in KeyValueCodingProtectedAccessor.methodValue() at
KeyValueCodingProtectedAccessor.java:54
#6 0x00000009 in com.webobjects.foundation.NSKeyValueCoding
$_MethodBinding.valueInObject() at NSKeyValueCoding.java:1160
#7 0x00000022 in com.webobjects.foundation.NSKeyValueCoding
$DefaultImplementation.valueForKey() at NSKeyValueCoding.java:1268
#8 0x00000002 in com.webobjects.appserver.WOComponent.valueForKey
() at WOComponent.java:1539
#9 0x0000001a in com.webobjects.foundation.NSKeyValueCoding
$Utility.valueForKey() at NSKeyValueCoding.java:498
#10 0x00000013 in
com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath() at
NSKeyValueCodingAdditions.java:212
#11 0x00000002 in
com.webobjects.appserver.WOComponent.valueForKeyPath() at
WOComponent.java:1600
#12 0x00000013 in
com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompon
ent() at WOKeyValueAssociation.java:46
#13 0x00000064 in
com.webobjects.appserver._private.WOSubmitButton.invokeAction() at
WOSubmitButton.java:70
#14 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#15 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#16 0x00000027 in
com.webobjects.appserver._private.WOForm.invokeAction() at
WOForm.java:82
#17 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#18 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#19 0x0000003a in
com.webobjects.appserver._private.WOConditional.invokeAction() at
WOConditional.java:55
#20 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#21 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#22 0x0000003a in
com.webobjects.appserver._private.WOConditional.invokeAction() at
WOConditional.java:55
#23 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#24 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#25 0x00000029 in
com.webobjects.appserver._private.WOComponentContent.invokeAction
() at WOComponentContent.java:31
#26 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#27 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#28 0x00000072 in
com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction
() at WOHTMLURLValuedElement.java:115
#29 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#30 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#31 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction
() at WOComponent.java:945
#32 0x0000000b in
com.webobjects.appserver._private.WOComponentReference.invokeAction
() at WOComponentReference.java:104
#33 0x00000036 in
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
() at WODynamicGroup.java:101
#34 0x00000003 in
com.webobjects.appserver._private.WODynamicGroup.invokeAction() at
WODynamicGroup.java:110
#35 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction
() at WOComponent.java:945
#36 0x00000014 in com.webobjects.appserver.WOSession.invokeAction
() at WOSession.java:1168
#37 0x0000000f in
com.webobjects.appserver.WOApplication.invokeAction() at
WOApplication.java:1375
#38 0x00000062 in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedPage() at WOComponentRequestHandler.java:196
#39 0x000000ba in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedSession() at WOComponentRequestHandler.java:287
#40 0x00000054 in
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
WithPreparedApplication() at WOComponentRequestHandler.java:322
#41 0x0000006d in
com.webobjects.appserver._private.WOComponentRequestHandler._handleRe
quest() at WOComponentRequestHandler.java:358
#42 0x00000017 in
com.webobjects.appserver._private.WOComponentRequestHandler.handleReq
uest() at WOComponentRequestHandler.java:432
#43 0x00000029 in
com.webobjects.appserver.WOApplication.dispatchRequest() at
WOApplication.java:1306
#44 0x00000027 in Application.dispatchRequest() at
Application.java:303
#45 0x000002d9 in
com.webobjects.appserver._private.WOWorkerThread.runOnce() at
WOWorkerThread.java:173
#46 0x00000081 in
com.webobjects.appserver._private.WOWorkerThread.run() at
WOWorkerThread.java:254
#47 0x0000000b in java.lang.Thread.run() at Thread.java:552
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
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/products/
practical_webobjects
_______________________________________________
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