Attach Tomcat出现的问题,求指教
巴海和
2014-08-30
Java版本为openjdk 1.6.0_17, tomcat版本为7.0.12,本人为获取tomcat运行时的字节码,采用了agentmain,其基本思路是将获取的class文件的字节流发送特定的端口,但是出现了如下的问题:特定端口所在的进程显示
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) at com.sun.tools.attach.VirtualMachine.loadAgent(VirtualMachine.java:526) at tjvm.executor.Attach.attach(Attach.java:21) at tjvm.ServiceMonitor.ServiceMonitor.run(ServiceMonitor.java:62) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) tomcat的显示如下的问题: Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343) at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:368) Caused by: java.lang.InternalError at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144) at agentmain.Agent.agentmain(Agent.java:21) ... 6 more 请问这是什么缘故呀,3ks。 |