yelnaza Posted August 23, 2010 Share Posted August 23, 2010 Hi to allI have a problem in my report.I need to use custom class in it, but I don't know how to.I tried to put path to jar file with my class file into CLASSPATH, tried to set my jar file in iReports- Tools - Options - CLASSPATHbut my report doesn't work. It compiles prefectly but doesn't fill data. I have this error: java.lang.IllegalAccessError and message that my class can't be accessed from reports class.Can anyone help me, please Link to comment Share on other sites More sharing options...
slow Posted August 23, 2010 Share Posted August 23, 2010 this is a good question...but there is something unclear when you describe your issue:"It compiles prefectly but doesn't fill data. I have this error: java.lang.IllegalAccessError and message that my class can't be accessed from reports class."how it can compile perfectly also giving you an error?can you be more clear (maybe reporting the exact error...) ?listening: Marlene Kuntz - Impressioni di settembre Post Edited by slow at 08/23/2010 14:30 Link to comment Share on other sites More sharing options...
yelnaza Posted August 23, 2010 Author Share Posted August 23, 2010 Ok, when I said "compile prefeclty" I mean that when I go from Designer to Preview everything is ok.When I try to run report with my parameter value it is crushing and log file said that filling report is impossible becouse report class can't access to my class. Link to comment Share on other sites More sharing options...
yelnaza Posted August 23, 2010 Author Share Posted August 23, 2010 Very strange situation. Just create simple report on another computer, want check class - all working very well. Is order of jar files in classpath of iReports (Tools - Options - Classpath) important? Link to comment Share on other sites More sharing options...
yelnaza Posted August 24, 2010 Author Share Posted August 24, 2010 Can't figure out in what problem. Equal settings on different computers and one is working and another crushing.... Can this problem depend from system user? Link to comment Share on other sites More sharing options...
slow Posted August 24, 2010 Share Posted August 24, 2010 have you tried the same report on two computer? not similar report, but exactly the same...you can also try to import your class... (it's a bean class, an help class or what else?)clicking on the main node of your report and then in the properties window on the "import" button setting the package of your class.I use custom class but I'm not having problem. Link to comment Share on other sites More sharing options...
yelnaza Posted August 24, 2010 Author Share Posted August 24, 2010 I try to make new report with text field in it. In expression of text field I create new object of my class. On one computer it works, on another don't work's and log says:  Compiling to file... C:\Jasper\report1.jasperCompilation running time: 281! Setting net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory as Query Executer Factory for language: sql  Filling report...  Locale: руÑÑкий (РоÑÑиÑ)  Time zone: DefaultError filling print... Error evaluating expression :     Source text : new InWords("1234").toString() net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :     Source text : new InWords("1234").toString()     at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:195)     at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:589)     at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:557)     at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:929)     at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:383)     at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:368)     at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258)     at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:325)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:261)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:127)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:540)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:914)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: java.lang.IllegalAccessError: tried to access class InWords from class report32name_1282642047542_741168     at report32name_1282642047542_741168.evaluate(report32name_1282642047542_741168:164)     at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182)     ... 18 more Print not filled. Try to use an EmptyDataSource... Link to comment Share on other sites More sharing options...
slow Posted August 24, 2010 Share Posted August 24, 2010 from russia... wow :)try to import your class as I have explained in the previous post, then, in the texfield use the expression:(new InWords("1234")).toString() and notnew InWords("1234").toString() check if the cell type of the textfield is String it seems to be a JVM problem... have the two machines where you run the report the same JVM? make a test and then give us a feedback :) listening :Marlene Kuntz - SonicaPost Edited by slow at 08/24/2010 09:40 Link to comment Share on other sites More sharing options...
yelnaza Posted August 24, 2010 Author Share Posted August 24, 2010 :)Yes, JVM on my computes is different....Thanks for advices, I'll try... and write there after Link to comment Share on other sites More sharing options...
yelnaza Posted August 26, 2010 Author Share Posted August 26, 2010 At last....It was misprint in my class. It causes problem with class visibility.Anyway thanks for help, especially about import custom classes. :) 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