Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNoSuchMethodError due to EclipseLink internal weaving?
https://www.eclipse.org/forums/index.php/mv/msg/1069088/1703772/#msg_1703772
We are using EclipseLink 2.6.0 and are seeing a weird error that appears to be resolved by setting the value for the PersistenceUnitProperties.WEAVING_INTERNAL property to false in the EntityManagerFactory definition.
A little background on our JPA mapped entities in play here. We have a concrete class called CareTeam that extends a MappedSuperclass called AuditedEntity, and AuditedEntity extends another MappedSuperclass called IdentifiedEntity. We have plenty of classes that extend either IdentifiedEntity or AuditedEntity without issue thus far in our three or so months of using EclipseLink 2.6.0. So, this doesn't pear to be due to AuditedEntity or IdentifiedEntity. The CareTeam class is a simple concrete Entity that extends AuditedEntity and it has a default public no args constructor, as does the AuditedEntity class, contrary to what the stack trace below might lead you to believe.
If we do not set this property, we see a stack trace of the following form at runtime, at the time a request is being serviced, not at runtime initialization time :
2015-08-03 22:16:04.334 RI: dd39a3d4-7e5a-42bb-beb9-09249df66031 ERROR http-bio-8780-exec-1 BaseExceptionMapper - Service invocation failure :
java.lang.NoSuchMethodError: com.company.db.jpa.AuditedEntity.<init>(Lorg/eclipse/persistence/internal/descriptors/PersistenceObject;)V
at com.company.careteamservice.beans.CareTeam.<init>(CareTeam.java)
at com.company.careteamservice.beans.CareTeam._persistence_new(CareTeam.java)
at org.eclipse.persistence.internal.descriptors.PersistenceObjectInstantiationPolicy.buildNewInstance(PersistenceObjectInstantiationPolicy.java:33)
at org.eclipse.persistence.descriptors.ClassDescriptor.selfValidationAfterInitialization(ClassDescriptor.java:4230)
at org.eclipse.persistence.descriptors.ClassDescriptor.validateAfterInitialization(ClassDescriptor.java:6099)
at org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3915)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:692)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:637)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:568)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:804)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:761)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:255)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:728)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:449)
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:369)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:463)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
I have a few questions to pose to the forum :
1) Is this a known issue with EclipseLink 2.6.0?
2) We wish to use load time weaving, so is it possible that this change will compromise the behavior of load time weaving in some way?
Thanks, Doug
]]>Doug Gschwind2015-08-04T20:26:22-00:00Re: NoSuchMethodError due to EclipseLink internal weaving?
https://www.eclipse.org/forums/index.php/mv/msg/1069088/1703956/#msg_1703956
we saw some reports mentioning this but we are unable to reproduce this issue. If you have some simple, self contained, easy to run test case for this then go ahead, file a bug[1] and attach the test there, please.
Thanks,
--lukas
[1]: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EclipseLink&component=JPA&version=2.6.0]]>Lukas Jungmann2015-08-06T07:40:21-00:00Re: NoSuchMethodError due to EclipseLink internal weaving?
https://www.eclipse.org/forums/index.php/mv/msg/1069088/1704170/#msg_1704170
Thanks for the response. We don't have a means to extract the code that causing this behavior into a simple test case, but would have been happy to do so otherwise. We are using Tomcat, Spring, no persistence.xml file, Spring to create the EntityManagerFactory from Java configuration.
We wish to use load time weaving, so is it possible that setting internal weaving to false will compromise JPA entity behavior of overall load time weaving in some way?