Child pages
  • Java Client - Get Server-Side Stack Trace

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

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:

Code Block
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:

Code Block
// 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:

Code Block
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