You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ运行Spring Boot应用报错:Failed to init Reactor's debug agent

Fix: Failed to init Reactor's debug agent when starting Spring Boot in IntelliJ

I've run into this exact issue before—your app works fine with mvn spring-boot:run but throws that reactor debug agent error in IntelliJ's run/debug mode, and removing reactor-tools fixes it. Here's what's going on and how to solve it without ditching the dependency:

Why This Happens

The reactor-tools JAR includes a Java agent that needs to be loaded early in the JVM startup process. The Spring Boot Maven plugin automatically handles setting up this agent when you run spring-boot:run, but IntelliJ's default Spring Boot run configuration doesn't add the required JVM argument by default, leading to the initialization failure.

Solutions

1. Add the Java Agent Argument to IntelliJ's Run Configuration

This is the quickest fix for IntelliJ-specific runs:

  • Open your Spring Boot run configuration (Run > Edit Configurations...)
  • Find the VM options field
  • Add the following argument, replacing {version} with the actual version of reactor-tools in your pom.xml:
    -javaagent:~/.m2/repository/io/projectreactor/reactor-tools/{version}/reactor-tools-{version}.jar
    
    (If you're on Windows, use C:\Users\{your-user}\.m2\repository\... instead of the ~ path)

Spring Boot has built-in support for enabling the Reactor debug agent automatically—you just need to flip a config switch. Add this to your application.properties:

spring.reactor.debug-agent.enabled=true

Or if you use YAML (application.yml):

spring:
  reactor:
    debug-agent:
      enabled: true

This way, Spring Boot will handle loading the agent correctly regardless of whether you start via Maven or IntelliJ, no manual JVM args needed.

3. Configure the Spring Boot Maven Plugin to Pass the Agent

If you prefer to keep your Maven and IntelliJ environments aligned, update your pom.xml to include the agent argument in the Spring Boot plugin:

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <jvmArguments>-javaagent:~/.m2/repository/io/projectreactor/reactor-tools/{version}/reactor-tools-{version}.jar</jvmArguments>
      </configuration>
    </plugin>
  </plugins>
</build>

Then, in IntelliJ, use the spring-boot:run Maven goal as your run configuration instead of the default Spring Boot option.

4. Check IntelliJ's Proxy Settings

Occasionally, IntelliJ's HTTP proxy can interfere with the agent's initialization. Head to File > Settings > Appearance & Behavior > System Settings > HTTP Proxy and either:

  • Verify your proxy settings are correct (if you need a proxy)
  • Temporarily disable the proxy to test if that resolves the issue

Verification

After applying any of these fixes, restart your app via IntelliJ's run/debug mode. If the Failed to init Reactor's debug agent error is gone and your app starts normally, you're good to go!

内容的提问来源于stack exchange,提问作者Alex Yates

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 16:17:37