spring-projects / spring-projects/spring-boot

Take MethodType into account to deduce main application class

Open
#31,858 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: blocked theme: aot type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

The change in https://github.com/spring-projects/spring-boot/pull/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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in SpringApplication.java around deduceMainApplicationClass and findMainClass, and review the change in pull request 31828. Reproduce or inspect the native image failure involving StackWalker.StackFrame.getMethodType; done means main application class deduction no longer invokes the unsupported operation in a native image deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.