Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Access Errors for statically weaved classes in a consuming java module
Access Errors for statically weaved classes in a consuming java module [message #1868826] Tue, 23 July 2024 08:57 Go to next message
Manfred Schmid is currently offline Manfred SchmidFriend
Messages: 3
Registered: July 2024
Junior Member
Hi all,

recently we stumbled around the following problem when migrating one of our persistence units to eclipselink 4.0.3 and Java 17 using java modules.

The reason for our problem is that for this persistence unit we enabled static weaving and during static weaving our entity get the following tagging interfaces added:

org.eclipse.persistence.internal.weaving.PersistenceWeaved;
org.eclipse.persistence.internal.weaving.PersistenceWeavedChangeTracking;
org.eclipse.persistence.internal.weaving.PersistenceWeavedFetchGroups;

and its corresponding package org.eclipse.persistence.internal.weaving
is not exported by the corresponding module org.eclipse.persistence.core.

It is only exported to org.eclipse.persistence.jpa

But I'm wondering how any java module which refers such a statically weaved entity would ever compile (or run) because these weaved entities could not be loaded . You get errors like these:

cannot access org.eclipse.persistence.internal.weaving.PersistenceWeaved
[ERROR] class file for org.eclipse.persistence.internal.weaving.PersistenceWeaved not found

The only workaround I could come up with is to add a JVM parameter
--add-exports org.eclipse.persistence.core/org.eclipse.persistence.internal.weaving=<module hosting the JPA entities>

which is of course ugly and error prone.

Does anybody has faced this issue as well and is this already addressed in the eclipselink community?

Many thanks and best regards,
Manfred
Re: Access Errors for statically weaved classes in a consuming java module [message #1869345 is a reply to message #1868826] Tue, 13 August 2024 10:37 Go to previous messageGo to next message
Radek Felcman is currently offline Radek FelcmanFriend
Messages: 22
Registered: March 2021
Junior Member
See https://github.com/eclipse-ee4j/eclipselink/pull/2236
Re: Access Errors for statically weaved classes in a consuming java module [message #1869366 is a reply to message #1869345] Wed, 14 August 2024 07:32 Go to previous messageGo to next message
Manfred Schmid is currently offline Manfred SchmidFriend
Messages: 3
Registered: July 2024
Junior Member
Thanks for the quick reaction.
In which org.eclipse.persistence.core version will this PR be delivered?

Many thanks and best regards,
Manfred
Re: Access Errors for statically weaved classes in a consuming java module [message #1872851 is a reply to message #1869345] Mon, 25 November 2024 01:18 Go to previous message
Larry England is currently offline Larry EnglandFriend
Messages: 1
Registered: November 2024
Junior Member
Radek Felcman wrote on Tue, 13 August 2024 10:37
See https://github.com/eclipse-ee4j/eclipselink/pull/2236retro bowl


I opened the link but I don't understand much about the above problem.

[Updated on: Thu, 28 November 2024 01:01]

Report message to a moderator

Previous Topic:Fat Jar to thin jar differences 2.7.15
Next Topic:Strange column naming, when setting AttributeOverrides in entities
Goto Forum:
  


Current Time: Thu Jan 16 05:59:01 GMT 2025

Powered by FUDForum. Page generated in 0.03290 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top