Starting GlassFish 3 has encountered a problem

Asked By 20 points N/A Posted on -

Hi Ally,

When I try to debug a code in Eclipse, I stuck up with an error message. This is not allowing me to debug. I even check the port; they are not in use by other programs. I tried with different port numbers but nothing worked. How I can solve this error? Please help me to resolve this error. Thanks a lot.

Starting GlassFish 3 has encountered a problem

Failed to connect to remote VM. Connection refused.

Answered By 70 points N/A #186373

Starting GlassFish 3 has encountered a problem



There are various reasons that your error is generated.

First of all, try to enable remote connection in Java to be accepted. Start Command Prompt with administrator privilege. Right-click on Command Prompt and then select “Run as administrator”.

Run this command:

java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=10000,suspend=n yourServer

Also, make sure that no firewall is on the way blocking the connection.

Add the following code inside your program too.

export JPDA_ADDRESS=8787

export JPDA_ADDRESS=8787

export JPDA_TRANSPORT=dt_socket

export JPDA_HOST=localhost


JAVA_OPTS=$JAVA_OPTS -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000

JAVA_OPTS=$JAVA_OPTS -Dsun.rmi.dgc.server.gcInterval=3600000

JAVA_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n $JAVA_OPTS


Also, check the port you’re using. It is the most important and troublesome part making you confused.

Also, try updating your Java. Download JRE.

Now your program should run perfectly with remote JVM.

Login/Register to Answer

Related Questions