Monday, January 2, 2012

setting debug port in the Tomcat and weblogic

Tomcat
adding this stuff to your startup script so that you are always running tomcat in debug mode.
  1. Open the startup script in (your_tomcat_home)/bin (WIN: startup.bat, UNIX: startup.sh)
  2. Add the following lines at the first blank line in the file (around line 8)
    WIN:
    set JPDA_ADDRESS=8000
    set JPDA_TRANSPORT=dt_socket
    
    UNIX:
    export JPDA_ADDRESS=8000
    export JPDA_TRANSPORT=dt_socket
    
  3. Change the execute line at the end to include jpda start
    WIN:
    call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
    
    UNIX:
    exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
    
  4. Run the startup script when starting tomcat to run tomcat in debug mode
Weblogic
    use the following points to enable the debug port
  1. go to the domain in the weblogic
  2. open the bin
  3. edit the setDomainEnv.sh
  4. past the JAVA_DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8087,server=y,suspend=n -Djava.compiler=NONE"
  5. then execute the startWeblogic.sh