Open Source VI Java API 5.0.1 Released

While preparing this annoucement, I realize that on the same day last year we had a very successful community event with several techtalks to celebrate the 3 year of vijava open source project. Today it’s the 4th year of this project!

Since VI Java API 5.0 GAed last October, there have been some changes, one of which is that I left VMware and joined VCE the same month. On the project side, there are several new bugs opened with the forum. These bugs do not affect most developers. But still I fixed them quickly in the code repository so that anyone who was affected could get the fixes from there.

Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.

As the fixes accumulate, I thought it’s a good idea to push out a minor release. Therefore I called for new bugs in March with my tweets. Surprisingly, I haven’t seen any coming up after that. That doesn’t mean that vijava API is perfect now, but that vijava is quite stable given our large developer/administrator community.

Anyway, here is a list of the bug fixes getting in 5.0.1 release and short description of the solutions.

  • 3499323 WSClient fails to parse float in StorageMigrationAction
    Solution: add the code to parse float which is an easy fix with clean code structure of vijava engine.
  • 3497202 StorageResourceManager constructor missing
    Solution: add the contructor code. This is the simplest fix.
  • 3496063 XmlGen.getVimClass(…) is not thread safe
    Solution: change the HashMap for classes to the thread safe equivalent.
  • 3461462 ScheduledTask Clone – The root cause is the serialization of ManagedObjectReference object is not correct.
    Solution: add xsi:type attribute to the XML entity.

If your application works fine with previous release, you don’t need to upgrade to this 5.0.1. If you upgrade, you do need to change your product notice to include one more line of copyright by me. For details, just check out the License.txt. The BSD license for vijava API remains the same as before. To download, click here.

This entry was posted in vSphere API and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.


  1. Shobhit Gupta
    Posted May 22, 2012 at 2:59 pm | Permalink

    Hi Steve,

    The vijava jar files that you release do not have source within them. Do you export a separate version that has source bundled (at them time of release)?


  2. Posted May 22, 2012 at 5:40 pm | Permalink

    There are two different files – one binary with *.zip extension, the other source with *.jar extension. Please go get the latter one.


  3. Kenny Qiao
    Posted May 22, 2012 at 6:48 pm | Permalink

    Hi Steve,
    I’m not sure it is OK to raise my question here for a bug I found with VI Java API 5.0. I already filed a bug on vijava bugzilla: failed with exception: InvalidRequest – ID: 3528779

    Run sample code and throwed the following exception:
    Exception in thread “main” com.vmware.vim25.InvalidRequest
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
    at java.lang.reflect.Constructor.newInstance(
    at java.lang.Class.newInstance0(
    at java.lang.Class.newInstance(

    Since I already write some code to verify this and found that HostDatastoreBrowser.searchDatastoreSubFolders_Task always throws the same exception.

    Your comments?


  4. Posted May 22, 2012 at 6:52 pm | Permalink

    Hi Kenny,
    Thanks for reporting the bug! The InvalidRequest exception means the application does not pass the expected argument, therefore fails the method call. You may want to double check your application code. Please let me know of any update.

  5. Kenny Qiao
    Posted May 22, 2012 at 7:20 pm | Permalink

    @Steve Jin
    Thanks for your quick response.

    I only changed the following part of sample java code:

    String hostname = “”;
    String datastorePath = “[ds-1_LUN34]”;

    This part is hardcoded in and I changed it according to my setup. Then I met that problem.

  6. Posted May 22, 2012 at 8:07 pm | Permalink

    Hi Kenny,
    There are two arguments to the searchDatastoreSubFolders_Task() method. You may want to double check what you passed in against what is required in the API reference. You can also check server side log to see if there is any additional hints.
    Good luck!

  7. Kenny Qiao
    Posted May 22, 2012 at 8:51 pm | Permalink

    @Steve Jin
    Thanks for your reply. I will double check this. If sample code src/com/vmware/ in 5.0 release works for you, it should works for me by just changing hostname and datastorePath.
    Anyway, I will do some debugging and see what happened.


  8. don
    Posted May 23, 2012 at 2:01 pm | Permalink

    Hi Steve
    Just wondering if there is any incremental update to the automatic code generator that coincides with this vijava release? In particular with respect to python and/or ruby support?

  9. Posted May 23, 2012 at 11:04 pm | Permalink

    This release is really bug fixes. The underlying interfaces have not changed at all.


  10. Daniel Linsley
    Posted May 24, 2012 at 4:07 pm | Permalink

    Thanks Steve! The fixes for issues 3499323 and 3497202 allowed me to add Storage DRS support to HP Operations Orchestration Content Pack 8!

  11. Posted May 24, 2012 at 5:43 pm | Permalink

    Great to hear that Dan!

  12. Xiaofeng Lin
    Posted May 30, 2012 at 4:03 pm | Permalink

    Has the new vijava 5.0.1 release been pushed to a public maven repository anywhere?

  13. Posted May 30, 2012 at 7:00 pm | Permalink

    Good question. Not yet.

  14. Xiaofeng Lin
    Posted May 31, 2012 at 12:10 pm | Permalink

    @Steve Jin
    Do you plan to publish it? I think it’s better for the project owner to publish it. When I search the web, I’ve got this for 5.0.0, “”. It looks strange that the package name belongs to some thirdparty company.

  15. Posted May 31, 2012 at 1:25 pm | Permalink

    Thanks for the information. I think I should do that. Cloudbee propably uses vijava in their project.


  16. Mike Matczynski
    Posted June 15, 2012 at 2:21 pm | Permalink

    Cloudbee only has vijava 5.0.0 in their Maven repo

  17. Marty
    Posted June 28, 2012 at 12:15 pm | Permalink

    I am working on someone else’s Java code for reading MOB information. I have tried your library but ran into a difference between your library and the one that is on the VMware site. Your library does not support serialization of the objects, which turns out, is important to us. Needless to say, it allows us to grab data from a customer site and use that data to debug any errors we see on the customer site that we can’t reproduce with any of our servers. Unfortunately, the vim25.jar file from VMware does not include the mo package, and, unfortunately, your library has serialization stripped out. Is there a version with serialization or can you point me somewhere to find the mo package with serialization enabled? Any help would be greatly appreciated.


  18. Posted June 28, 2012 at 12:33 pm | Permalink

    Hi Marty,
    Thansk for the feedback. Can you file feature request in the project tracker? Let’s track it from there.

  19. Marty
    Posted June 28, 2012 at 5:59 pm | Permalink

    Done, thanks.

  20. Julia
    Posted September 11, 2012 at 2:44 am | Permalink

    Hi Steve Jin,
    I have a look at your book.In charpter performance monitoring,I know that the PerfMetricId is the instance of counterId in the server.But I search that there is no PerfMetric info about Memory in my ESXi server.So I new a PerfMetric,”new PerfMetric(null,null,5,true)”.It also works.So I want to know why we need to check the corresponding instance Metric of the counter.Your code and sdk code both need get Metric throught counter,but I test,it return size is 0.So the PerfQuerySpec.setMetric() set the default the program return data about all the instance.My English is description maybe unclear.Please do me a favor,thanks!

  21. Julia
    Posted September 13, 2012 at 12:45 am | Permalink

    Hi Steven Jin,
    I have figure out the difference.”new PerfMetric(null,null,5,true)”just point to one instance that is not definited.Also thanks you for your book.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.