Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » MappedSuperClass with EclipseLink
MappedSuperClass with EclipseLink [message #1779643] Wed, 10 January 2018 17:06 Go to next message
Srinivas Nagesh is currently offline Srinivas NageshFriend
Messages: 1
Registered: January 2018
Junior Member
We are trying to use @MappedSuperclass with EclipseLink 2.6.4 and SpringBoot 1.5.9 and running into an issue.

JpaBaseConfiguration
    @Override
    protected AbstractJpaVendorAdapter createJpaVendorAdapter() {

        return new EclipseLinkJpaVendorAdapter();
    }

    @Override
    public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder) {

        Map<String, Object> vendorProperties = getVendorProperties();
        customizeVendorProperties(vendorProperties);

        LocalContainerEntityManagerFactoryBean factoryBean = factoryBuilder.dataSource(getDataSource())
                .packages(getPackagesToScan()).properties(vendorProperties).jta(isJta()).build();

        factoryBean.setLoadTimeWeaver(new WebLogicLoadTimeWeaver());

        return factoryBean;
    }


Error

java.lang.NoSuchMethodError: abc.xyz.domain.shared.AbstractEntity._persistence_set(Ljava/lang/String;Ljava/lang/Object;)V
	at abc.xyz.domain.model.order.Order._persistence_set(Order.java) ~[_wl_cls_gen.jar:?]
	at org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor.setAttributeValueInObject(PersistenceObjectAttributeAccessor.java:102) ~[eclipselink.jar:2.6.4.v20160829-44060b6]
	at org.eclipse.persistence.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1652) ~[eclipselink.jar:2.6.4.v20160829-44060b6]
	at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1540) ~[eclipselink.jar:2.6.4.v20160829-44060b6]


The error doesn't occur when we remove the MappedSuperClass or Weaving is disabled. Any pointers on what may be missing in the configuration?
Re: MappedSuperClass with EclipseLink [message #1779903 is a reply to message #1779643] Mon, 15 January 2018 14:59 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
The AbstractEntity wasn't included in the weaving when it is expected to have been - try adding the class to the persistence.xml file so it can be picked up.
Re: MappedSuperClass with EclipseLink [message #1826864 is a reply to message #1779903] Sun, 03 May 2020 09:08 Go to previous messageGo to next message
Namrath Kumar is currently offline Namrath KumarFriend
Messages: 2
Registered: May 2020
Junior Member
Is this issue resolved.?

I also face the issue with below versions of eclispeLink and JPA where the mapped super class properties are not woven and changes to those fields are not detected during peristance.

weaving : Dynamic

The default attribute change tracking : haschanges() not set to true when only mapped super class properties are changed.

The below versions of libraries

java - 8
eclipselink - 2.6.5
jpa - javax.persistance - 2.1.1
Weblogic - 12.2.1.3

[Updated on: Wed, 06 May 2020 21:05]

Report message to a moderator

Re: MappedSuperClass with EclipseLink [message #1826939 is a reply to message #1826864] Tue, 05 May 2020 00:51 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Why is your class not being woven? As mentioned in my comment -this error occurs because weaving is expected to have occurred. Try adding your mapped superclass to the persistence unit xml and ensure it is with the other entity classes when using static weaving.
Re: MappedSuperClass with EclipseLink [message #1827088 is a reply to message #1826939] Wed, 06 May 2020 21:48 Go to previous messageGo to next message
Namrath Kumar is currently offline Namrath KumarFriend
Messages: 2
Registered: May 2020
Junior Member
Added all the mapped super classes in persistance unit xml. Still AttributeChangeListener --> haschanges() returns false when change is done to only mappedsuper class attributes.(though setter).

Persistence xml version : 1

Please suggest whether any configs need to be added for dynamically weave mapped super classes.
Re: MappedSuperClass with EclipseLink [message #1827117 is a reply to message #1827088] Thu, 07 May 2020 13:21 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Has it been woven? Does it have _persistence_set and other persistence method from weaving?
How are you running weaving, and what does the logging say about the class when it is occurring?

[Updated on: Thu, 07 May 2020 13:22]

Report message to a moderator

Previous Topic:EclipseLink 2.7.4 mixed approach - Native TopLinkProject and JPA approaches don't work together
Next Topic:Static Weaving and Lifecycle Methods
Goto Forum:
  


Current Time: Sun Dec 03 02:20:39 GMT 2023

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

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

Back to the top