-
Notifications
You must be signed in to change notification settings - Fork 90
Cannot invoke "org.openrewrite.java.tree.JavaType$FullyQualified.getFullyQualifiedName()" #601
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
Comments
This problem did not occur in other projects, only on a project with api-gateway. |
Hi @marcgemis Could you try using spring-boot-upgrade.jar to see if the error persists? Looking at the stacktrace I am afraid it doesn't but since we moved the Boot Upgrade functionality to it's own application it could be that the functionality just didn't get enough love since then. 🤞 |
Hello @fabapp2 , best wishes to you as well,. I ran it with after a bit of experimenting, as I could not find any documentation on running spring-boot-upgrade.jar |
I've tried spring-boot-upgrade on some other projects we have and it fails on them as well. I just noticed the exception is slightly different for spring-boot-upgrade.jar Scanning /Users/mgemis/Projects/p4/awp/bluecloud/microservices/jdf-service but that is to be expected I assume |
I started with a fresh project, and found that when I add this stripped down version of my SecurityConfig to the project, the error occurs package com.example.demo; import java.util.Collection; import org.springframework.context.ApplicationContext; import lombok.RequiredArgsConstructor; @configuration
} I don't know why the method was added. We do not need it anymore. However, the exact same code is not in any of the other projects that fail. |
Thanks a lot for isolating the issue, that's very helpful. |
Please note that I also reported on issue against OpenRewrite : openrewrite/rewrite#2547 |
Describe the bug
Cannot generate a sbu30-report because the program reports a
Applying recipe 'sbu30-report'
Action [SpringBootUpgradeReportAction] 'Creates a Upgrade report for Spring Boot 3.' failed: Cannot invoke "org.openrewrite.java.tree.JavaType$FullyQualified.getFullyQualifiedName()" because the return value of "org.openrewrite.java.tree.TypeUtils.asFullyQualified(org.openrewrite.java.tree.JavaType)" is null
Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.
To Reproduce
as our company uses Perforce and not Git.
[ok] Found pom.xml.
[ok] 'sbm.gitSupportEnabled' is 'false', Nothing will be committed.
[ok] Required Java version (17) was found.
[ok] Found required source dir 'src/main/java'.
-then I tried to generate a report
api-gateway:> apply sbu30-report
Applying recipe 'sbu30-report'
Action [SpringBootUpgradeReportAction] 'Creates a Upgrade report for Spring Boot 3.' failed: Cannot invoke "org.openrewrite.java.tree.JavaType$FullyQualified.getFullyQualifiedName()" because the return value of "org.openrewrite.java.tree.TypeUtils.asFullyQualified(org.openrewrite.java.tree.JavaType)" is null
Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.
Expected behavior
The Spring Boot migration report should be generated
Stacktrace
If applicable, add the (sanitized) stacktrace here.
api-gateway:> stacktrace
org.springframework.sbm.engine.recipe.ActionFailedException: Action [SpringBootUpgradeReportAction] 'Creates a Upgrade report for Spring Boot 3.' failed: Cannot invoke "org.openrewrite.java.tree.JavaType$FullyQualified.getFullyQualifiedName()" because the return value of "org.openrewrite.java.tree.TypeUtils.asFullyQualified(org.openrewrite.java.tree.JavaType)" is null
at org.springframework.sbm.engine.recipe.Action.applyWithStatusEvent(Action.java:43)
at org.springframework.sbm.engine.recipe.Recipe.apply(Recipe.java:101)
at org.springframework.sbm.engine.commands.ApplyCommand.execute(ApplyCommand.java:61)
at org.springframework.sbm.shell.ApplyShellCommand.apply(ApplyShellCommand.java:61)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.shell.command.invocation.InvocableShellMethod.doInvoke(InvocableShellMethod.java:306)
at org.springframework.shell.command.invocation.InvocableShellMethod.invoke(InvocableShellMethod.java:232)
at org.springframework.shell.command.CommandExecution$DefaultCommandExecution.evaluate(CommandExecution.java:158)
at org.springframework.shell.Shell.evaluate(Shell.java:208)
at org.springframework.shell.Shell.run(Shell.java:140)
at org.springframework.shell.jline.InteractiveShellRunner.run(InteractiveShellRunner.java:73)
at org.springframework.shell.DefaultShellApplicationRunner.run(DefaultShellApplicationRunner.java:65)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:752)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
at org.springframework.sbm.SpringShellApplication.main(SpringShellApplication.java:27)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.NullPointerException: Cannot invoke "org.openrewrite.java.tree.JavaType$FullyQualified.getFullyQualifiedName()" because the return value of "org.openrewrite.java.tree.TypeUtils.asFullyQualified(org.openrewrite.java.tree.JavaType)" is null
at org.springframework.sbm.java.impl.OpenRewriteMethod.getReturnValue(OpenRewriteMethod.java:167)
at org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder.lambda$apply$1(SpringBeanMethodDeclarationFinder.java:52)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
at org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder.lambda$apply$2(SpringBeanMethodDeclarationFinder.java:52)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder.lambda$apply$6(SpringBeanMethodDeclarationFinder.java:56)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder.apply(SpringBeanMethodDeclarationFinder.java:45)
at org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder.apply(SpringBeanMethodDeclarationFinder.java:30)
at org.springframework.sbm.engine.context.ProjectContext.search(ProjectContext.java:77)
at org.springframework.sbm.boot.upgrade_27_30.report.helper.CommonsMultipartResolverHelper.evaluate(CommonsMultipartResolverHelper.java:51)
at org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportSection.shouldRender(SpringBootUpgradeReportSection.java:77)
at org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportAction.lambda$apply$0(SpringBootUpgradeReportAction.java:124)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportAction.apply(SpringBootUpgradeReportAction.java:125)
at org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportAction.applyInternal(SpringBootUpgradeReportAction.java:214)
at org.springframework.sbm.engine.recipe.Action.applyWithStatusEvent(Action.java:37)
... 28 more
Desktop (please complete the following information):
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode)
Additional context
There was no problem to generate the report boot-2.7-3.0-upgrade-report
The text was updated successfully, but these errors were encountered: