2001 JI Open Discussion Posted August 15, 2006 Share Posted August 15, 2006 By: Eric Heikkila - ehei NoSuchMethodException (JRBaseFiller.java:424) 2002-08-16 11:44Trying to load, compile and run an XML file we created. Here's the code: FileOutputStream outStream = new FileOutputStream("C:/Program Files/IBM/Application Developer/centurn_exp.pdf"); // connection = DataAccess.getConnection("billing"); String driverName = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc:oracle:oci8:@STARDEV.WORLD"; String userName = "conversion"; String password = "conv2java"; connection = DBConnection.getConnection(driverName, url, userName, password); Map parameters = new HashMap(); parameters.put("fromDate", "'07-01-2001'"); parameters.put("toDate", "'06-30-2002'"); parameters.put("svcNumString", "'07','16'"); JasperReport jr = JasperManager.compileReport(getJasperDesign()); JasperPrint jp = JasperManager.fillReport(jr, parameters, connection); if (jp.getPages().size() < 1) { fail("Report Empty"); } byte[] reportAsPdf = JasperPrintManager.printReportToPdf(jp); outStream.write(reportAsPdf); outStream.close(); And here's the stack trace: java.lang.NoSuchMethodException at java.lang.Class.getConstructor0(Native Method) at java.lang.Class.getConstructor(Unknown Source) at dori.jasper.engine.fill.JRBaseFiller.loadCalculator(JRBaseFiller.java:424) at dori.jasper.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:226) at dori.jasper.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:62) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:170) at dori.jasper.engine.JasperManager.fillReport(JasperManager.java:688) at com.medcharge.c3web.util.JasperTest.testSomething(JasperTest.java:50) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:158) at junit.framework.TestCase.runBare(TestCase.java:131) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:122) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.swingui.TestRunner$16.run(TestRunner.java:626) NESTED BY : dori.jasper.engine.JRException: Error loading expression class : centurn_exp at dori.jasper.engine.fill.JRBaseFiller.loadCalculator(JRBaseFiller.java:429) at dori.jasper.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:226) at dori.jasper.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:62) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:170) at dori.jasper.engine.JasperManager.fillReport(JasperManager.java:688) at com.medcharge.c3web.util.JasperTest.testSomething(JasperTest.java:50) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:158) at junit.framework.TestCase.runBare(TestCase.java:131) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:122) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.swingui.TestRunner$16.run(TestRunner.java:626) NOTE: We have checked and rechecked that we have tools.jar, xerces.jar, etc., in the classpath. We are trying it with jdk1.3.1_04. Running the same XML file within the JasperEdit application seems to work just fine (which is almost the exact same code we are trying to use). Thanks in advance!!! -Eric By: Eric Heikkila - ehei RE: NoSuchMethodException (JRBaseFiller.java:424) 2002-08-19 07:02Found the problem. When running JUnit, the ClassLoader is screwing things up. Not sure why...guess we'll have to figure out a different way to test it. :) -Eric 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