views:

180

answers:

0

I am facing very strange classloading issues with iReport 3.7.0. Here's some background context. We need to fill a Jasper report with data from a custom JRDataSource factory that uses POJOs to encapsulate the data. The POJOs are populated from data that resides in a database. In order for the client to "tweak" the report templates we need to be able to load the data from an XML file. We are using the Castor XML binding framework to load the sample data. The test cases generate the report properly when executed from a unit test, however, when the report is "previewed" in iReport we get the following exception.

Caused by: ca.architech.scoringcenter.reporting.ProcessingException: org.exolab.castor.mapping.MappingException: Could not find the class ca.architech.scoringcenter.reporting.castor.Product      at ca.architech.scoringcenter.reporting.XmlAssessmentResultsProcessorImpl.init(XmlAssessmentResultsProcessorImpl.java:55)      at ca.architech.scoringcenter.reporting.jasper.datasource.XmlReportDataSourceFactory.getInstance(XmlReportDataSourceFactory.java:20)      at ca.architech.scoringcenter.reporting.jasper.datasource.SelfAssessmentDataSourceFactory.(SelfAssessmentDataSourceFactory.java:54)      at dexiaMaster_1264019910921_476693.evaluate(dexiaMaster_1264019910921_476693:156)      at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182)      ... 13 more  Caused by: org.exolab.castor.mapping.MappingException: Could not find the class ca.architech.scoringcenter.reporting.castor.Product 

The Castor classes are clearly being loaded properly. The castor xml-to-java mapping file is in a .jar file that is added to iReport's classpath. It is clearly being loaded properly. Furthermore, the ca.architech.scoringcenter.reporting.castor.Product class is in the SAME .jar file as the mapping file yet, it is not being found by Castor. It appears iReport netbeans plugin is doing something strange with the Classloader such that the classloader hierarchy is broken?? Has anyone found similar issues?