Thursday, September 13, 2012

Eclipse Tomcat debugging for Alfresco 4

How to enable debugging in Tomcat 6.0.35 for Alfresco 4.0.2
  
Configure the tomcat the jpda start option 
Go to the following directory in the command window.

c:\alfresco\tomcat\bin directory and create the following environment variables. 
(Adjust the memory to overcome permGen memory issue.)
set CATALINA_OPTS=-server -Xmx384m -XX:MaxPermSize=192m  
set JPDA_ADDRESS=8000 and press enter
set JPDA_TRANSPORT=dt_socket and press enter

Now we need to start tomcat in debug mode. 
c:\alfresco\tomcat\bin>catalina.bat jpda start

Now open Eclipse and open your project.

Go to Run menu -->Debug configuration-->Remote Java application-->New Launch Configuration-->Select your Project here--> [Don't do anything appart from this] check the box marked "Allow termination of remote JVM" --> Click Apply--> Click Debug button.

Now, eclipse will the window perspective to Debug perspective and if you've the breakpoints in your code, the debugger will hit it.

Thanks !








1 comment: