1

I can successfully attach many other agents at runtime using ByteBuddyAgent (byte-buddy-agent), but for some reason JRebel fails.

Caused by: com.sun.tools.attach.AgentLoadException: Failed to load agent library: _Agent_OnAttach@12 is not available in C:\JRebel\lib\jrebel64.dll
    at jdk.attach/sun.tools.attach.VirtualMachineImpl.execute(VirtualMachineImpl.java:126)
Caused by: com.sun.tools.attach.AgentLoadException: Failed to load agent library: _Agent_OnAttach@12 is not available in C:\JRebel\lib\jrebel64.dll

    at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:94)
    at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentPath(HotSpotVirtualMachine.java:128)
    ... 11 more

Is there any way I can get around this? Because I'd like to attach JRebel only after certain initialization steps occur in my program.

Jire
  • 9,680
  • 14
  • 52
  • 87

2 Answers2

1

I assume that Byte Buddy loads classes that JRebel expects to be unloaded. This might not be possible. Get in touch with JRebel to see if they can extract a more helpful error message to possibly resolve this.

Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
1

The JRebel agent cannot be attached at runtime as the tool itself has to complete many initialization procedures.

Can I ask why you need the JRebel agent needs to be attached after certain initialization steps?

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 21 '21 at 18:29