1

when i try to remotely debug applet in browser this error occurs: Failed to connect to remote VM. Connection refused. Why does it can take a place? Here are my actions:

1. javac -g TestApplet.java
2. create html file specifying TestApplet.class
3. in java control pannel: -Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
4. open in browser html file with applet
5. in the eclipse in applet's code set a breakpoint
6. debug configuration -> remote java configuration create new config with parameters: SocketAttach, localhost, 8000
7. debug

After: error message - Failed to connect to remote vm. connection refused.How to solve this Error?

Ami
  • 4,241
  • 6
  • 41
  • 75
pesiykot
  • 59
  • 1
  • 3
  • 9
  • Follow To confiure your local settings your system [Link 1](http://javarevisited.blogspot.in/2011/02/how-to-setup-remote-debugging-in.html)[Link 2](http://redwheels.blogspot.in/2009/10/remote-debugging-of-any-jvm.html) – thar45 Oct 22 '12 at 05:05

2 Answers2

0
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

as

-Djava.compiler=NONE -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Don't use the two options -Xdebug -Xnoagent when your are debugging.

1.Also check the port number in the Eclipse configuration and the port number of your application might not be the same.
2.You might not have been started your application with the right parameters.

Those are the simple problems when you have faced "Connection refused" error.

Ami
  • 4,241
  • 6
  • 41
  • 75
  • Could you exactly tell me where I sould check the port number in Eclipse configuration (Window->Preferences->General->Network??)? And what did you mean when said "the port number of your application"? it is a simple applet, and there is no reference about port number. Port number, localhost mentioned only in Java Control Panel. – pesiykot Oct 22 '12 at 16:44
  • Normally java application running in localhost with 8080 port in linux machine.you have configured 8000 to remote machine.so can you check no other application running in that port? – Ami Oct 23 '12 at 04:05
0

Browser's Java plugin has its own installed Java, probably you're missing it(setting params in wrong java control panel). F.e. I had C:\Program Files (x86)\Java\jre7\bin

And check this args to set in JCP (javacpl.exe)

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044

(https://stackoverflow.com/a/173447/2171669)

Community
  • 1
  • 1
user2171669
  • 745
  • 1
  • 12
  • 22