I am trying to Integrate Jprofiler 8.1.4 with jenkins using offline profiling API of JProfiler. Below is the program written to
- Start JProfiler Recording.
- Save Snapshot.
Stop JProfiler Recording.
import java.io.File; import java.io.IOException;
public class TestJenJPIntegration { public static Connection connObj = null; public static void recordCPUdata() throws java.io.IOException, InterruptedException{
File fileObj; fileObj = new File("C:\\Perl\\firstSnap.jps"); Controller.startCPURecording(true); System.out.println("CPU recording started.."); Controller.saveSnapshot(fileObj); System.out.println("Saved snapshot"); Controller.stopCPURecording(); System.out.println("CPU recording stopped.."); } public static void main(String[] args) throws IOException, InterruptedException { try { recordCPUdata(); } catch (IOException e) { e.printStackTrace(); } }}
The Jprofiler tool works fine manually to start recording, save snapshot and stop recording. But when i Execute the Program I get the following Error Message UnsatisfiedLinkError :
- I used the Demo Server Profiling which was available in the JProfiler itself. And I am Profiling in the same system where the Demo Application runs.
- NOTE: The server and client are using the same JProfilerTI.dll would this be a problem.
java.lang.UnsatisfiedLinkError: com.jprofiler.agent.InterceptionCallee.registerI nterceptions0(Z[Lcom/jprofiler/agent/util/h;Ljava/lang/reflect/Field;Ljava/lang/ reflect/Field;Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;Ljava/lang/refle ct/Field;Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;Ljava/lang/reflect/Fi eld;Ljava/lang/reflect/Field;Ljava/lang/Class;Ljava/lang/reflect/Method;Ljava/la ng/reflect/Method;)V at com.jprofiler.agent.InterceptionCallee.registerInterceptions0(Native Method) at com.jprofiler.agent.InterceptionCallee.registerInterceptions(ejt:152)
at com.jprofiler.agent.probe.y.a(ejt:181)
at com.jprofiler.agent.probe.y.a(ejt:37)
at com.jprofiler.agent.Agent.initStatic(ejt:320)
at com.jprofiler.agent.Agent.<clinit>(ejt:98)
at com.jprofiler.agent.ControllerImpl.startCPURecording(ejt:53)
at com.jprofiler.api.agent.Controller.startCPURecording(ejt:108)
at TestJenJPIntegration.recordCPUdata(TestJenJPIntegration.java:24)
at TestJenJPIntegration.main(TestJenJPIntegration.java:45)
JProfiler> Native library not found. Ignoring controller call.
/Users Printed Statement/
CPU recording started..
Exception in thread "_jprofiler_offline_comm" java.lang.UnsatisfiedLinkError: co
m.jprofiler.agent.ControllerImpl.saveSnapshot0([BLjava/lang/Object;)V
at com.jprofiler.agent.ControllerImpl.saveSnapshot0(Native Method)
at com.jprofiler.agent.ControllerImpl.access$100(ejt:18)
at com.jprofiler.agent.h.run(ejt:186)
/Users Printed Statement/ Saved snapshot
JProfiler> Native library not found. Ignoring controller call.
/Users Printed Statement/ CPU recording stopped..