The way you set it up initially is what I'd thought would have done the trick. Perhaps we're not ordering the arguments in the same manner supplied. Will need to look into that.
Thanks Joe On Wed, Dec 14, 2016 at 9:00 PM, Russell Bateman <[email protected]> wrote: > Of course, as many have done, I've run Java applications with JFR enabled > using these options against this very JVM (jdk1.8.0_112). So, it isn't a > problem for the JVM I'm using. I haven't finished digging down into > ProcessBuilder, or deeper, to figure out why these options are not getting > love. I'll get back at it tomorrow and report back. > > > On 12/14/2016 11:05 AM, Russell Bateman wrote: >> >> >> I've doctored /conf/bootstrap.conf/ to contain these additional lines: >> >> java.arg.15=-XX:+UnlockCommercialFeatures >> java.arg.16=-XX:+FlightRecorder >> >> java.arg.17=-XX:StartFlightRecording=duration=120m,filename=recording.jfr >> >> >> In the end, NiFi's grumpy about this and won't start (from >> /logs/nifi-bootstrap.log/): >> >> 2016-12-14 10:39:36,489 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: *To use 'FlightRecorder', first unlock using >> -XX:+UnlockCommercialFeatures.* >> 2016-12-14 10:39:36,489 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: Could not create the Java Virtual Machine. >> 2016-12-14 10:39:36,489 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: A fatal exception has occurred. Program will >> exit. >> 2016-12-14 10:39:36,507 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi >> never started. Will not restart NiFi >> >> I tried using all options as one (in case the order is disturbed, which it >> was): >> >> >> java.arg.15=-XX:+UnlockCommercialFeatures-XX:+FlightRecorder-XX:StartFlightRecording=duration=120m,filename=recording.jfr >> >> >> and then I get: >> >> *2016-12-14 10:50:07,574 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Unrecognized VM option 'UnlockCommercialFeatures >> -XX:+FlightRecorder >> -XX:StartFlightRecording=duration=120m,filename=recording.jfr'* >> 2016-12-14 10:50:07,574 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: Could not create the Java Virtual Machine. >> 2016-12-14 10:50:07,574 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: A fatal exception has occurred. Program will >> exit. >> 2016-12-14 10:50:07,598 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi >> never started. Will not restart NiFi >> >> Here's the second command line from /logs/nifi-bootstrap.log/, which I've >> wrapped for convenience in reading (see JVM version here too): >> >> 2016-12-14 10:56:40,526 INFO [main] org.apache.nifi.bootstrap.Command >> Working Directory: /home/russ/dev/nifi/nifi-1.1.0 >> 2016-12-14 10:56:40,526 INFO [main] org.apache.nifi.bootstrap.Command >> Command: */home/russ/dev/jdk1.8.0_112/bin/java* >> -classpath >> /home/russ/dev/nifi/nifi-1.1.0/./conf:/home/russ/dev/nifi/nifi-1.1.0/./lib/jcl-over-slf4j-1.7.12.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/logback-core-1.1.3.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-documentation-1.1.0.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-nar-utils-1.1.0.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/logback-classic-1.1.3.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/jul-to-slf4j-1.7.12.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-runtime-1.1.0.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/slf4j-api-1.7.12.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-api-1.1.0.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-framework-api-1.1.0.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/log4j-over-slf4j-1.7.12.jar:/home/russ/dev/nifi/nifi-1.1.0/./lib/nifi-properties-1.1.0.jar >> -Dorg.apache.jasper.compiler.disablejsr199=true >> -Xmx512m >> -Xms512m >> -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9191 >> *-XX:+UnlockCommercialFeatures >> -XX:+FlightRecorder >> -XX:StartFlightRecording=duration=120m,filename=recording.jfr* >> -Dsun.net.http.allowRestrictedHeaders=true >> -Djava.net.preferIPv4Stack=true >> -Djava.awt.headless=true >> -XX:+UseG1GC >> -Djava.protocol.handler.pkgs=sun.net.www.protocol >> >> -Dnifi.properties.file.path=/home/russ/dev/nifi/nifi-1.1.0/./conf/nifi.properties >> -Dnifi.bootstrap.listen.port=41736 >> -Dapp=NiFi >> >> -Dorg.apache.nifi.bootstrap.config.log.dir=/home/russ/dev/nifi/nifi-1.1.0/logs >> org.apache.nifi.NiFi >> >> Last, I frantically tried this: >> >> java.arg.15="-XX:+UnlockCommercialFeatures -XX:+FlightRecorder >> -XX:StartFlightRecording=duration=120m,filename=recording.jfr" >> >> >> and then got: >> >> *2016-12-14 11:01:36,659 ERROR [NiFi logging handler] >> org.apache.nifi.StdErr Error: Could not find or load main class >> "-XX:+UnlockCommercialFeatures -XX:+FlightRecorder >> -XX:StartFlightRecording=duration=120m,filename=recording.jfr"* >> >> >> What's the canonical way of adding/inserting my own JVM commands? >> Alternatively, is NiFi analyzing and blocking -XX:arguments to the JVM as >> illegal or unrecognized? >> >> Thanks, >> >> Russ > >
