Remote Debugging on WebLogic

Debugging Fabric3 on WebLogic is no different than debugging any other remote Java application. All that needs to be done is to run WebLogic in DEVELOPMENT mode and attach the debugger to the specified port. To do it, follow the steps given below.

1. Configure your Fabric3 runtime according to the steps given here.

2. Set up your WLS domain.

3. WebLogic 10.3 comes with several startup scripts, available under <DOMAIN_DIR>/bin. The most important is setDomainEnv.cmd or setDomainEnv.sh, for Windows or *nix, respectively. According to the value of the 'debugFlag' variable, WLS instance can be run with the necessary arguments for remote debugging. When set to 'true', the following arguments are added:

JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE

The default value of DEBUG_PORT is 8453.

Set the 'debugFlag' to true and start WLS domain. As a result, the following lines should be shown in the console among others:

Starting WLS with line:
D:\oracle\MIDDLE~1\JDK160~1\bin\java -client -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE
-Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -Dweblogic.Name=AdminServer -Djava.security.policy=D:\oracle\
MIDDLE~1\WLSERV~1.5\server\lib\weblogic.policy -Dfabric3.home=d:\oracle\Middleware\fabric3 -Dfabric3.mode=vm -Xverify:none  -ea -da:com.bea...
-da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=D:\oracle\MIDDLE~1\WLSERV~1.5
-Dwls.home=D:\oracle\MIDDLE~1\WLSERV~1.5\server -Dweblogic.home=D:\oracle\MIDDLE~1\WLSERV~1.5\server  -Dweblogic.management.discover=true
-Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.
soap.ver1_1.SOAPMessageFactory1_1Impl -Djavax.xml.soap.SOAPConnectionFactory=weblogic.wsee.saaj.SOAPConnectionFactoryImpl -Dweblogic.ext.dirs=
D:\oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;D:\oracle\MIDDLE~1\patch_oepe1050\profiles\default\sysext_manifest_classpath
weblogic.Server
Listening for transport dt_socket at address: 8453

4. Run Eclipse.

5. Create new Remote Java Application configuration and enter necessart values, especially server IP address and the debug port the server listens on:

6. Click 'Apply' and 'Debug'. Your debugger should be attached to the remote JVM and you should be able to set breakpoints, inpsct variables, trace the code and so on.