We are currently using JProfiler 8.0.4 in Prepare for Profiling" mode on our Cent OS machines together with Tomcat 6 and Java 7. We use JProfiler with a floating license. We extracted the JProfiler Linux Archive on the remote servers.
Tomcat is managed by Tanuki Wrapper. Here is our Config
wrapper.java.additional.101=-agentpath:${jprofiler.path}/bin/linux-x64/libjprofilerti.so=port=8849,nowait
This works well and when starting up we find this in the logs
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Don't wait for frontend to connect.
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Protocol version 38
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> Using JVMTI
INFO | jvm 1 | main | 2014/03/04 10:06:41.872 | JProfiler> JVMTI version 1.1 detected.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> 64-bit library
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Starting up without initial configuration.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Listening on port: 8849.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Instrumenting native methods.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Can retransform classes.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Can retransform any class.
INFO | jvm 1 | main | 2014/03/04 10:06:41.873 | JProfiler> Native library initialized
INFO | jvm 1 | main | 2014/03/04 10:06:42.074 | JProfiler> VM initialized
Finally we are connecting with our JProfiler Clients to the agents and everythings fine.
As mentioned in 1
, it's also possible to append ,config=[config file] and ,id=[id] parameters to instruct the profiling agent to take the profiling settings from a particular session in a particular config file. If you connect with the same profiling settings, no classes will have to be retransformed.
but if we add config and id like this
wrapper.java.additional.101=-agentpath:${jprofiler.path}/bin/linux-x64/libjprofilerti.so=port=8849,nowait,id=${jprofiler.id},config=${jprofiler.config.path} the VM cannot start up because JProfiler asks for an license.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Don't wait for frontend to connect.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Protocol version 38
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Using JVMTI
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> JVMTI version 1.1 detected.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> 64-bit library
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Using config file /path/to/config/jprofiler-config.xml (id: 100)
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Listening on port: 8849.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Instrumenting native methods.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Can retransform classes.
INFO | jvm 5 | main | 2014/03/04 10:05:30.475 | JProfiler> Can retransform any class.
INFO | jvm 5 | main | 2014/03/04 10:05:30.476 | JProfiler> Native library initialized
ERROR | wrapper | main | 2014/03/04 10:05:30.614 | JVM exited while loading the application.
INFO | jvm 5 | main | 2014/03/04 10:05:30.614 | JProfiler> VM initialized
INFO | jvm 5 | main | 2014/03/04 10:05:30.614 | JProfiler> Using dynamic instrumentation
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> Time measurement: elapsed time
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> CPU profiling enabled
INFO | jvm 5 | main | 2014/03/04 10:05:30.615 | JProfiler> ERROR: Invalid license key.
Here are my questions:
- Anyone knows how to tell the agent about the license?
- Anyone used this settings in a production setup?
Regards,
Andreas