Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive annotations cannot be deployed with JPA on Payara 5 #2608

Closed
marvelous opened this issue Apr 9, 2018 · 4 comments · Fixed by #2910
Closed

Recursive annotations cannot be deployed with JPA on Payara 5 #2608

marvelous opened this issue Apr 9, 2018 · 4 comments · Fixed by #2910
Assignees
Milestone

Comments

@marvelous
Copy link

Description


When an annotation class annotated with itself gets scanned by EclipseLink, it enters into a recursive loop which triggers a StackOverflowError and fails the deployment. The same was working correctly on version 4.

Expected Outcome

Successful deployment

Current Outcome

A failed deployment with a log like in
https://javaee.groups.io/g/glassfish/topic/6519037
https://pastebin.com/61trs1kj

Steps to reproduce

Compile only these 3 files into a WAR and deploy in payara micro:

The culprit:

@Self
public @interface Self {}

The enabler:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence">
        <persistence-unit name="persistence" transaction-type="JTA">
                <exclude-unlisted-classes>false</exclude-unlisted-classes>
        </persistence-unit>
</persistence>

The trigger:

@Singleton
public class Bean {
    @PersistenceContext
    private EntityManager em;
}

Samples

scce.zip

Context

I encountered the issue in a Kotlin project where kotlin.annotation.Target is annotated with itself.

Environment

  • Payara Version: 5.181 and 5.182-SNAPSHOT
  • Edition: Micro
  • JDK Version: openjdk version "1.8.0_162"
  • Operating System: Fedora release 26
  • Database: default embedded H2 datasource
@smillidge
Copy link
Contributor

Can you raise this on Eclipselink https://github.com/eclipse-ee4j/eclipselink?

@cristhiank
Copy link

I'm having a really hard time with this issue.
We are trying to migrate from Wildfly to Payara 5 but this is blocking us from being able to do it.
This is the line that triggers the infinite recursion.

I already saw the issue on eclipselink:
eclipse-ee4j/eclipselink#63

I will try to solve it and contribute the solution if I find a viable solution.

@cristhiank
Copy link

cristhiank commented Jun 21, 2018

This is now fixed in upstream eclipse-ee4j/eclipselink#137 in both master and 2.7 branches.

@smillidge
Copy link
Contributor

Created PAYARA-2881 to bring in the upstream fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants