[ Team LiB ] Previous Section Next Section

Q&A

Q1:

Why are exceptions getting by my catch block even when I'm catching Exception?

A1:

In some fairly rare cases, you might be getting an error instead of an exception. The Error and Exception classes are both subclasses of Throwable. If you catch Throwable, you will definitely catch any possible exception or error.

Q2:

Where are my log messages going?

A2:

The location of the servlet and JSP log files is implementation-dependent. You should consult the document for the JSP/servlet engine.

Q3:

Where are my System.out and System.err messages going?

A3:

Like the log files, the location for System.out and System.err messages is implementation-dependent. You should consult the documentation for your servlet engine.

Q4:

Why don't my messages show up in the log file?

A4:

Although there are rare cases where the JSP/servlet engine delays writing output messages, most of the time you don't see the messages because you aren't really writing them. Exceptions are usually the root cause of these problems. You might want to try catching Exception to make sure there aren't unexpected exceptions, and in some cases you might even want to catch Throwable.

Q5:

Why doesn't the jre command recognize the -debug option?

A5:

You must use the java command for debugging. The jre command is intended as a production-level VM and doesn't include some of the extra baggage of the java command. Recent versions of Java don't even include the jre command anymore.


    [ Team LiB ] Previous Section Next Section