Re: Direct Actions Question
Re: Direct Actions Question
- Subject: Re: Direct Actions Question
- From: "Jerry W. Walker" <email@hidden>
- Date: Wed, 7 Mar 2007 23:08:13 -0500
Hi, Fred & Chuck,
On Mar 7, 2007, at 6:13 PM, Chuck Hill wrote:
On Mar 7, 2007, at 1:23 PM, Fred Shurtleff wrote:
Chuck,
Thanks so much for opening my eyes for me. You are so correct in
saying-
"It is important to actually read the _entire_ error message and
not jump to conclusions based on a few words in the first line."
I think this is a common trap, since 1 error always triggers many
downstream errors which in my case I overlooked.
Yes, many people seem to stop reading those exceptions messages too
soon. You learned a valuable lesson today.
Even after focusing me on the WOImageButton problem, I had a
difficult time finding WHERE this problem lied, because the main
page did not have any such element. Turns out the home page was a
partial component wrapped in a Template container having a
Navigation form bar/component with a WOImageButton element - and
this was lacking an actionClass/directActionName binding.
Yeah, _finding_ the cause of errors like this can be a huge pain.
Yes, but it's made a great deal easier by WOBuilder if you choose the
Window->Validation... menu item on each WOComponent before saving it
(or after saving it, for that matter).
I think that even Eclipse would have isolated this error for you, but
I'm not a heavy Eclipse user, so I'm projecting from one tutorial.
Regards,
Jerry
Chuck
On Mar 7, 2007, at 9:17 AM, Fred Shurtleff wrote:
Hello,
I have ported an PBProj/Xcode application over to Eclipse. This
application has been coded to use Direct Actions; however when I
run this application it fails because it cannot resolve a
default 'action class'.
No, you're wrong. You are mis-reading the error message. See
below.
Following are the details.
Application.java sets direct actions as default:
WORequestHandler directActionRequestHandler =
requestHandlerForKey("wa");
setDefaultRequestHandler(directActionRequestHandler);
DirectAction.java specifies the default action:
public WOActionResults defaultAction() {
return pageWithName("Main");
When I run the app, an ErrorPage is displayed(NOT Main page),
and the Console displays the following error:
<com.webobjects.appserver._private.WODirectActionRequestHandler>: E
xception while handling action named "default" on action class
"null"
That means it found and ran the requested action.
:com.webobjects.foundation.NSForwardException
[com.webobjects.appserver._private.WODynamicElementCreationExceptio
n] null
The real problem is a WODynamicElementCreationException
[2007-03-06 10:11:03 EST] <WorkerThread0>
com.webobjects.foundation.NSForwardException for
com.webobjects.appserver._private.WODynamicElementCreationException
:
<com.webobjects.appserver._private.WOImageButton> 'Either a
component action or a direct action must be specified.'
Somewhere in Main.wod you have a WOImageButton. It has neither
the action or directAction binding set on it.
This error completely puzzles me because my understanding is
that the 'defaultAction' method of 'DirectAction' class is
called by the WebObjects framework when you first connect to the
application. And this class is definitely present in the
application, so I cannot understand why it is reporting an
"action class "null", or in other words, is not recognizing the
(bootstrap)DirectAction class.
It is important to actually read the _entire_ error message and
not jump to conclusions based on a few words in the first line.
If read (and thought about), the error messages are usually quite
informative.
Chuck
--
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
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
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