9

My Weblogic is installed in a Red hat OS machine.

In the startWebLogic.sh i have added this line JAVA_OPTIONS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n %JAVA_OPTIONS%"

When I try to connect from my Eclipse I get a "Failed to connect to remote VM. Connection refused. Connection refused: connect" message.

Can you please tell me where I may be going wrong?

mujeeb
  • 799
  • 5
  • 18
  • 29
  • 2
    Is your Eclipse and weblogic on different systems? If so, could port 8888 be blocked on Redhat OS? – Raghuram Oct 07 '10 at 13:46
  • Hi Raghuram. Thanks for you reply. Yes its in different systems. How do I check if its blocked and if blocked, how do i enable it – mujeeb Oct 07 '10 at 13:47
  • If you have `nmap` installed. You can issue the command from your eclipse host: format: `nmap -p `, example: `nmap -p 8888 serverName.example.com` – ftravers Apr 27 '11 at 01:09
  • 1
    you don't have to do anything additional (check your setDomainEnv.sh if it contains the line debugFlag="true". If so than you have weblogic setup for remote debugging). – despot Jul 04 '12 at 13:17
  • @despot That comment is too simplistic. There's more to it than that. A user should look through the rest of the script to see what port it's being set up for etc – the_new_mr Mar 19 '13 at 14:45
  • 1
    @despot, thanks it worked by making that change. It takes the default port mentioned in setDomainEnv.sh/setDomainEnv.cmd (i.e 8453) – Narendra Pandey Jan 03 '22 at 15:11

5 Answers5

7

In the startWebLogic.sh file in the bin folder, in the RHEL add this line

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

at the place where you find this string: ${JAVA_HOME}/bin/java.

Place the above line just after ${JAVA_HOME}/bin/java

alepuzio
  • 1,382
  • 2
  • 28
  • 38
mujeeb
  • 799
  • 5
  • 18
  • 29
  • 1
    this will make no difference, since the way mujeeb did this is the preferred way. why are you anwsering your own question? – Salandur Oct 07 '10 at 14:35
  • 1
    Well I found the answer after I posted the question. However the way I explain in my answer worked for me. However, thanks for your reply. Much appreciated. – mujeeb Oct 07 '10 at 15:10
  • This worked for me. Things were slightly different on Windows, but overall, the same process worked as expected. – rbwhitaker Oct 05 '12 at 19:21
  • 1
    @Salandur As a side note: it is [totally OK](http://meta.stackexchange.com/a/17467/203290) and [even encouraged](http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/) to answer own questions. This is even discussed in the Stack Overflow help center: [Can I answer my own question?](http://stackoverflow.com/help/self-answer). – informatik01 Jun 27 '16 at 08:56
4

I Know it may be late ... but I get errors like this, when I try to run eclipse debugging session while there is one session already running.

Dima R.
  • 995
  • 2
  • 14
  • 25
2

Edit <my_domain>/bin/setDomainEnv.sh file and add this on top:

JAVA_OPTIONS="$JAVA_OPTIONS -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" 

or configure debug port

DEBUG_PORT=${DEBUG_PORT:=8000} 
JAVA_OPTIONS="$JAVA_OPTIONS -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n"

More info can be found here:
How to setup remote debug with WebLogic Server and Eclipse

informatik01
  • 16,038
  • 10
  • 74
  • 104
Mohit Singh
  • 5,977
  • 2
  • 24
  • 25
0

you can only connect to a running VM, so make sure your server is running.

if you are running on separate systems, it is possible and very likely that a firewall is blocking the connection. so contact your network administrator to see if this is true

Salandur
  • 6,409
  • 2
  • 22
  • 23
0

May be late but may help someone.

I use the eclipse plugin for weblogic 12c. I was trying to run the server in the debug mode by doingrighclick-->start in debug and kept getting a "VM Connection refused" error. Then i did the following 1- I edited the startWeblogic.cmd to include

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

2- Rightclick on the PROJECT that i wanted to debug and went MYproject-->Debug As-->**Debug On Server** and it worked. Do not do righclick-->start in debug on the server, but do it on the specific project you want to debug.