[#4809] - JPA Modules are loaded into wrong classloaders.

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Category:
Bug report
Priority:
Urgent
Status:
Assigned
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

When you add a JPA library into the classpath (with META-INF/persistence.xml) that uses also a non default JPA library (in this case, eclipselink-2.0.2), iReport is unable to find the persistence provider.

cbr600f's picture
Joined: Nov 4 2007 - 4:14pm
Last seen: 4 years 10 months ago

1 Comment:

#1

Maybe the problem resides on the way the META-INF/persistence.xml file is looked up by the Persistence providers. They seem to use a higher classloader than the one that loads the libraries (maybe system?... I only do java stuff now as a hobby and I'm no longer as guru as I used to be =/ )

I've been messing with this and I can confirm the following:
- You need to have in /platform9/core the definition for the Persistence Unit (a jar with your META-INF/persistence.xml
- You need to have in /platform9/core all the relevant things for your persistence unit:
* Driver
* JPA classes (in case you use a diferent version than iReport bundled JPA, you will also need to delete them from ireport/modules/ext
* Your bean clases (they contain named queries and bean definitions)

One posible solution would be to register Persistence Units in iReport the same way you register connections to databases, thus allowing us to place the drivers and stuff in a much user friendly way, since you cannot reload dinamicaly libraries placed on platform9/core and if you change your beans, you need to restart iReport.

Feedback