Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Remote Management By JConsole


Getting trouble while connecting jconsole with remote process

Here is how to achieve it

As described here http://docs.oracle.com/javase/tutorial/jmx/remote/jconsole.html is not enough

sometimes one more java system property needs to be set which is
java.rmi.server.hostname=

for example in case of Apache Tomcat
follow this
1) Export JAVA_OPTS
export JAVA_OPTS='-Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.1.13'

2) Restart application

3) now from the jconsole connect to 192.168.1.13:9999 by providing credentials

Note : Firewall should be configured to allow these connections (or simply for the time stop iptables services (in linux))

Ref : http://stackoverflow.com/questions/1263991/connecting-remote-tomcat-jmx-instance-using-jconsole

Project Lombok for Java


Project Lombok is a very good for keeping your class clean.
Use Annotation for most of the common things like getter/setter, equals, hashCode, toString etc.
If you gonna start a project from scratch, just give it a try.
learn more at Lombok Features
Watch video