Jasper Fill in an Applet PROBLEM

By: Zeek - zeekage
Jasper Fill in an Applet PROBLEM
2004-10-19 07:16

I am trying to use jasper to render reports in an applet and I'm having a problem. I have used jasper in our application server to render reports and convert them to HTML to stream back to a client. However, for performance reasons I need to transfer the work of filling the report off the server and to the client, namely an applet. I have got this working up to the point where the applet needs to fill the report. The report filler calls the JRClassLoader.loadClassForName(String className) method. This gives me an AccessControlException saying the applet doesnt have permission to use the method Thread.currentThread().getContextClassLoader().

Is there any way anyone can think of to get around this other than signing the applet? I know signing it is an option, but I would like to see if there are any other options available. Is there some way I can extend or reimplement this part of jasper to not use/need the class loader? Does someone know of a way to give the applet permission to use getContextClassLoader()? Everything I have tried has failed so far.

Any help is greatly appreciated.

By: captnveg - captnveg
RE: Jasper Fill in an Applet PROBLEM
2005-08-19 07:35
I am attempting to do the same and am searching for a solution to this problem. The primary application that I am adding jasper reports to is contained in a signed jar, and therefore has its own secure class loader. For the most part, the fillManager in Jasper retrieves the Thread's current classLoader, which doesn't cause a problem. It is when it makes a call to
JRClassLoader.loadClassFromBytes(); from the
JRAbstractJavaCompiler.loadCalculator method which is called from the JRBaseFiller, that a problem occurs. Jasper all of a sudden just tries to use its own custom secure class loader, which throws the security exception.

2004 IR Help's picture
Joined: Aug 17 2006 - 3:49am
Last seen: 17 years 1 month ago

1 Answer:

 Hi there,


Is it possible to fill the data in a jasper report using an applet? The datasource is XML. 

Currently I could fill data using a servlet with my XML datasource and view the report using a print/viewer applet. I refered to the webapp sample in the source.

I was wondering if I could move the filling of data to the client side (ie. an applet) as well.

Appreciate the help,



sjzone's picture
Joined: Sep 13 2011 - 8:39am
Last seen: 12 years 3 weeks ago