Jump to content
Changes to the Jaspersoft community edition download ×

JRLoader: Error Loading Object from URL


2005 IR Help

Recommended Posts

By: KHollister - khollister

JRLoader: Error Loading Object from URL

2004-08-17 11:29

Hi,

 

I'm writing an applet, based on the PrinterApplet in the webapp sample.

 

When I'm calling JRLoader.loadObject(), I'm getting the following error:

 

net.sf.jasperreports.engine.JRException: Error loading from URL:file:/D:/Data/java/report.pdf

at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:186)

 

So, it's failing at this statement:

 

jasperPrint = (JasperPrint)JRLoader.loadObject(fileUrl);

 

fileUrl is the URL object that I've created from getCodeBase() and getParameter("REPORT_URL") -- just like in the original PrinterApplet.java.

 

I know I'm getting values back from the getCodeBase() and getParameter() calls -- hence the 'file:/D:/Data/java/report.pdf ' in the error.

 

Could anyone please tell me what I'm missing? Any help would be greatly appreciated.

 

Thank you,

 

Ken Hollister

 

 

 

 

By: Chuck Deal - cdeal

RE: JRLoader: Error Loading Object from URL

2004-08-17 11:47

well, according to your post, the filename that you are generating is for a PDF. The line of code that you pointed out as causing the error is expecting a *.jrprint file.

 

I would expect the pdf filename to be the OUTPUT file. The call that you are making appears to be looking for the input file.

 

 

 

 

By: KHollister - khollister

RE: JRLoader: Error Loading Object from URL

2004-08-17 13:10

Thanks for the explanation... apparently I've mistunderstood the purpose of the PrinterApplet sample.

 

As I already have a report in PDF format, I'll just use iText to open the file and print it.

 

Thanks again,

 

Ken Hollister

Link to comment
Share on other sites

  • 11 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...