Skip to content

Instantly share code, notes, and snippets.

@odrotbohm
Last active October 21, 2017 08:41
Show Gist options
  • Save odrotbohm/5832121 to your computer and use it in GitHub Desktop.
Save odrotbohm/5832121 to your computer and use it in GitHub Desktop.
@MappedSuperclass
public abstract class AbstractAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements
Auditable<U, PK> {
// …
}
@MappedSuperclass
public abstract class AbstractPersistable<PK extends Serializable> implements Persistable<PK> {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private PK id;
// …
}
@Entity
public class AuditableUser extends AbstractAuditable<AuditableUser, Long> {
// …
}
interface Persistable<ID extends Serializable> extends Serializable {
ID getId();
boolean isNew();
}
Exception Description: Predeployment of PersistenceUnit [default] failed.
Internal Exception: Exception [EclipseLink-7247] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.ValidationException
Exception Description: A circular reference was discovered processing derived IDs on the following Entity classes: [[org.springframework.data.jpa.domain.sample.AuditableUser]]
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:230) ~[org.eclipse.persistence.core-2.5.0.jar:na]
... 51 common frames omitted
Caused by: org.eclipse.persistence.exceptions.ValidationException:
Exception Description: A circular reference was discovered processing derived IDs on the following Entity classes: [[org.springframework.data.jpa.domain.sample.AuditableUser]]
at org.eclipse.persistence.exceptions.ValidationException.idRelationshipCircularReference(ValidationException.java:989) ~[org.eclipse.persistence.core-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.processDerivedId(ClassAccessor.java:1602) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processDerivedId(EntityAccessor.java:987) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.processDerivedId(ClassAccessor.java:1614) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processDerivedId(EntityAccessor.java:987) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processAccessorsWithDerivedIDs(MetadataProject.java:1522) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1819) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:580) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:585) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1865) ~[org.eclipse.persistence.jpa-2.5.0.jar:na]
... 49 common frames omitted
@GuyPelletier
Copy link

Can you provide the interface definitions as well?

@GuyPelletier
Copy link

I was able to reproduce the error. EclipseLink is not resolving the generic types correctly and it is specifically related to the interface implementation declaration. Commenting them out will get past the exception for the time being.

Can you enter a bug with this model and information?

@odrotbohm
Copy link
Author

Thanks for the feedback! I've added the declaration of Persistable and filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=411560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment