Jire
Jire

Reputation: 10270

JRebel: Attaching the agent at runtime?

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.

Upvotes: 1

Views: 197

Answers (2)

user16966933
user16966933

Reputation: 11

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?

Upvotes: 1

Rafael Winterhalter
Rafael Winterhalter

Reputation: 43972

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.

Upvotes: 1

Related Questions