Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Jasperreports and a jpa based java se application

Hi James,

Thanks alot for responding. 

I've fixed the bug by updating to the latest version of eclipselink!

The application compiled just fine, the error occured during runtime.

The report was working before I ported my application to jpa. I was using
plain old jdbc before.

Regards

Frederik


James Sutherland wrote:
> 
> Please log a bug for this, it seems that EclipseLink's canonical model
> processor compile hook is somehow interfering with the reports compiler
> usage.
> 
> It this just a warning that is logged, or does the report compilation
> fail?
> 
> 
> sirdeaz wrote:
>> 
>> Hi, 
>> 
>> I'm working on an standard java desktop application which uses jpa
>> (eclipselink 2.0.0) in nb 6.9.0. It's working like a charm. It's fetching
>> data and displaying it by using jfreechart. 
>> 
>> If I try to create a report, it throws an error stating that it can't
>> find the persistence.xml file even though all the other jpa functionality
>> is working. 
>> 
>> The runtime error + code used to create the report is included. 
>> 
>> java.lang.RuntimeException: java.lang.RuntimeException: Unable to load
>> persistence.xml : META-INFpersistence.xml (The system cannot find the
>> path specified) 
>>         at
>> org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:366) 
>>         at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:624) 
>>         at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:553) 
>>         at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:698) 
>>         at
>> com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981) 
>>         at
>> com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) 
>>         at com.sun.tools.javac.main.Main.compile(Main.java:353) 
>>         at com.sun.tools.javac.main.Main.compile(Main.java:279) 
>>         at com.sun.tools.javac.main.Main.compile(Main.java:270) 
>>         at com.sun.tools.javac.Main.compile(Main.java:69) 
>>         at com.sun.tools.javac.Main.main(Main.java:54) 
>> Caused by: java.lang.RuntimeException: Unable to load persistence.xml :
>> META-INFpersistence.xml (The system cannot find the path specified) 
>>         at
>> org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.getInputStream(PersistenceUnitReader.java:105) 
>>         at
>> org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.initPersistenceUnits(PersistenceUnitReader.java:160) 
>>         at
>> org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.<init>(PersistenceUnitReader.java:63) 
>>         at
>> org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:329) 
>>         ... 10 more 
>> 
>>         at
>> net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:191) 
>>         at
>> net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:215) 
>>         at
>> net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:201) 
>>         at
>> be.carglass.warehouseoverview.reporting.ReportManager.generateChecklist(ReportManager.java:58) 
>>         at
>> be.carglass.warehouseoverview.gui.pie.DefaultPieChartPanel$1$1.execute(DefaultPieChartPanel.java:52) 
>>         at
>> be.carglass.warehouseoverview.gui.MainFrame$1.doInBackground(MainFrame.java:139) 
>>         at
>> be.carglass.warehouseoverview.gui.MainFrame$1.doInBackground(MainFrame.java:135) 
>>         at javax.swing.SwingWorker$1.call(SwingWorker.java:277) 
>>         at
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
>>         at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
>>         at javax.swing.SwingWorker.run(SwingWorker.java:316) 
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
>>         at java.lang.Thread.run(Thread.java:619) 
>> 
>> code to create the report: 
>> 
>> public ReportResult generateReportGermany(Warehouse warehouse) throws
>> Exception { 
>>         List<ChecklistRecord> records =
>> ChecklistRecord.findAllByWarehouseAndRouteType(warehouse,
>> CheckListType.getCheckListTypeForGermany()); 
>>         return generateReport("Germany", warehouse,
>> CHECKLIST_DATASOURCE_GERMANY, new JRBeanCollectionDataSource(records)); 
>>     } 
>> 
>>     private ReportResult generateReport(String country, Warehouse
>> warehouse, String report, JRDataSource ds) throws Exception { 
>>         String tempFile = getTempFileName(); 
>> 
>>         HashMap<String, String> parameters = new HashMap<String,
>> String>(); 
>>         parameters.put("country", translate(country)); 
>> 
>>         // compile 
>>         JasperReport jasperReport =
>> JasperCompileManager.compileReport(ClassLoader.getSystemResourceAsStream(report)); 
>>         // fill it 
>>         JasperPrint jasperPrint =
>> JasperFillManager.fillReport(jasperReport, parameters, ds); 
>>         // export to pdf 
>>         JasperExportManager.exportReportToPdfFile(jasperPrint, tempFile); 
>>         
>>         return new ReportResult(tempFile, warehouse); 
>>     } 
>> 
>> How can I resolve this issue? 
>> 
>> Regards, 
>> 
>> Frederik 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Jasperreports-and-a-jpa-based-java-se-application-tp29917039p30002887.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top