Re: Catching Thrown Exceptions
On 02/21/2012 12:35 PM, Davej wrote:
On Feb 21, 12:36 am, Davej<galt...@hotmail.com> wrote:
[...]
Now here it complains that it could not compile a class -- but I told
it to "clean and build" the main project and this process ended
silently -- to me that means it compiled successfully and this is a
runtime error. This occurred INSIDE a try block.
"To you" is not an engineering evaluation, since obviously your knowledge is
insufficient.
Also, you have a *compilation* error, so how do you conclude that compilation
was successful? It obviously failed.
---------------------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
You never declared the variable.
org.apache.jasper.JasperException: Unable to compile class for JSP:
There you have it - *Unable to compile*.
You have a compilation error.
An error occurred at line: 59 in the jsp file: /CalcLoan.jsp
exception cannot be resolved to a variable
56: {
57: //throw new Exception(); //jump to the catch code
58: //rad = 0; //abort
59: throw exception;
60: }
61:
62: if ( rad == 1 )
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:
331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:
457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
You have to do little things like declare all variables in Java.
--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg