Question

I wanted to get ideas from the SO community about this issue.

Here is the problem:

We have a user on the other side of the world launching our app through WebStart. The user, however, is complaining that her whole application freezes up and becomes unresponsive. Usually, the client is doing a lot of database queries to a distributed database.

Questions:

  1. If we ask her to do a CTRL-Break on her application, where would the JVM write the stack trace to?
  2. Would it be enough just to use JConsole?
  3. Would implementing JMX beans on the client be overkill? Would it actually help in troubleshooting issues in production?

Right now the users are running on JRE 1.5.0-b08, but we do plan on migrating to JRE 6 in a couple of months.

What do you think?

Was it helpful?

Solution

José, you can get a lot of information from the JVM in a number of ways.

The best might be to enable debugging in the remote JVM. You can set them using the j2se element in the descriptor XML, as shown here. Since you can set -Xdebug you have a good start; I've never tried to do remote debugging on a web start app, so it may be a little bit of an issue setting up the remote part.

You could also set some things up yourself by adding a separate thread to talk to you remotely and send debugging messages.

You could use a native java or log4j remote logger.

If it's hanging the way you describe, though, the odds are very high that what's happening is a network hangup of some sort. Can you put some tracing/debugging onto your end of the conversation?

OTHER TIPS

Instead of these debugging suggestions, why don't you install an exception handler for your threads? See java.lang.Thread.

void setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)

Here's the relevant javadoc: http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)

If you install that in your code, and once inside Swing's EDT, then just write some java code to e-mail it to yourself, save it on a server, show it to the user, etc.

You need to have the Java Console displayed (run javaws from the command line, and select this from the Preferences dialog), then hit "v"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top