Spring Boot Migrator - 导致:java.lang.IllegalArgumentException:索引 7 处的权限中存在非法字符

问题描述 投票:0回答:1

我正在尝试使用 springboot 迁移器项目将我的 springboot 应用程序从 springboot 2.7.5 迁移到 3.x。在尝试执行时,我得到了异常堆栈跟踪。

Scanning D:\\Project\\app-name
18:11:02.147 [main] ERROR o.s.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to execute ApplicationRunner
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765)
        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.SpringBootUpgradeReportApp.main(SpringBootUpgradeReportApp.java:31)
        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.IllegalArgumentException: Illegal character in authority at index 7: file://C:\Users\<username>\.m2\repository/org/springframework/boot/spring-boot-starter-parent/2.7.5/spring-boot-starter-parent-2.7.5.pom
        at java.base/java.net.URI.create(URI.java:906)
        at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:487)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentPropertiesAndRepositoriesRecursively(ResolvedPom.java:353)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentsRecursively(ResolvedPom.java:310)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolve(ResolvedPom.java:299)
        at org.openrewrite.maven.tree.ResolvedPom.resolve(ResolvedPom.java:144)
        at org.openrewrite.maven.tree.Pom.resolve(Pom.java:104)
        at org.openrewrite.maven.MavenParser.parseInputs(MavenParser.java:122)
        at org.springframework.sbm.build.impl.RewriteMavenParser.parseInputs(RewriteMavenParser.java:92)
        at org.springframework.sbm.project.parser.MavenProjectParser.parse(MavenProjectParser.java:94)
        at org.springframework.sbm.project.parser.ProjectContextInitializer.initProjectContext(ProjectContextInitializer.java:52)
        at org.springframework.sbm.engine.commands.ScanCommand.execute(ScanCommand.java:70)
        at org.springframework.sbm.SpringBootMigratorRunner.run(SpringBootMigratorRunner.java:48)
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762)
        ... 13 common frames omitted
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\<username>\.m2\repository/org/springframework/boot/spring-boot-starter-parent/2.7.5/spring-boot-starter-parent-2.7.5.pom
        at java.base/java.net.URI$Parser.fail(URI.java:2974)
        at java.base/java.net.URI$Parser.parseAuthority(URI.java:3308)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3219)
        at java.base/java.net.URI$Parser.parse(URI.java:3175)
        at java.base/java.net.URI.<init>(URI.java:623)
        at java.base/java.net.URI.create(URI.java:904)
        ... 26 common frames omitted
Failed to execute ApplicationRunner
java.lang.IllegalStateException: Failed to execute ApplicationRunner
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765)
        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.SpringBootUpgradeReportApp.main(SpringBootUpgradeReportApp.java:31)
        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.IllegalArgumentException: Illegal character in authority at index 7: file://C:\Users\<username>\.m2\repository/org/springframework/boot/spring-boot-starter-parent/2.7.5/spring-boot-starter-parent-2.7.5.pom
        at java.base/java.net.URI.create(URI.java:906)
        at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:487)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentPropertiesAndRepositoriesRecursively(ResolvedPom.java:353)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentsRecursively(ResolvedPom.java:310)
        at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolve(ResolvedPom.java:299)
        at org.openrewrite.maven.tree.ResolvedPom.resolve(ResolvedPom.java:144)
        at org.openrewrite.maven.tree.Pom.resolve(Pom.java:104)
        at org.openrewrite.maven.MavenParser.parseInputs(MavenParser.java:122)
        at org.springframework.sbm.build.impl.RewriteMavenParser.parseInputs(RewriteMavenParser.java:92)
        at org.springframework.sbm.project.parser.MavenProjectParser.parse(MavenProjectParser.java:94)
        at org.springframework.sbm.project.parser.ProjectContextInitializer.initProjectContext(ProjectContextInitializer.java:52)
        at org.springframework.sbm.engine.commands.ScanCommand.execute(ScanCommand.java:70)
        at org.springframework.sbm.SpringBootMigratorRunner.run(SpringBootMigratorRunner.java:48)
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762)
        ... 13 more
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\<username>\.m2\repository/org/springframework/boot/spring-boot-starter-parent/2.7.5/spring-boot-starter-parent-2.7.5.pom
        at java.base/java.net.URI$Parser.fail(URI.java:2974)
        at java.base/java.net.URI$Parser.parseAuthority(URI.java:3308)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3219)
        at java.base/java.net.URI$Parser.parse(URI.java:3175)
        at java.base/java.net.URI.<init>(URI.java:623)
        at java.base/java.net.URI.create(URI.java:904)
        ... 26 more

由于 .m2 是在构建应用程序时生成的,不确定生成的文件有什么问题。甚至尝试删除 .m2 文件夹并再次构建,但没有任何效果。

spring-boot migration illegalargumentexception
1个回答
0
投票

我也有同样的问题,正在努力解决。即使像您一样删除 .m2 存储库并确保本地存储库配置正确,同样的问题仍然存在。

© www.soinside.com 2019 - 2024. All rights reserved.