Jump to content

Jasper Report cannot print from Applet


manz_jasper

Recommended Posts

Hi,

 

I'm new comer in jasper report, its nice.

 

I success for deploying the example to my tomcat 6.0 server and explore it, but, unfortunately, when i trying using applet (from sample) to print-out to the printer it has message :

 

Error printing report. See the console for details.

 

Can anyone resolve this?

 

Thank you. size=347]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/errorapplet.JPG

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Continue to first problem.

 

And also when print it out from http://localhost:8080/jasper-webapp/printer.html

 

And click the print the report button, its same, has an error :

---------------

java.security.AccessControlException: access denied

(java.lang.RuntimePermission accessClassInPackage.sun.awt.windows)

---------------

I attach the image, but maybe you can't see the full error.

 

after we surf, we found the solution to put the

permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.windows";

 

grant codeBase "http://localhost:8080/jasper-webapp/applets/*" {

permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.windows";

};

 

in catalina.policy because we use the tomcat 6.x, but still no effect and didn't resolve this problem.

 

Anyone can help ?

size=400]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/errorapplet3_copy.jpg

Post edited by: manz_jasper, at: 2007/01/10 07:04

Link to comment
Share on other sites

Thanks for respond.

 

This full error displayed when i use tomcat standard server configuration.

 

java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt.windows)

at java.security.AccessControlContext.checkPermission(Unknown Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPackageAccess(Unknown Source)

at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)

at java.lang.Class.checkMemberAccess(Unknown Source)

at java.lang.Class.getMethod(Unknown Source)

at net.sf.jasperreports.engine.print.JRPrinterAWT.initPrinterJobFields(JRPrinterAWT.java:273)

at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:140)

at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:88)

at net.sf.jasperreports.engine.JasperPrintManager.printPages(JasperPrintManager.java:348)

at net.sf.jasperreports.engine.JasperPrintManager.printReport(JasperPrintManager.java:239)

at PrinterApplet$3.run(PrinterApplet.java:185)

at java.lang.Thread.run(Unknown Source)

 

But, after im add the

permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.windows";

 

 

 

grant codeBase "http://localhost:8080/jasper-webapp/applets/*" {

 

permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.windows";

 

};

 

in catalina.policy and restart with :

1. catalina start

the error displayed same result.

 

2. catalina start -security

 

its display error :

 

net.sf.jasperreports.engine.JRException: Error loading object from URL: http://localhost:8080/jasper-webapp/servlets/jasperprint

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

at EmbeddedViewerApplet.init(EmbeddedViewerApplet.java:70)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.StreamCorruptedException: invalid stream header

at java.io.ObjectInputStream.readStreamHeader(Unknown Source)

at java.io.ObjectInputStream.<init>(Unknown Source)

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

... 3 more

Post edited by: manz_jasper, at: 2007/01/11 05:50

Link to comment
Share on other sites

Sorry anandharaj,

when we staying in forum and watching some people respond including you, we trying every clue to resolve this problem.

 

Fortunately, change setting in java.policy or catalina.policy to add the grant codeBase and setting runtime permission and also restart the tomcat server, that make me success to resolve this problem.

 

Anyway, thanks.

Link to comment
Share on other sites

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...