Wednesday, July 27, 2011

Start WebLogic Server in debug mode

To be able to start the WLS in debug mode you normally need to add the following line to the JAVA_OPTIONS:

set REMOTE_DEBUG_ OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

Now there is even more easier way to do so but just modifying the setDomainEnv.sh and put the following line:

 

1 debugFlag="true"
2 export debugFlag
3

Make sure that you put this line in front of the following part of the script:


 


1 if [ "${debugFlag}" = "true" ] ; then
2 JAVA_DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=${DEBUG_PORT},server=y,suspend=n -Djava.compiler=NONE"
3 export JAVA_DEBUG
4 JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole..."
5 export JAVA_OPTIONS
6 else
7 JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -da"
8 export JAVA_OPTIONS
9 fi
10


otherwise the debug mode is not going to switch on.


The default debugging port will be 8453, but you can change it by adding this on the top of the script file:


1 DEBUG_PORT="4000"
2 export DEBUG_PORT
3

6 comments:

  1. Hello,

    I tried doing that for WLS 10.3.5, and got below error when starting the server in debug mode,

    Starting WLS with line:
    C:\PROGRA~1\Java\JDK16~1.0_3\bin\java -client -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms256m -Xmx1024m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -DQ5INSTANCEID=1 -DQ5PINTRANSACTIONS=true -DSTPBULKSIZE=100 -DQ5CACHEFILTER=com.dovetailsys.shared.util.CacheFilter -DQ5CACHEOBJECTS=1024 -Dperform.bic.lookup=yes -Dperform.iban.validation=no -DQ5TRANSACTION_TIMEOUT=600 -DDEFAULT_GATEWAY_ROOT=/gateway -Xverify:none -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=C:\oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;C:\oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 weblogic.Server
    Error occurred during initialization of VM
    agent library failed to init: jdwp
    ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.

    ReplyDelete
    Replies
    1. Hi there,
      I am not sure about that, where did you put your debug line, I would propose you to go for this or check if this one already exist:

      JAVA_OPTIONS="${SAVE_JAVA_OPTIONS} -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"

      Regards,
      Lyudmil

      Delete
  2. Nice post! I like the Cookbook format.

    ReplyDelete
  3. Hi Lyudmil,

    We have migrated our oracle webcenter server to different windows domain controller, it has still the old domain users. When I logged with new domain user and trying to start the AdminServer its not
    starting. If I logged with old domain user its starting the AdminServer, node manager and UCM.
    Can you kindly suggest where I can look into?

    Thanks and Regards,
    Lpathi

    ReplyDelete