Unhandled Exception Type JRException

What would cause the about error in this line of code?JasperReport aReport = (JasperReport) JRLoader.loadObject("JRtest1.jasper");
[144 byte] By [SLDykea] at [2007-11-27 8:53:46]
# 1
That means you have an unhandled exception. The compiler is forcing you to either use try/catch block or throw the JRException.You should put your code in a try/catch block.
DarumAa at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...
# 2
I am very new at this web development and java so bare with me. The class that this code is calling is part of a canned JasperReports jar package. The code that I can view is not editable as I can see. What do I do?
SLDykea at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...
# 3
A light just came on!! You mean I need to put a try/catch routine in my code to handle the exception. I got up now. But what would I out in the try/catch lines of code?
SLDykea at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...
# 4

> I am very new at this web development and java so

> bare with me. The class that this code is calling is

> part of a canned JasperReports jar package. The code

> that I can view is not editable as I can see. What do

> I do?

Do you mean:

1) One of the Class in the jar package is throwing this exception?

or

2) When you try to use one of the Class in the jar file in your own code, your code throws this exception.

1) is not very plausible. Why are you trying to compile classes in a pre-packaged jar file? And if you are compiling them then I am sure you should be able to edit them as well.

2) is much more plausible. You just need to put try/catch block around your code. It will look like this:

try{

JasperReport aReport = (JasperReport) JRLoader.loadObject("JRtest1.jasper");

}catch(JRException jr){

System.out.println(jr.getMessage());

}

DarumAa at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...
# 5
Is it working now?
DarumAa at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...
# 6
Yes except - Can you look at post reguarding File Not Found Error?
SLDykea at 2007-7-12 21:11:48 > top of Java-index,Java Essentials,New To Java...