Skip to content

Take MethodType into account to deduce main application class #31858

@snicoll

Description

@snicoll

The change in #31828 is breaking a native image deployment as follows:

Exception in thread "main" java.lang.UnsupportedOperationException at java.lang.StackWalker$StackFrame.getMethodType(StackWalker.java:148) at org.springframework.boot.SpringApplication.lambda$findMainClass$1(SpringApplication.java:290) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at com.oracle.svm.core.jdk.Target_java_lang_StackWalker$AbstractStackFrameSpliterator.tryAdvance(Target_java_lang_StackWalker.java:220) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) at org.springframework.boot.SpringApplication.findMainClass(SpringApplication.java:290) at java.lang.StackWalker.walk(StackWalker.java:167) at org.springframework.boot.SpringApplication.deduceMainApplicationClass(SpringApplication.java:283) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:279) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:256) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1307) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1296) at com.example.commandlinerunner.CommandlinerunnerApplication.main(CommandlinerunnerApplication.java:10) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: blockedAn issue that's blocked on an external project changetheme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions