Skip to main content



      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 04:57 Go to next message
Eclipse UserFriend
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 06:37 Go to previous messageGo to next message
Eclipse UserFriend
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 03:32 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 24 November 2024 20:18 Go to previous message
Eclipse UserFriend
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: Wed, 27 November 2024 20:01] by 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 Jul 10 06:46:08 EDT 2025

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

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

Back to the top