Tuesday, August 30, 2011

Remote Debugging Eclipse Indigo & JBOSS 5.4

I am tired of putting logs and trying to identify the errors or track various stuff. So I decided to configure remote debugging for my project which is running in JBOSS server.

The steps to configure is given below.
  1. Make a backup copy of your current JBoss run.bat
  2. Open run.bat and find the lines that look like this:
    1rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
    2rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
  3. Uncomment the second line by deleting "rem", and save.
  4. Start Jboss. (It won’t do much until you connect a debugger to it.)
  5. In Eclipse, open your project, and on the toolbar click on the debugger bug arrow, then Open Debug Dialog. If you couldn't find it quickly, Go to Run, Debug Configurations , Select Java Remote Debugger and Click on New.
  6. Choose Remote Java Application, right-click, New… and update the port to the address in the line you uncommented (possibly 8787).
  7. Click Debug
  8. Set a breakpoint somewhere in your code or a library that has source attached
  9. Exercise your project (via a web service, for instance) and when it hits one of your breakpoints, it will break in Eclipse.

Saturday, August 27, 2011

How to check file size of directories in UNIX

#check partition sizes df -h  #check directory size du -s -h /var/log/  #check every directory and file sizes under a dir. du -s -h /var/log/*  #check individual size size du -s -h /var/log/lastlog