我正在把应用程序从JVM 8升级到11,我遇到了一些问题。
@SpringBootApplication
@Slf4j
@Import(SwaggerCustomConfig.class)
public class RequisitesApplication {
public static void main(String[] args) {
ReactorDebugAgent.init();
SpringApplication.run(RequisitesApplication.class, args);
}
}
当我尝试运行应用程序时,出现了一个catch IllegalStateException:
Exception in thread "main" java.lang.IllegalStateException: Could not self-attach to current VM using external process
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:695)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:626)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:606)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:558)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:535)
at reactor.tools.agent.ReactorDebugAgent.init(ReactorDebugAgent.java:56)
at ru.gazprombank.omni.pcidss.RequisitesApplication.main(RequisitesApplication.java:23)
当我深入到堆栈跟踪时,我发现,ByteBuddyAgent.class中捕获了此异常:
if ((new ProcessBuilder(new String[]{System.getProperty("java.home") + File.separatorChar + "bin" + File.separatorChar + (System.getProperty("os.name", "").toLowerCase(Locale.US).contains("windows") ? "java.exe" : "java"), "-cp", classPath.toString(), Attacher.class.getName(), externalAttachment.getVirtualMachineType(), processId, quote(agent.getAbsolutePath()), Boolean.toString(isNative), argument == null ? "" : "=" + argument})).start().waitFor() != 0) {
throw new IllegalStateException("Could not self-attach to current VM using external process");
}
在我的Intellij Idea项目设置,平台设置和Gradle设置我安装并选择11版本。请,帮助我解决这个问题。
1条答案
按热度按时间ql3eal8s1#
我解决了这个问题。在@SpringBootApplication类中,我有ReactorDebugAgent.init();我不知道为什么,但没有ReactorDebugAgent,它就可以工作