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 property in @ConfigurationProperties causes java.lang.StackOverflowError when generating metadata #18365

Closed
DaiZZZZZ opened this issue Sep 26, 2019 · 5 comments
Labels
type: bug A general bug
Milestone

Comments

@DaiZZZZZ
Copy link

DaiZZZZZ commented Sep 26, 2019

Class A has member of Type A,if A is annotated with @ConfigurationProperties and lombok.Data together a java.lang.StackOverflowError will happen.

For example:

@ConfigurationProperties("prefix")
@Data
public class A {

   A m;

}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 26, 2019
@snicoll
Copy link
Member

snicoll commented Sep 26, 2019

We can see what we can do to avoid the stackoverflow but binding won't work anyway, see #16444

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Sep 26, 2019
@philwebb
Copy link
Member

@DaiZZZZZ Can you please attach the stacktrace.

@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed for: team-attention An issue we'd like other members of the team to review labels Sep 27, 2019
@ddcruver

This comment has been minimized.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 30, 2019
@snicoll

This comment has been minimized.

@mbhave mbhave added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Sep 30, 2019
@DaiZZZZZ
Copy link
Author

DaiZZZZZ commented Oct 1, 2019

@philwebb

Caused by: java.lang.StackOverflowError
        at com.sun.tools.javac.tree.TreeScanner.visitSelect(TreeScanner.java:264)
        at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.visitApply(TreeScanner.java:199)
        at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.visitBinary(TreeScanner.java:244)
        at com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1785)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.visitAssign(TreeScanner.java:231)
        at com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1686)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
        at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:105)
        at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.visitMethodDef(TreeScanner.java:91)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.visitMethodDef(TreeInfo.java:670)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.scan(TreeInfo.java:658)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:80)
        at com.sun.tools.javac.tree.TreeInfo$1DeclScanner.visitClassDef(TreeInfo.java:666)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeInfo.declarationFor(TreeInfo.java:682)
        at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:547)
        at com.sun.tools.javac.model.JavacElements.getDocComment(JavacElements.java:321)
        at org.springframework.boot.configurationprocessor.TypeUtils.getJavaDoc(TypeUtils.java:144)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processSimpleLombokTypes$1(ConfigurationMetadataAnnotationProcessor.java:340)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processSimpleLombokTypes(ConfigurationMetadataAnnotationProcessor.java:326)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:277)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedTypes(ConfigurationMetadataAnnotationProcessor.java:352)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processTypeElement(ConfigurationMetadataAnnotationProcessor.java:278)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.processNestedType(ConfigurationMetadataAnnotationProcessor.java:423)
        at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.lambda$processNestedTypes$2(ConfigurationMetadataAnnotationProcessor.java:354)

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Oct 1, 2019
@snicoll snicoll changed the title use @ConfigurationProperties and lombok.Data together cause java.lang.StackOverflowError Recursive property in @ConfigurationProperties cause java.lang.StackOverflowError when generating metadata Oct 1, 2019
@snicoll snicoll added type: bug A general bug and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Oct 1, 2019
@snicoll snicoll added this to the 2.1.x milestone Oct 1, 2019
@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.1.10 Nov 5, 2019
@wilkinsona wilkinsona changed the title Recursive property in @ConfigurationProperties cause java.lang.StackOverflowError when generating metadata Recursive property in @ConfigurationProperties causes java.lang.StackOverflowError when generating metadata Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

7 participants