Composite project lazy loading EclipseLink weave

Hi,

In my cuba jmix migration, i try to use composite project like this :
app <— addon Parent <— addon Child(s)
I want to sanitize layer, addon Parent will be a core, addon child(s) will use parent’s core (service…)

I have a problem with configuration of EclipseLink
In this project sample :

jmix.zip (829.8 KB)

In addon Parent I create an @MappedSuperclass parent entity ParentEntity linked with entity LinkedEntity by @ManyToOne in lazy mode.
In addon Child i create a entity NewEntity extends ParentEntity

At runtime EclipseLink inform me :

Exception [EclipseLink-218] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: A NullPointerException would have occurred accessing a non-existent weaved vh method [_persistence_get_link_vh]. The class was not weaved properly - for EE deployments, check the module order in the application.xml deployment descriptor and verify that the module containing the persistence unit is ahead of any other module that uses it.

Can you help me to configure this sample project.
Configuring Static Weaving seems solves this
(EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Static Weaving - Eclipsepedia)

but it seem aleady configure
image

thanks for you return

gabriel

Hello, Gabriel!

Sorry for the late reply
I have looked into the problem and it seems to be an eclipselink bug:
@MappedSuperclass is not weaved properly when it has no inheritors which happens for “addonparent” when its jar is being built.
They had a similar problem earlier and fixed it. Unfortunately valueholders are still not added in such cases.

As a workaround you can add dummy entity that extends ParentEntity in addonparent:
mapped_superclass_not_weaved_properly.zip (490.8 KB)

I’ve created an issue to investigate the problem more closely.

Regards,
Dmitry

1 Like