<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 06.03.2014 14:55, john alexander
      sanabria ordonez wrote:<br>
    </div>
    <blockquote
cite="mid:CAJRMTPdu_OKVtxm8dPyj6c_uDbYm_1D=aDPd2YM+ACjV+WZQNQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>well, what could I say... your answer do not solve the
          problem. <br>
        </div>
      </div>
    </blockquote>
    All I can say is that I've seen working Java code which deletes VMs,
    based on this sample. The language should play no role (unless there
    is a bug), it's all the same API behind it, whether it's used by C++
    (e.g. VBoxManage) or anything else.<br>
    <br>
    Let's approach it from a different angle - can you provide
    VBoxSVC.log (location is platform dependent, usually in the
    .VirtualBox subdirectory of the home directory) for a case where you
    just produced the hang? If you make sure that no VirtualBox related
    activities (no GUI, ...) are running before your test it'd avoid
    unrelated log messages.<br>
    <br>
    Klaus<br>
    <blockquote
cite="mid:CAJRMTPdu_OKVtxm8dPyj6c_uDbYm_1D=aDPd2YM+ACjV+WZQNQ@mail.gmail.com"
      type="cite">
      <div class="moz-signature"><br>
        <br>
        <div class="gmail_quote">On 6 March 2014 05:35, Klaus Espenlaub
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:klaus.espenlaub@oracle.com" target="_blank">klaus.espenlaub@oracle.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> John,<br>
              <br>
              please stay on the mailing list. This is a public service,
              if you want personal support I have to ask for your Oracle
              customer support identifier...
              <div class=""><br>
                <br>
                <div>On 05.03.2014 20:16, john alexander sanabria
                  ordonez wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>
                      <div>
                        <div>Hi Klaus,<br>
                          <br>
                        </div>
                        I read the documentation but (from my
                        experience) it does not behave as I was
                        expecting. For instance, I do understand that
                        the deleteConfig method does not reach the 100
                        percent if there is an error but why the library
                        does not throw an exception informing about it.
                        In addition, why if the previous method (delete)
                        works with no errors this time "deleteConfig"
                        will generate any error? <br>
                      </div>
                    </div>
                  </div>
                </blockquote>
              </div>
              The asynchronous part of the deletion might fail (and
              that's exactly the same as in older versions, just the
              method name has been changed), and your code will simply
              hang as it doesn't properly check for completion. Failed
              async operations usually will never reach 100% - why
              should they, they failed before.<br>
              <br>
              These failures will NOT cause exceptions from the progress
              object method calls, you have to check for them
              explicitly. It's been always like that, and there's lots
              of sample code out there which shows how to do this
              properly.
              <div class=""><br>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>About the wait, this is the actual code<br>
                      <br>
                                              out << "To delete "<br>
                                              mediums.each {<br>
                                                      out << <a
                        moz-do-not-send="true" href="http://it.name"
                        target="_blank">it.name</a> + " "<br>
                                              }<br>
                                              def iprogress =
                      machine.delete(mediums)<br>
                                              out << "\nDeleting "<br>
                                              while (iprogress.percent
                      != 100) {<br>
                    </div>
                  </div>
                </blockquote>
              </div>
              Do not check for 100%, check if iprogress.getCompletion
              returns non-zero (dunno if the true/false stuff makes it
              all the way to Groovy).<br>
              <blockquote type="cite">
                <div dir="ltr">
                  <div>                                 out << "."<br>
                                                    out.flush()<br>
                                                    Thread.sleep(500)<br>
                  </div>
                </div>
              </blockquote>
              Again, you're ignoring that you should wait using the
              method from the progress object,
              iprogress.waitForCompletion(500) as this gives the API
              middleware the opportunity to run its event queues and so
              on.<br>
              <br>
              PLEASE have a look at the Java sample (TestVBox.java), it
              contains many useful code sequences which are verified to
              be sensible (not that all of them go into extreme error
              checking, but at least do the bare minimum necessary to
              avoid hangs).<span class="HOEnZb"><font color="#888888"><br>
                  <br>
                  Klaus</font></span>
              <div>
                <div class="h5"><br>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>                        }<br>
                      </div>
                      John,<br>
                      <div>
                        <div>
                          <div>
                            <div><br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On 4 March 2014 13:55,
                        Klaus Espenlaub <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:klaus.espenlaub@oracle.com"
                            target="_blank">klaus.espenlaub@oracle.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">Hi,<br>
                          <div><br>
                            On 04.03.2014 14:44, john alexander sanabria
                            ordonez wrote:<br>
                            > Hi,<br>
                            ><br>
                            > I wrote a Groovy script to use the Java
                            binding to manage virtual<br>
                            > machines through the VirtualBox web
                            service interface. My script worked<br>
                            > well in VirtualBox 4.2.x but when I
                            updated to version 4.3 I noted that<br>
                            > my unregistervm procedure does not
                            work. First, the IMachine.delete<br>
                            > method was not available and it was
                            changed by IMachine.deleteConfig<br>
                            > which basically works similarly to the
                            delete method. I made the<br>
                            > corresponding modifications however it
                            does not delete the mediums<br>
                            > returned by the IMachine.unregister
                            method.<br>
                            <br>
                          </div>
                          This is documented in the SDK reference, for
                          the API changes in 4.3.<br>
                          <div>><br>
                            > My unregistervm methods looks similar
                            to this<br>
                            ><br>
                            > def mediums =
                            machine.unregister(CleanupMode.DetachAllReturnHardDisksOnly)<br>
                            > def iprogress =
                            machine.deleteConfig(mediums)<br>
                            > while (iprogress.percent < 100) {<br>
                            >    out << "."<br>
                            > }<br>
                            ><br>
                            > and it never ends because the
                            iprogress.percent never reaches 100.<br>
                            ><br>
                            > What I am doing wrong? Thanks for your
                            help.<br>
                            <br>
                          </div>
                          The percentage will never reach 100 if there
                          is any error. You should be<br>
                          adding more flexible progress checking (there
                          should be enough working<br>
                          samples out there, including the Java sample
                          code). What you have is<br>
                          asking for hangs. Also, you should at least
                          have some wait for<br>
                          completion (if you prefer with very low
                          timeout), as otherwise you're<br>
                          simply burning CPU cycles.<br>
                          <br>
                          Klaus<br>
                          <br>
                          ><br>
                          > John,<br>
                          > </blockquote>
                      </div>
                    </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
         <!-- This signature was generated by the MyDesktop Oracle Business Signature utility version 4.0 -->
      </div>
    </blockquote>
  </body>
</html>