2004 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: geraldine84 - geraldine84 Scriptlet class not found 2005-11-24 00:46 Hello, I would like to set a classpath dynamicly for the scriptlet. In fact, jasperreports is integrated to a soft using client/server. Each customer has different directories so that we can't set the classpath with classic way (in a file for example). I tried many things : loading the class with Class.forName (the pb is that the scriptlet is loaded many times), seting a new classpath with System.setProperty("java.class.path", classpath) but it doesn't work finally I tried System.load() but doesn't work and I didn't understand anything. Can somebody help me? Thanks, Geraldine. By: Rafael Heise - rmheise RE: Scriptlet class not found 2005-11-25 04:13 Perhaps you can leave scriptlet class with together the report, in same directory. Try it. Because when I run my report, I don't set classpath, and the scriptlet work. But I make a new jar File, with all files... jasperreports and lib!! By: geraldine84 - geraldine84 RE: Scriptlet class not found 2005-11-25 06:43 thanks a lot! I found another solution : http://forum.java.sun.com/thread.jspa?threadID=300557&start=0 but now there's another problem : if I change the scriptlet (for example I add a new method) and the report (.jasper file), it is ok for jasper file, but I get an error for scriptlet java.lang.NoSuchMethodError: cpy000Scriptlet.salut()Ljava/lang/String; at cpy000.evaluate(cpy000:190) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:608) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:536) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:299) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:286) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:353) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBand(JRVerticalFiller.java:1218) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFiller.java:357) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:220) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:129) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:953) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:780) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:163) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:625) It means that java keeps in memory the old scriptlet, and even if there is a new scriptlet class, it doesn't mind it and doesn't reload it. I tried again a class loader, but doesn't work. The only way is to close the server and restart it (not a good solution for clients) Thank you, Geraldine 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