About Me

My photo
Working as Technical Lead in CollabNET software private limited.
Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Tuesday, 26 October 2010

"Lockness" eclipse thread dump analysis plugin

There is a eclipse plugin "Lockness" for thread dump analysis (http://lockness.plugin.free.fr/setup.php). Using this we can analyze the thread locks to diagonalize the problems. To download (http://lockness.plugin.free.fr/archive/com.cr.lockness.Lockness_3.0.0.jar), put this jar to eclipse3.x/plugins dir and restart eclipse.

How to take a thread dump:

Sending "kill -3 signal to the JBOSS/TOMCAT process" will give you the whole thread dump. Ex: kill -3 #### -> process id.

After executing the above command, you can find thread dump in catalina.out for tomcat or server.log for jboss.

You've to trim the thread dump contents exactly from above log files, such that the dump file starts with "Full thread dump" and end with "VM Thread".

Also, if you have some timestamps added in thread dump, you can trim that using below cut command. For ex: say each line has some time stamps added like "2010-10-25 13:29:23 PDT", then to skip the first 3 columns. Use below command

cat threaddump.txt | cut -d " " -f4- > cut_file_threaddump.txt

The above command will skip first 3 columns and saves rest of the columns what we needed to cut_file_threaddump.txt.

Then from eclipse, create a new java project, create folder pointing to above create dump dir and opening this using "Lockness" thread dump analyser plugin will give you the analysis.

Monday, 25 February 2008

Debug Java Application or Java Web Application using Eclipse

Steps To Configure Java Application with eclipse

1. Append below parameters to JVM_ARGUMENTS of the Application

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,
address=5050


2. Configure your Eclipse Debugger.

Go to project source.
Place Break Points in Project source where ever needed.
Go to Project > Run > Open Debug Dialog
Create new Remote Java Application with corresponding parameter
Host - Application Host IP
Port - Port specified in JVM_ARGUMENTS of Application.
Click Debug

3. Access your application.