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 messageGo to next 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

Re: MappedSuperClass with EclipseLink [message #1862454 is a reply to message #1827117] Wed, 06 December 2023 00:26 Go to previous messageGo to next message
Sahar Rahmatian is currently offline Sahar RahmatianFriend
Messages: 2
Registered: December 2023
Junior Member
Hi,

I'm just wondering if a solution was found for this issue or not? We are trying to enable dynamic weaving in our application and have similar problem.
Re: MappedSuperClass with EclipseLink [message #1862471 is a reply to message #1862454] Wed, 06 December 2023 18:05 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 54
Registered: December 2021
Member
There is no bug I'm aware of touching this, so maybe detail your problem in a new thread as you should answer all the above questions about your issue -we can't help unless we know what you are doing and seeing.
Previous Topic:OptimisticLockException Data from Table not getting Refreshed
Next Topic:JDBC bind parameters only for one of them
Goto Forum:
  


Current Time: Sat Nov 09 00:49:55 GMT 2024

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

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

Back to the top