How to remote debug my application with an IDE?

How to remote debug an enterprise application running on web logic server in eclipse IDE(same machine)

  • 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

  • Answer:

    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 http://www.nirsoft.net/utils/cports.html or https://technet.microsoft.com/pl-pl/sysinternals/bb896653.aspx for that (or event http://helpdeskgeek.com/windows-7/use-netstat-to-see-listening-ports-and-pid-in-windows/). 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): 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.

Karthik at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.