1
votes

I want to connect to Weblogic from IDE in remote debug mode. I have added set JAVA_OPTIONS=-Xdebug -Xrunjdwp:transport=dt_socket,address=54840,suspend=n,server=y to startWebLogic.cmd. After the start the weblogic server print out Listening for transport dt_socket at address: 54840. But when I try to connect I get an error:

Unable to open debugger port : java.net.ConnectException "Connection refused: connect"

I checked the remote debug on 54840 port with Apache Tomcat and everything is good. Please, tell me what is wrong with Weblogic.

WebLogic Server Version: 12.1.2.0.0 development mode.

2

2 Answers

0
votes

Check the position of this added message. Noticed in File startWeblogic.cmd,

set DOMAIN_HOME=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\ebilling_domain
for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi

call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*

If you add this message before the above. The message will be override by the related code in setDomainEnv.cmd.

if "%debugFlag%"=="true" (
    set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
    set 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...
) else (
    set JAVA_OPTIONS=%JAVA_OPTIONS% %enableHotswapFlag% -da
)

I have connected the remote server successfully.

0
votes

Despite the fact the thread is kind of ancient, maybe I still can help a bit.

It seems weblogic comes ready to run in debug mode. I was able to use it setting the following environment variable:

Windows powershwell

$env:debugFlag = 'true'

Linux

export debugFlag=true

It happens that weblogic start scripts come ready to use this variable and it sets port 8453 as default for you to attach your debugger (probably with any moddern IDE).

If you still need to change that default port you can use another env variable (follow the above patterns for windows ad linux):

DEBUG_PORT = 54840

This way you probably wont have to mess with weblogic scripts.

I'm using weblogic 12c (12.1.3), folowing this article, and it worked fine for my case: https://www.linkconsulting.com/oracle/weblogic-remote-debugging-using-jdeveloper

Regards!