Home > vSphere API > Open Source VI Java API 5.0.1 Released

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.

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure


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.

Categories: vSphere API Tags:
  1. Shobhit Gupta
    May 22nd, 2012 at 14:59 | #1

    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. May 22nd, 2012 at 17:40 | #2

    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
    May 22nd, 2012 at 18:48 | #3

    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:

    SearchDatastore.java failed with exception: InvalidRequest – ID: 3528779

    Run sample code SearchDatastore.java 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(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at java.lang.Class.newInstance0(Class.java:372)
    at java.lang.Class.newInstance(Class.java:325)
    at com.vmware.vim25.ws.XmlGen.fromXml(XmlGen.java:201)
    at com.vmware.vim25.ws.XmlGen.parseSoapFault(XmlGen.java:80)
    at com.vmware.vim25.ws.WSClient.invoke(WSClient.java:133)
    at com.vmware.vim25.ws.VimStub.searchDatastoreSubFolders_Task(VimStub.java:2602)
    at com.vmware.vim25.mo.HostDatastoreBrowser.searchDatastoreSubFolders_Task(HostDatastoreBrowser.java:81)
    at com.vmware.vim25.mo.samples.storage.SearchDatastore.main(SearchDatastore.java:117)

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

    Your comments?


  4. May 22nd, 2012 at 18:52 | #4

    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
    May 22nd, 2012 at 19:20 | #5

    @Steve Jin
    Thanks for your quick response.

    I only changed the following part of sample java code: SearchDatastore.java

    String hostname = “my.domain.com”;
    String datastorePath = “[ds-1_LUN34]”;

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

  6. May 22nd, 2012 at 20:07 | #6

    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
    May 22nd, 2012 at 20:51 | #7

    @Steve Jin
    Thanks for your reply. I will double check this. If sample code src/com/vmware/vim25.mo/samples/storage/SearchDatastore.java 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
    May 23rd, 2012 at 14:01 | #8

    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. May 23rd, 2012 at 23:04 | #9

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


  10. Daniel Linsley
    May 24th, 2012 at 16:07 | #10

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

  11. May 24th, 2012 at 17:43 | #11

    Great to hear that Dan!

  12. Xiaofeng Lin
    May 30th, 2012 at 16:03 | #12

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

  13. May 30th, 2012 at 19:00 | #13

    Good question. Not yet.

  14. Xiaofeng Lin
    May 31st, 2012 at 12:10 | #14

    @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, “http://mvnrepository.com/artifact/com.cloudbees.thirdparty/vijava/5.0.0”. It looks strange that the package name belongs to some thirdparty company.

  15. May 31st, 2012 at 13:25 | #15

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


  16. Mike Matczynski
    June 15th, 2012 at 14:21 | #16

    Cloudbee only has vijava 5.0.0 in their Maven repo

  17. Marty
    June 28th, 2012 at 12:15 | #17

    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. June 28th, 2012 at 12:33 | #18

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

  19. Marty
    June 28th, 2012 at 17:59 | #19

    Done, thanks.

  20. Julia
    September 11th, 2012 at 02:44 | #20

    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 metric.so the program return data about all the instance.My English is poor.my description maybe unclear.Please do me a favor,thanks!

  21. Julia
    September 13th, 2012 at 00:45 | #21

    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.

  1. No trackbacks yet.