Re: Application.dispatchRequest does not catch InvocationTargetException
Re: Application.dispatchRequest does not catch InvocationTargetException
- Subject: Re: Application.dispatchRequest does not catch InvocationTargetException
- From: Chuck Hill <email@hidden>
- Date: Thu, 26 May 2005 09:13:37 -0700
The WODirectActionRequestHandler handles that one. You can either
catch it in DirectAction.performActionNamed (in which case it will be a
NoSuchMethodException wrapping in an NSForwardException or (I think)
handle it in Application:
"public WOResponse handleActionRequestError(WORequest aRequest,
Exception exception,
String reason,
WORequestHandler aHandler,
String actionClassName,
String actionName,
Class actionClass,
WOAction actionInstance)
Invoked when an action handler throws an exception in handleRequest.
Action handlers are subclasses of the WOActionRequestHandler, and
include the WODirectActionRequestHandler."
Chuck
On May 26, 2005, at 8:57 AM, Kaj Hejer wrote:
Hi!
If I try to go
http://myserver.myhost.no/cgi-bin/WebObjects/myapp.woa/wa/justgarabage
I get the following in my log:
[2005-05-26 17:50:19 MEST] <WorkerThread2>
<com.webobjects.appserver._private.WODirectActionRequestHandler>:
Exception while handling action named "dsadf" on action class "null"
:java.lang.reflect.InvocationTargetException
[2005-05-26 17:50:19 MEST] <WorkerThread2>
java.lang.reflect.InvocationTargetException
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest
(WOActionRequestHandler.java:250)
at
com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(
WOActionRequestHandler.java:142)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.ja
va:1306)
at UIOApplication.dispatchRequest(UIOApplication.java:119)
at Application.dispatchRequest(Application.java:134)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread
.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.jav
a:254)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NoSuchMethodException: DirectAction.
justgarabageAction()
at
com.webobjects.appserver.WODirectAction.performActionNamed(WODirectActi
on.java:125)
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest
(WOActionRequestHandler.java:240)
... 7 more
even when I have the following method in my Application (or in
UIOApplication which is the superclass foor my Application):
public WOResponse dispatchRequest(WORequest request) {
try {
return super.dispatchRequest(request);
} catch (Exception e) {
System.err.println("dispatchRequest: " + e);
e.printStackTrace();
WOContext context = createContextForRequest(request);
return handleException(e, context);
}
}
From what I can understand it is thrown a InvocationTargetException
inside super.dispatchRequest(request) but this exception isn't catched
by my try/catch block.
Why?
TIA for any comments!
-Kaj :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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