Tuesday, July 2, 2013

configure linux tomcat for jpda debugging and rmi management through intellij

create/modify setenv.sh and add the following entries

JAVA_HOME=/usr/java/default

CATALINA_OPTS="-Dcom.sun.management.jmxremote\
   -Dcom.sun.management.jmxremote.port=13091\
   -Dcom.sun.management.jmxremote.ssl=false\
   -Dcom.sun.management.jmxremote.authenticate=false\
   -Djava.rmi.server.hostname=localhost\
   -javaagent:/intellijsharedlibs/groovyhotswap/gragent.jar
   -Xdebug -Xrunjdwp:transport=dt_socket,address=54391,suspend=n,server=y"

JPDA_OPTS="-Xrunjdwp:jdwp=transport=dt_socket,address=54391,server=y,suspend=n"

JAVA_OPTS="$JAVA_OPTS \
   -XX:+CMSClassUnloadingEnabled  \
   -XX:+UseConcMarkSweepGC \
   -XX:MaxPermSize=1024m \
   -XX:PermSize=512m \
   -Djavax.net.ssl.trustStore=$pathtokeystore \
   -Djavax.net.ssl.trustStorePassword=changeit"

Monday, July 1, 2013

remote debug a locally hosted tomcat instance on intellij

tomcat:
open tomcat's service manager and go into the java tab

configure jdwp to use intellij settings. this will enable intellij to publish artifacts into tomcat make sure each directive is in its own line

-Xdebug
-Xrunjdwp:transport=dt_socket,address=54312,suspend=n,server=y
-javaagent:C:\Users\uye\.IntelliJIdea12\system\groovyHotSwap\gragent.jar

configure rmi and debugging
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=fxdms-hp

intellij:
create a new remote tomcat server
under the server tab, configure and pick tomcat's binaries
set jmx port to 1099
set remote staging>type to Same file system
under remote connection settings set host to localhost and port to 8080