Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone
Accepted Solution

Debugger Failed to connect to remote VM. Connection refused.

 

java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Thread.java:619)

 

suddenly I got this error if trying to launch the Debugger.

restart Simulator or Eclipse or Windos doesn't helped.

Project-clean-Simulator doesnt help

 

the Simulator itself works, but the debugger fails:

 

Failed to connect to remote VM. Connection refused.

 

java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.<init>(Socket.java:372) at java.net.Socket.<init>(Socket.java:186) at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136) at java.lang.Thread.run(Thread.java:619)

 

any ideas ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Debugger Failed to connect to remote VM. Connection refused.

I've seen this error when my machine is so loaded down that the simulator takes too much time to connect ot the debug port. Simulators for the newer OS versions take even longer. You can try increasing the timeout values by going to Windows > Options and selecting Debug under Java. I have mine set at 240000 ms (4 minutes).




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Debugger Failed to connect to remote VM. Connection refused.

ted,

 

thx for the tip

 

looked under Eclipse - Preferences - Java . Debug

timeouts for Debug and Launch were 240000

 

even setting them to 480000 doesnt help

 

progress shows "Launching... Establishing Connections..." and stops after 10 seconds or so

 

til yesterday never such a problem, only happens if debugging - normal launch works

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Debugger Failed to connect to remote VM. Connection refused.

On older machine, I had to empirically find a ritual and it would work reliably.

Things like starting simulator first, waiting for it to finish loading, and connect

before opening app etc. On new machines it seems more tolerant

Please use plain text.
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Debugger Failed to connect to remote VM. Connection refused.

thx marchywka,

 

I tried:

 

Launch Simulator - wait - then Debugger: fails

 

installed a new Simulator outside Eclipse

did Project - BlackBerry clean Simulator

 

tried again with a small project, no auto-start - same happens

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Debugger Failed to connect to remote VM. Connection refused.

also:

switched to another workspace

tried a small rim example project

 

launching works, debugger fails

 

----

I didn't change anything on windows, because I'm using this windows only for developing BB

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Debugger Failed to connect to remote VM. Connection refused.

No idea what's happening. The boilerplate question to ask at this point is: has anything changed in your Windows environment since it last worked? (New software, Windows updates, etc. installed?)




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Debugger Failed to connect to remote VM. Connection refused.

that's I'm thinking about  the whole day:

 

what could be changed ?

 

I downloaded and installed some extra Simulators outside Eclipse to test how it works without Eclipse to provide my customer a small environment he can use at an event to demonstryte my apps...

 

I don't use the debugger many times - mostly I use logging, so I don't remember exactly when I used the debugger last time

 

think I didn't update windows, I also didn't update Java

 

all runs inside a VM (Parallels) on top of OSX

so all my 'normal' work runs under OSX - the Windows 7 - Installation inside the VM was only used to develop BB Eclipse apps - all other Eclipse development was done under OSX

 

will try tomorrow if debugging on the Device works to see if the Debugger itself was working well

 

thx for helping

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Debugger Failed to connect to remote VM. Connection refused.

Do you have any firewall software that could be blocking the connection between Eclipse and the simulator?

 

A previously running simulator may not have released its port correctly or another application may be using the same port.  A restart of Windows may resolve either of these scenarios.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
ekke
Posts: 1,440
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Debugger Failed to connect to remote VM. Connection refused.

Mark,

 

there's no Firewall - its my own small LAN

 

of course I restarted Eclipse,

I restarted Windows

cleared Simulator

installed brandnew Simulator outside Eclipse and used this one - same happens

 

tried with/without MDS

 

swichted to small workspace only containing RIM example apps

same happens - even HelloWorld doesnt work

 

running Simulator, signing apps, packaging, installing from desktop manager - all works

 

but Debugger gets Connection TimeOut

 

if I don't find a solution - you can be sure, I'll have it on my laptop to demonstrate at DevCon to an expert ;-)

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.