| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4e7337d commit b37a6bc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ | |||
| 33 | 33 | import java.awt.GraphicsEnvironment; | |
| 34 | 34 | import java.awt.Point; | |
| 35 | 35 | import java.io.*; | |
| 36 | + import java.net.ConnectException; | ||
| 36 | 37 | import java.util.*; | |
| 37 | 38 | ||
| 38 | 39 | import com.sun.jdi.*; | |
@@ -220,21 +221,29 @@ public boolean launchVirtualMachine(boolean present, String[] args) { | |||
| 220 | 221 | // while (!available) { | |
| 221 | 222 | while (true) { | |
| 222 | 223 | try { | |
| 224 | + Messages.log(getClass().getName() + " attempting to attach to VM"); | ||
| 223 | 225 | vm = connector.attach(arguments); | |
| 224 | 226 | // vm = connector.attach(arguments); | |
| 225 | 227 | if (vm != null) { | |
| 228 | + Messages.log(getClass().getName() + " attached to the VM"); | ||
| 226 | 229 | // generateTrace(); | |
| 227 | 230 | // available = true; | |
| 228 | 231 | return true; | |
| 229 | 232 | } | |
| 230 | - } catch (IOException e) { | ||
| 233 | + } catch (ConnectException ce) { | ||
| 234 | + // This will fire ConnectException (socket not available) until | ||
| 235 | + // the VM finishes starting up and opens its socket for us. | ||
| 236 | + Messages.log(getClass().getName() + " socket for VM not ready"); | ||
| 231 | 237 | // System.out.println("waiting"); | |
| 232 | 238 | // e.printStackTrace(); | |
| 233 | 239 | try { | |
| 234 | 240 | Thread.sleep(100); | |
| 235 | - } catch (InterruptedException e1) { | ||
| 236 | - e1.printStackTrace(sketchErr); | ||
| 241 | + } catch (InterruptedException ie) { | ||
| 242 | + Messages.loge(getClass().getName() + " interrupted", ie); | ||
| 243 | + // ie.printStackTrace(sketchErr); | ||
| 237 | 244 | } | |
| 245 | + } catch (IOException e) { | ||
| 246 | + Messages.loge(getClass().getName() + " while attaching to VM", e); | ||
| 238 | 247 | } | |
| 239 | 248 | } | |
| 240 | 249 | // } catch (IOException exc) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments