jps and jstat for tomcat on jdk-1.6.0_24
Fri, 03/25/2011 - 16:53 — sandipRecently upgrading to java version "1.6.0_24", jps and jstat seemed to be broken to get monitoring information from running tomcat process.
By default java.io.tmpdir is /tmp, however tomcat usually uses it's own temp directory. That is where jps/jstat looks for hsperfdata_* dirs. If java.io.tmpdir is not set, it would look in /tmp. If jps can't find the hsperfdata directory, it won't report anything.
jps/jstat however allows to specify java.io.tmpdir in case you're using a JVM that places those directories in a different location.
So to get it to work:
$JAVA_HOME/bin/jps -J-Djava.io.tmpdir=/path/to/to mcat/temp -l
$JAVA_HOME/bin/jstat -J-Djava.io.tmpdir=/path/to/to mcat/temp -gc $PID
- sandip's blog
- Login or register to post comments
- Read more
Importing existing SSL key and certificate for tomcat
Fri, 07/25/2008 - 16:50 — sandip-
Convert key and cert to a single pkcs12 format.
openssl pkcs12 -export -inkey <pathto>/key.txt -in <pathto>/cert.txt -out cert.pkcs12
keytool -delete -alias tomcat -keystore <pathto>/cacerts
keytool -importkeystore -destkeystore cacerts -srckeystore cert.pkcs12 -srcstoretype PKCS12
keytool -list -keystore <pathto>/cacerts | grep PrivateKeyEntry
keytool -changealias -alias 1 -destalias tomcat -keystore <pathto>/cacerts