2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: Ming - ming80 runtime report compilation 2006-06-18 20:48I sent an email to teodord@users.sourceforge.net about a week ago, and I still get no response until today. Anyway, here's what I wrote: I've been using JasperReports for several months now, and it was great, good job! :) Anyway, there's a feature I just recently look for, and it seemed that such feature is not yet available. Here's what happened: One of my app requires that a report is compiled at runtime, and it was not a problem, until recently, when I started using Java WebStart to deploy my apps. The runtime compilation process failed with an error message that some of JasperReports' class were not found. After some "investigation" :) it turns out to be a problem with the classpath & ClassLoader. Java WebStart (JWS) uses a ClassLoader other than the System ClassLoader (which loads class files from disk), and therefore it doesn't depend on any classpath. After dumping the content of java.class.path system property to the console, I found out that the only .jar referenced by the classpath was the one that belongs to JWS, none of my app's .jar (including JasperReports') was mentioned there. Changing the classpath or the java.class.path property won't work either since my app's jar files is stored in JWS's cache, and referring to them by hand (hardcoded in the app) is certainly not a good practice (It will nullifies program portability since the JWS cache can be relocated anywhere by the user). I came to a conclusion that what I need is a runtime compiler that does not depend on any classpath, and therefore accepts ClassLoader other than the default System ClassLoader (which depends on classpath). In the "language" of OOP, what I'm looking for is an implementation of the JRCompiler interface that has a constructor with a signature similar to this: JRCompiler(ClassLoader loader) instead of JRCompiler(String classpath). I was wondering if I could see this implemented in the future release of JasperReport :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now