Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error handling for sync invocations in Java
01-12-2011, 11:53 AM
Post: #13
RE: Error handling for sync invocations in Java
(01-12-2011 10:37 AM)simonc Wrote:  Stack traces will already be printed to console for any unhandled exception (including assertion failures) in threads created by ohNet. I'm guessing that your exception occurs in your main app thread so isn't caught by ohNet code.

The solution to this would be to expose ohNet's unhandled exception handler to client code. I'll try to do this in the next couple of weeks. You'd then need to catch all exceptions in your app thread(s) and call the new ohNet function. This function would attempt to print a call stack then abort the process.

I'd be very surprised if this failure were in my main app thread, as this thread is just sitting idle when my application has completed its startup. I'll install Visual Studio on the test server to find out which thread is running at the time of the abort.

When you say that I would need to catch exceptions in my app thread(s), are you referring to Java exceptions or C++ exceptions? There's no problem if it's Java exceptions. If it's C++ exceptions, the ohNet JNI code would need to catch these and rethrow them as Java exceptions so that I could catch them in my app.
Find all posts by this user


Messages In This Thread
RE: Error handling for sync invocations in Java - simoncn - 01-12-2011 11:53 AM

Forum Jump: