VMware {code} Community
Steve_Jin
Expert
Expert
Jump to solution

Tutorial: Get Your First VI SDK Application Running in 5 Minutes-- Beta 2 released

Just wrote a tutorial:

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
1 Solution

Accepted Solutions
kem5451
Enthusiast
Enthusiast
Jump to solution

Steve,

Solution is needed for my commercial products. Please let me know how to proceed further. Thanks.

Kem.

View solution in original post

Reply
0 Kudos
38 Replies
Steve_Jin
Expert
Expert
Jump to solution

I should have mentioned Java 1.6 is needed to run the VI Java API 2.0 because DatatypeConverter is used for serializing/deserializing the high performance web service engine. The wiki page was updated accordingly.*

Steve JIN, VMware Engineering*

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)

*Get Connected with Other Developers in the Community?

*

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
JV5451
Contributor
Contributor
Jump to solution

Steve,

Thanks for your timely update on your point about 1.6 is needed for VI JAVA-API. So no need to try this in 1.5 and 1.4 or any other work around for this?

-Kem

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

VI Java API 1.0 requires JRE 1.5. With 2.0, I designed a new web service engine which uses DatatypeConverter (new in Java 1.6) for serialization/deserialization of Calendar objects (xsd:dateTime), therefore 1.6 is required.

Is there any particular reason that you want to try 1.4/1.5?

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Thanks. If it works from 1.5 then no issues.

-Kem

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

Hi Kem,

Just want to clarify this. The current VI Java API 2.0 works only from 1.6, not 1.5 becuase it uses new API in 1.6. It's possible to make the API work with 1.5. I am not sure how many developers in the community need this.

Please let me know if you need this support, folks!

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Hi Steve,

Since my entire applications are running on JRE1.5, it will a tedious force to change all the functionalities. It will be great if it supports from 1.5. If it is possible to give a work around for 1.5, then kinly update your tentative time will be taken for doing this support. Else we will plan to continue with VI SDK itself.

Besides, The Jar which am having is more on to VIM25 classes. What about VIM Classes? or Is this jar common for both? because VIM and VIM95 SDK series are having VM ESX server version support dependencies.

Eagerly waiting on your response.Thanks.

Kem

Reply
0 Kudos
kbr5678
Contributor
Contributor
Jump to solution

hi..

we r also using jre1.5.....in our environment......we r also wating for ur response....

thanks

KBR

Reply
0 Kudos
jeyakarthika
Contributor
Contributor
Jump to solution

Hi,

Our Application also using jdk 1.5 .Now we are trying to migrate from VI SDK to java Api.If you give jdk 1.5 support in java Api will help us.

-karthika

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

Hi Folks,

Would you please let me know if you use VI Java API for internal projects or for commercial products? The solution can be different here. Thanks!

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Steve,

Solution is needed for my commercial products. Please let me know how to proceed further. Thanks.

Kem.

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

Hi Kem,

As mentioned, the only reason for requiring 6.0 is the data conversion for the xsd:dateTime type. The required classes are actually in Java Web Service API. If you download the package from

After extract the binary, you will see jaxb-api.jar and jaxb-impl.jar in the lib directory. Include these two into your classpath, and you should be able to run the API with JRE 5.0. The VI Java API 2.0 is compiled with 5.0 compliance level, so you should be able to use its binary as it is. If you have problem, grab the source and compile it by yourself.

I am not sure the jaxb-api.jar and jaxb-impl.jar can be re-distributed with your application. Your company may want to find out. If for in-house usage, it's less a problem.

Hope it helps.

-Steve

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute it with your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Steve,

Thanks for your prompt response. Let me try this out and update you.

-Kem

Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Steve,

Am able to compile and work with JRE1.5 with your below suggestions. Thanks.

-Kem.

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

VI Java API 2.0 beta 2 was just released. The big thing of this release is the optimization of the web service

engine, mainly leveraging the streaming feature of the XML parser. So

don't be surprised to notice the performance improvement. Check it out:

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute it with your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Hi Steve,

Am able to connect ESX3i server and get VM informations using below code.

ManagedEntity[] mes = new InventoryNavigator(rootFolder).searchManagedEntities("VirtualMachine");

for ( int i = 0; i < mes.length; i++) {

VirtualMachine vm = (VirtualMachine) mes[i];

VirtualMachineConfigInfo vminfo = vm.getConfig();

VirtualMachineCapability vmc = vm.getCapability();

vm.getResourcePool();

System.out.println("Hello " + vm.getName());

System.out.println("GuestOS: " + vminfo.getGuestFullName());

System.out.println("Multiple snapshot supported: " + vmc.isMultipleSnapshotsSupported());

}

But not able to connect ESX 3 server. Do we have any work around or I have missed up something? Please advice.

Thanks.

-Kem.

Reply
0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

Hi Kem,

ESX3i uses VI SDK2.5 version of API, which is the default of the VI Java API.

The ESX3 server is VI SDK 2.0 version of API. I have added a new constructor in ServiceInstance, which allow you to specify the namespace. The available namespaces are defined as the final static String with the ServiceInstance. You should be able to connect to the ESX3 using the constructor.

Note: I am going to change the constructor a little bit when next VI SDK released.

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java(Jython) API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute it with your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Hi Steve,

Am able to connect ESX3.0 Server with VI Java API by replacing the namespace.

Your solution is simple but great work behind. Thanks.

-Kem.

Reply
0 Kudos
kem5451
Enthusiast
Enthusiast
Jump to solution

Note:- The below comment works only with VI JAVA Beta 2 patch released on 21-03-2009.

-Kem

Reply
0 Kudos
soyuppy
Contributor
Contributor
Jump to solution

Hi,

I would like to know how you were able to get pass the compilation error in 1.5. There's a class XmlGen.java in com.vmware.vim25.ws package. line 46, there an import com.sun.xml.internal.bind.DatatypeConverterImpl; This DatatypeConverterImpl cannot be found anywhere. Not within the jaxb jar.

Did you run into this? What jar file do you use to get pass this?

Reply
0 Kudos