Dashboard > WebObjects > ... > Java Client > Java Client - Get Server-Side Stack Trace
  WebObjects Log In View a printable version of the current page.  
  Java Client - Get Server-Side Stack Trace
Added by David Avendasora, last edited by David Avendasora on Jan 16, 2008  (view change)
Labels: 
(None)

When you use the invokeRemoteMethod() method on a client-side EO and an error is generated on the server, you will normally only get a client-side stack-trace such as:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Server exception: null
	at com.webobjects.eodistribution.client.EODistributedObjectStore._checkReturnValuesForExceptions(EODistributedObjectStore.java:569)
	at com.webobjects.eodistribution.client.EODistributedObjectStore._send(EODistributedObjectStore.java:597)
	at com.webobjects.eodistribution.client.EODistributedObjectStore.invokeRemoteMethod(EODistributedObjectStore.java:968)
	at com.webobjects.eodistribution.client.EODistributedObjectStore.invokeRemoteMethod(EODistributedObjectStore.java:923)
	at com.webobjects.eocontrol.EOEditingContext.invokeRemoteMethod(EOEditingContext.java:5126)
        <snip>

Add the following:

// Enable stack trace logging in the event of a sever-side exception
NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupIO);

// Enable stack trace logging for the EnterpriseObjects group
NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupEnterpriseObjects);

to your Application class's main(String argv[]) method prior to:

WOApplication.main(argv, Application.class);

This will send the server-side stack trace to the Run Log of your application as well as still having the Client-Side stack trace in the console of the client.

thanks to Pierre Bernard

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators