0

I have a web app running inside my tomcat on my windows machine. I am trying to monitor it with Java Mission Control. I am getting an error message to unlock commercial features to access java flight recorder.. Please guide me where and how it needs to be enabled. Thanks in advance..

yash
  • 23
  • 2
  • 6
  • you have to start your app with some parameters: https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/run.htm#JFRUH176 – Eugene May 29 '18 at 11:10
  • Thanks Eugene for the prompt reply.. But this is what I am struggling with.. How to start my app with those parameters.. This is what I was trying with but all in vain..C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>java -XX:+UnlockCommercialFeatures -XX:+F lightRecorder -XX:StartFlightRecording=duration=60s,filename=myrecording.jrf startup.bat Could not start recording, not able to write to file "myrecording.jrf" Error: Could not find or load main class startup.bat – yash May 29 '18 at 11:39
  • that is not how you do it... I bet the `startup.bat` is the file that *starts* tomcat and inside it there is the `java` command – Eugene May 29 '18 at 12:03
  • Sorry Eugene, but I will bug you more on this.... I am trying to do flight recording for JMeter. As soon as I start flight recording from JMC I see an error message to Unlock commerical features in JVM first to proceed.. Where should I go to unlock the commercial features and how should I launch JMeter. As of now to launch Jmeter I go to the bin directory and open jmeter.bat file. – yash May 30 '18 at 09:47
  • this is *not* about JMeter or Tomcat - I hoped you understood it by now. these are java processes that start with `java ... ` and some commands, what you have to do is add a few commands for the `JFR` – Eugene May 30 '18 at 09:53
  • Finally was able to do it. thanks a lot.. – yash May 30 '18 at 12:14
  • Possible duplicate of [Passing JVM arguments to Tomcat when running as a service?](https://stackoverflow.com/questions/6225682/passing-jvm-arguments-to-tomcat-when-running-as-a-service) – Vadzim Apr 25 '19 at 16:00

1 Answers1

0

You might try setting the CATALINA_OPTS environment variable, e.g.:

set CATALINA_OPTS=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.rmi.port=7091 -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

Then start Tomcat as usual.

kc2001
  • 5,008
  • 4
  • 51
  • 92