-1

I am new to weblogic application server and remote debugging & have gone through several post to set up remote debugging.
Some post suggest to edit setDomainEnv.cmd file while others suggest to edit startWeblogic.cmd file in my WEBLOGIC_HOME\user_projects\domains\my_domain\bin.
But neither of the solutions worked for me. Listed below are solutions which I tried :

1) Edit setDomainEnv.cmd file

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...

The port number is set to 8543 in the file

if "%DEBUG_PORT%"=="" (
    set DEBUG_PORT=8453
)

2)Edit startWeblogic.cmd file

I added the following line at the top of the file

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8543,server=y,suspend=n  

Then in eclipse,when i run debug configuration(port number : 8543), I get
Failed to connect to remote VM. Connection refused. Connection refused: connect

Please let me know
1) How remote debugging works?
2) How to set up remote debugging in eclipse with weblogic server ?
3) What is the difference between above 2 methods ?
4) Where do I need to add the debug command(-Xdebug....) in the startWeblogic.cmd file(at the top)?
5) What is the purpose of setDomainEnv.cmd file in weblogic server ?

Thanks in advance

Karthik
  • 1,302
  • 5
  • 25
  • 56
  • Web logic server & eclipse are running on same machine. I have set the host as localhost – Karthik Jul 10 '15 at 06:28
  • possible duplicate of [Weblogic remote debugging using eclipse](http://stackoverflow.com/questions/3882203/weblogic-remote-debugging-using-eclipse) – Display Name is missing Jul 13 '15 at 16:20
  • There are at least 5+ duplicates of this question already on stack overflow. None of these worked? http://stackoverflow.com/questions/3882203/weblogic-remote-debugging-using-eclipse http://stackoverflow.com/questions/18875252/eclipse-weblogic-debugging http://stackoverflow.com/questions/21113673/debug-weblogic-app-on-managed-server-on-eclipse http://stackoverflow.com/questions/28163130/weblogic-10-3-3-0-application-debugging-with-eclipse – Display Name is missing Jul 13 '15 at 16:22
  • I tried all posts but still got same error - Failed to connect to remote VM. And some posts suggest to edit startWeblogic.cmd while others suggest to edit setDomainEnv.cmd which is confusing. Can anyone please post the series of steps to be followed to set up remote debugging. Thanks in advance. – Karthik Jul 22 '15 at 12:26
  • Also other posts do not answer all my questions – Karthik Jul 22 '15 at 12:31
  • `setDomainEnv` already contains a line in it for `JAVA_DEBUG`. You do not need to edit startWebLogic. Check your server log file and see if it says it is listening on the debug port. set `JAVA_DEBUG=true` or `debugFlag=true` in setDomainEnv – Display Name is missing Jul 22 '15 at 16:53

1 Answers1

0

I think it should be sufficient to just set environment variable before starting Weblogic. Start cmd and before starting weblogic set debugFlag=true. This should make weblogic open debug port which should be set to some default like 8453. You can also set DEBUG_PORT=8888 or any other free port, if you want to change it.

Start Weblogic and verify that the port has been opened. You can use tools like cports or ProcessExplorer for that (or event netstat).

In case debug port isn't open, check if you run Weblogic in development mode, because debugFlag can be ignored in production mode.

In Eclipse create a remote debug configuration (and remember that this option is not available in Run configuration that is next to it on the toolbar): debug config screenshot

In point 3 on the screenshot select the project you deploy to weblogic that you want to debug.

It that does not work post the problems you have.

Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28
  • debugFlag is set to true in setDomainEnv.cmd file. Also, following line is added -- 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 ). Then in eclipse,when i run debug configuration, I get Failed to connect to remote VM. Connection refused. – Karthik Jul 13 '15 at 05:24
  • What version of Weblogic do you use? – Michał Grzejszczak Jul 13 '15 at 11:27
  • Post the contents of setDomainEnv.cmd somwhere. Can be on some external service (pastebin?). – Michał Grzejszczak Jul 13 '15 at 11:57
  • Thanks for looking into my issue. I have not changed anything in the setDomainEnv.cmd file other than adding the 2 lines of code shown above in my post. Still should I post the contents of the file? – Karthik Jul 13 '15 at 13:13