Enabling debugging for a Node in Weblogic Cluster

2.9k views Asked by At

I have a Weblogic (10.3.5) AdminServer instance and two nodes running as a part of the cluster.

I followed the instructions on this page and added a setting in startweblogic.cmd to enable debugging at port 4000. All is fine and I'm able to connect to this port to debug.

But when I fire up a node in the cluster using the following command, I get an error saying that 4000 is used up. Here is the command I use to start the node and the error I get

c:\Oracle\Middleware\user_projects\domains\base_domain\bin\startManagedWebLogic.cmd server1 http://adminServer_host_name:7001

starting weblogic with Java version:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
Starting WLS with line:
C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client   -Xms256m -Xmx512m -XX:CompileThre
shold=8000 -XX:PermSize=1028m  -XX:MaxPermSize=1024m -Dweblogic.Name=myhealth1 -
Djava.security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -
Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n -
Xverify:none  -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Or
acle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\se
rver   -Dweblogic.management.discover=false -Dweblogic.management.server=http://
DJX09cs1.co.ihc.com:7001  -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw
.logErrorsToConsole=false -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1035\p
rofiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_ocp360\profil
es\default\sysext_manifest_classpath -Dweblogic.management.username=weblogic -Dw
eblogic.management.password=weblogic1  weblogic.Server
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../.
./../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_E
RROR_TRANSPORT_INIT(197)

This is crazy because the node is probably trying to enable debugging on the same port 4000 which the adminserver is set to. How can I set it up so that I can have debugging capabilities enabled on the nodes alone and not the adminserver? I tried adding the following config to startmanagedserver.cmd etc. but no dice.

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

There are 4 answers

0
Alfred Xiao On BEST ANSWER

Modifying startWebLogic.cmd is fine. But the thing is you are running in a domain with servers different from the admin server, which is not the case covered by the 'page' your provided.

The only thing you need to do to fix this is to add a guarding condition before setting JAVA_OPTIONS in startWebLogic.cmd.

Something like:

if serverName=='managedServer1' then
  JAVA_OPTIONS="....debug_options....normal_options"
else
  JAVA_OPTIONS="normal_options"
endif

OR

if serverName=='managedServer1' then
  JAVA_OPTIONS="....debug_options....%JAVA_OPTIONS%"
endif

Sorry I can't remember exact syntax rules for this, please check details for your windows platform.

0
user6123723 On

I can' seem to get ifelse to work so I have a lazy but working solution with two ifs

snippet from setDomainEnv.cmd

if "%SERVER_NAME%"=="AdminServer" (
    set DEBUG_PORT=8455
)

if "%SERVER_NAME%"=="node1" (
    set DEBUG_PORT=8456
)
0
erdogany On

I have a Weblogic (12.1.3.0) AdminServer instance and two nodes(edu1 and edu2) running as a part of the cluster. For debugging these nodes, edit {my_domain}/bin/setDomainEnv.sh (setDomainEnv.cmd in windows) file and add these lines on top. edu1 debug port is 8881 and edu2 debug port is 8882

if [ "${SERVER_NAME}" = "AdminServer" ] ; then
    JAVA_OPTIONS="$JAVA_OPTIONS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8880,server=y,suspend=n" 
fi

if [ "${SERVER_NAME}" = "edu1" ] ; then
    JAVA_OPTIONS="$JAVA_OPTIONS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8881,server=y,suspend=n" 
fi

if [ "${SERVER_NAME}" = "edu2" ] ; then
    JAVA_OPTIONS="$JAVA_OPTIONS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8882,server=y,suspend=n" 
fi
0
Tatarao Vana On

You can enable debugging to managed nodes in admin console....try that option