I'm trying to fix a bug that show up when trying to export a jasper report as a pdf, but when loading a .jrxml file using the JRXmlLoader, the code throws this exception:
Caused by: java.lang.IllegalAccessException: Class org.openide.util.WeakListenerImpl$ProxyListener can not access a member of class org.openide.filesystems.$Proxy0 with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openide.util.WeakListenerImpl$ProxyListener.<init>(WeakListenerImpl.java:413)
... 100 more
This is the code that seems to cause that execption :
JasperDesign jasperDesign = JRXmlLoader.load("C:/jrxmls/myreport.jrxml"); //< this line
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, resultSetDataSource);
Since it is not my code, and since I don't really know how to work using jasper, I apologize in advance for not being able to provide more context to this issue.
I've added multiple org.openide- to my buildpath, because I had a a ton of "ClassNotFoundException", maybe this is where the problem came from ?
I've read somewhere that the problem might come from jasperreport compatibility issues with the JDK 8, but the weird thing is that the code works when running from Eclipse, the exception is only thrown when running as a runnable jar file. This program is not young, it might have 2 years, and until now, the program ran perfectly (as I heard).
EDIT : Okay, so, I tried to run the program using version 1.7 of the jre. Unfortunatly, since it depends on other programs running on 1.8, I can't test this solution.