Bug 534042 - StackOverflow on annotation scanning when annotation has circulation
Summary: StackOverflow on annotation scanning when annotation has circulation
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-25 09:53 EDT by Sin-young "Divinespear" Kang CLA
Modified: 2022-06-09 10:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sin-young "Divinespear" Kang CLA 2018-04-25 09:53:22 EDT
(first, excuse my bad english...)

Kotlin always add annotation @kotlin.Metadata on compiled class.
it makes infinite loop when scanning annotations.

I found it with kotlin, but some java annotations also has circulation so can reproduce this error.

Can avoid with well-known blacklist or block re-visit?


some part of error logs are:
--------
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [default] failed.
Internal Exception: java.lang.StackOverflowError
	at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231)
	... 120 more
Caused by: java.lang.StackOverflowError
	at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAsmFactory.getMetadataClass(MetadataAsmFactory.java:152)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAsmFactory.getMetadataClass(MetadataAsmFactory.java:140)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.getAnnotation(MetadataAnnotatedElement.java:215)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.getAnnotation(MetadataAnnotatedElement.java:215)
...
--------
Comment 1 Klaus Schwartz CLA 2018-05-09 10:15:52 EDT
I can confirm this Bug on both EclipseLink 2.7.0 and 2.7.1 versions. It is very serious as it prevents any kotlin classes to be used as entities. 

Version 2.6.5 doesn't have this bug.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:04:42 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:09:12 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink