Thursday 10 December 2015

Web Logic Debug Mode

Go to the path C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\bin

1.       Copy startWebLogic.cmd file at the same location with name startWebLogic_debug.cmd.

Search for %JAVA_HOME%\bin\java %JAVA_VM% -version in the startWebLogic_debug.cmd file.

Add below 2 lines after this line:

echo "Launching Java with debug port: 8453"
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xdebug -Djava.compiler=NONE -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8453,suspend=n

2.       Copy startManagedWebLogic.cmd at the same location with name startManagedWebLogic_debug.cmd

Search for ‘startWeblogic.cmd’ in startManagedWebLogic_debug.cmd file and replace it with startWeblogic_debug.cmd.

Please find below the changes for reference:
               
                if "%1"=="" (
                                @REM  Call Weblogic Server with our default params since the user did not specify any other ones
                                call "%DOMAIN_HOME%\bin\startWeblogic_Debug.cmd" nodebug noderby noiterativedev notestconsole noLogErrorsToConsole
) else (
                                @REM  Call Weblogic Server with the params the user sent in INSTEAD of the defaults
                                call "%DOMAIN_HOME%\bin\startWeblogic_Debug.cmd" %1 %2 %3 %4 %5 %6 %7 %8 %9
)
               
3.       Now, start the server using the newly created startWeblogic_Debug.cmd file.

4.       Once the server is started, do the following changes in eclipse:

i.                     Click on  Run –> Debug Configurations ->Remote Java Application ->New launch configuration
ii.                   Give the following details:
Name: Any name say Test
Project : Browse and select the required project where the file that needs to be debugged.
Port : 8453

iii.                  Click on Apply and Debug.