在Java虚拟机中使用loadagent时出错

时间:2016-12-30 16:48:50

标签: java

在虚拟机中加载代理时遇到以下错误。 任何人都可以帮助解决这个错误的原因吗?

代理商代码

    VirtualMachine localVirtualMachine = VirtualMachine.attach(pid);
    localVirtualMachine.loadAgent(agentPath);       
    localVirtualMachine.detach();


Agent:
    static {
          try {
              java.security.AccessController.doPrivileged(
                      new java.security.PrivilegedAction() {
                          public Object run() {                       
                              System.loadLibrary("JavaAccessBridge-64");
                              return null;
                          }
                      });
          } catch (Throwable e) {
              System.out.println("Exception ");
              e.printStackTrace();
              System.out.println("Exception ");

          }
            }
  

C:\ Users \ mahendra> java -jar C:\ Users \ mahendra \ Desktop \ SwingSet2.jar   线程中的异常"附加监听器" java.lang.UnsatisfiedLinkError中:   Native Lib rary C:\ Program   已加载Files \ Java \ jre1.8.0_112 \ bin \ JavaAccessBridge-64.dll   另一个类加载器           at java.lang.ClassLoader.loadLibrary0(Unknown Source)           at java.lang.ClassLoader.loadLibrary(Unknown Source)           at java.lang.Runtime.loadLibrary0(Unknown Source)           在java.lang.System.loadLibrary(未知来源)           在Test.TestBridge $ 1.run(TestBridge.java:5857)           at java.security.AccessController.doPrivileged(Native Method)           在Test.TestBridge。(TestBridge.java:5848)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)           at java.lang.reflect.Method.invoke(Unknown Source)           at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Sou   RCE)           at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(未知   来源)代理无法启动!

0 个答案:

没有答案