Код: Выделить всё
VirtualMachine vm = VirtualMachine.attach(pid); vm.loadAgent(agent_jar_path);
Трассировка стека:
Код: Выделить всё
Caused by: com.sun.tools.attach.AgentLoadException: 102
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:113) ~[jdk.attach:na]
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:124) ~[jdk.attach:na]
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:152) ~[jdk.attach:na]
at jdk.attach/com.sun.tools.attach.VirtualMachine.loadAgent(VirtualMachine.java:538) ~[jdk.attach:na]
Код: Выделить всё
int rc = x.returnValue();
switch (rc) {
case JNI_ENOMEM:
throw new AgentLoadException("Insuffient memory");
case ATTACH_ERROR_BADJAR:
throw new AgentLoadException(
"Agent JAR not found or no Agent-Class attribute");
case ATTACH_ERROR_NOTONCP:
throw new AgentLoadException(
"Unable to add JAR file to system class path");
case ATTACH_ERROR_STARTFAIL: ( 102 )
throw new AgentInitializationException(
"Agent JAR loaded but agent failed to initialize");
default :
throw new AgentLoadException("" +
"Failed to load agent - unknown reason: " + rc);
}
Может ли кто-нибудь помочь мне это исправить? Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/791 ... 102-java21