VMware {code} Community
jonhpk
Contributor
Contributor

Unable to deploy WSSDK sample, package download blocked

The Web Client SDK samples are not complete. They are missing the file(s) that one would use to register them on a real vSphere server.

I'm attempting to install the WS SDK sample as if it were a real application. I have created the XML file, packaged the dependent JAR and WAR files and then placed the package on a web server with an HTTPS URL. I have registered the extension with the vSphere server but I'm getting a Java exception in the server logs when it tries to download the package.

The registration XML is here

<extension>

   <description>

      <label>WSSDK</label>

      <summary>WSSDK Sample</summary>

   </description>

   <key>com.vmware.samples.wssdkui</key>

   <company>VMware</company>

   <version>1.0.0</version>

   <client>

      <version>1.0.0</version>

      <description>

         <label>WSSDKUI</label>

         <summary>WSSDKUI</summary>

      </description>

      <company>VMWare</company>

      <type>vsphere-client-serenity</type>

      <url>https://mkesrv-vcvzip2b.pkware.com:34443/sample/samples-wssdkui.zip</url>

      <serverThumbprint>ce:be:19:0c:86:03:8a:e9:46:7a:1f:2d:b6:d2:59:5a:78:6f:ee:a0</serverThumbprint>

   </client>

   <lastHeartbeatTime>2013-10-31T00:25:52.814418Z</lastHeartbeatTime>

</extension>

When it tries to load the package it puts this into the server log


[2013-11-01 10:34:03.306] INFO  [INFO ] vc-service-pool-239          D8FD1248E389522ABC4FC53E48C784EB com.vmware.vise.vim.extension.VcExtensionManager                  start writePackageToFile : com.vmware.samples.wssdkui

[2013-11-01 10:34:03.306] INFO  [INFO ] vc-service-pool-239          D8FD1248E389522ABC4FC53E48C784EB com.vmware.vise.vim.extension.VcExtensionManager                  Downloading plugin package from https://mkesrv-vcvzip2b.pkware.com:34443/sample/samples-wssdkui.zip

[2013-11-01 10:34:03.306] ERROR [ERROR] vc-service-pool-239          D8FD1248E389522ABC4FC53E48C784EB com.vmware.vise.vim.extension.VcExtensionManager                  The plugin package download was blocked because the URL isnot secure.  To allow http URLs add allowHttp=true to webclient.properties

[2013-11-01 10:34:03.306] INFO  [INFO ] vc-service-pool-239          D8FD1248E389522ABC4FC53E48C784EB com.vmware.vise.vim.extension.VcExtensionManager                  end writePackageToFile : com.vmware.samples.wssdkui

[2013-11-01 10:34:03.321] ERROR [ERROR] vc-service-pool-239          D8FD1248E389522ABC4FC53E48C784EB com.vmware.vise.vim.extension.VcExtensionManager                  Error unzipping https://mkesrv-vcvzip2b.pkware.com:34443/sample/samples-wssdkui.zip java.util.zip.ZipException: error in opening zip file

  at java.util.zip.ZipFile.open(Native Method)

  at java.util.zip.ZipFile.<init>(ZipFile.java:127)

  at java.util.zip.ZipFile.<init>(ZipFile.java:143)

  at com.vmware.vise.vim.extension.VcExtensionManager.downloadPackage(VcExtensionManager.java:402)

  at com.vmware.vise.vim.extension.VcExtensionManager.access$300(VcExtensionManager.java:61)

  at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:294)

  at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:280)

  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

  at java.util.concurrent.FutureTask.run(FutureTask.java:138)

  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

  at java.lang.Thread.run(Thread.java:662)


I have confirmed that the URL works from my system in my network.

I have updated the webclient.properties file as the error told me to even though I'm using HTTPS and HTTP. I have also tried using HTTP before and after the change to the webclient.properties file. No luck so far. Any help would be greatly appreciated. The server is running version 5.1.

Tags (1)
15 Replies
rdey
Enthusiast
Enthusiast

serverThumbprint is not a property of a client data object, but a property of a server data object. So you need to put that under server.  So your xml should look like ...

<extension>

....

<client>

  ....

</client>

<server>

  <serverThumbprint> .... </serverThumbprint>

</server>

For details please the Extension data object of vSphere Web Service SDK documentation.

VMware vSphere 5.1

0 Kudos
jonhpk
Contributor
Contributor

I changed the extension XML to this and I no longer see errors in the logs about the URL not working. However the sample plugin does not appear in the  "Monitor" "wssdk-ui-sample" tab like the documentation says that it should.

I have looked over the logs on the server and I don't see any obvious errors tied to the WSSDK sample plugin. Any ideas on where to go next?

<extension>

   <description>

      <label>WSSDK</label>

      <summary>WSSDK Sample</summary>

   </description>

   <key>com.vmware.samples.wssdkui</key>

   <company>VMware</company>

   <type></type>

   <version>1.0.0</version>

   <subjectName></subjectName>

   <server>

      <url>https://mkesrv-vcvzip2b.pkware.com:34443/sample/samples-wssdkui.zip</url>

      <description>

         <label>WSSDK server</label>

         <summary>WSSDK Sample server</summary>

      </description>

      <company>VMware</company>

      <type></type>

      <adminEmail>nobody@vmware.com</adminEmail>

      <serverThumbprint>ce:be:19:0c:86:03:8a:e9:46:7a:1f:2d:b6:d2:59:5a:78:6f:ee:a0</serverThumbprint>

   </server>

   <client>

      <version>1.0.0</version>

      <description>

         <label>WSSDK client</label>

         <summary>WSSDK Sample client</summary>

      </description>

      <company>VMware</company>

      <type></type>

      <url>https://mkesrv-vcvzip2b.pkware.com:34443/sample/samples-wssdkui.zip</url>

   </client>

   <lastHeartbeatTime>1970-01-01T00:00:00Z</lastHeartbeatTime>

</extension>

0 Kudos
rdey
Enthusiast
Enthusiast

What is the log file saying?  Is  the plugin.zip file  downloaded  and deployed successfully ?

Can you provide your plugin-package.xml file  and the list of files present in the zip file with directory structure?

0 Kudos
jonhpk
Contributor
Contributor

The ZIP file contains a single plugin-package.xml file at the root, and 3 JAR/WAR files in the plugins folder.

plugin-package.xml contains

<?xml version="1.0" encoding="UTF-8"?>

<pluginPackage id="com.vmware.samples.wssdkui"

               version="1.0.0"

               name="vsphere-wssdk-ui"

               description="VSphere WSSDK UI sample"

               vendor="VMware">

   <dependencies>

      <!-- dependency on the current vSphere Client version is required -->

      <pluginPackage id="com.vmware.vsphere.client" version="5.1.0" />

   </dependencies>

   <bundlesOrder>

      <bundle id="com.vmware.vim25" />

      <bundle id="com.vmware.samples.wssdkprovider" />

   <bundle id="com.vmware.samples.wssdkui" />

   </bundlesOrder>

</pluginPackage>

The plugins folder contains 3 files: vim25.jar vsphere-wssdk-provider.jar and vsphere-wssdk-ui-war.war all of these were produced using the unmodified WS SDK sample projects.


I do not see any references to the wssdk sample in the log file now after having changed the XML used to install it.

0 Kudos
rdey
Enthusiast
Enthusiast

Follow these steps and see it works ...

Logout from vSphere Web Client.

Remove your plug-in directory from the following directories on your Virgo Server machine

if they are present.

1. C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity

2. <VWC_INSTALL_DIR>\serenity-client\plugin-packages


Login back.

0 Kudos
jonhpk
Contributor
Contributor

I logged out of the client and restarted the VMware vSphere Web Client service. The C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity directory was empty so I didn't have anything to remove. Logged back into the client (same behavior as last time).

I also created a 2nd package that I want to deploy. I was able to register it but I don't see anything about it in the logs and nothing appears in the Web Client. This component was working in development under the Virgo server that is part of the Eclipse / Spring Tool Suite development environment.

I'm able to see both of the packages (the sample and my package) listed in the Extension Manager section of the MOB browser app.

0 Kudos
rdey
Enthusiast
Enthusiast

> The C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity directory was empty

That means the plugin.zip file was not downlaoded.

The <type> field of client must me vsphere-client-serenity and that is not present in your  XML file ...

<client>

...

<type>vsphere-client-serenity</type>

...

</client>

0 Kudos
jonhpk
Contributor
Contributor

That helped.. Now starting to get some other Java exceptions in the log as it tries to deploy it which I'm currently debugging.

The documentation was not very clear about how to handle extra JAR files like vim25.jar that are not real bundles. From the errors I'm seeing in the log I take it that this shouldn't be included the bundle XML tags.

In a future release it would be really nice if the SDK samples included XML files necessary to package and deploy them.

0 Kudos
jonhpk
Contributor
Contributor

I'm getting the following error when I attempt to deploy the WSSDK Provider sample. I suspect the MANFIEST.MF file in the wssdk-provider sample incorrectly lists com.vmware.vim25 as an "Import Package' but I'm not really sure.

[2013-11-04 10:25:23.988] INFO  [INFO ] nnection(21)-192.168.102.155  o.e.v.k.m.i.deployer.ModelInstallArtifactLifecycleListener        Processing install failed event for bundle 'com.vmware.samples.wssdkprovider' version '1.0.0'

[2013-11-04 10:25:23.988] ERROR [ERROR] nnection(21)-192.168.102.155  org.eclipse.virgo.medic.eventlog.default                         DE0003E Install failed for bundle 'com.vmware.samples.wssdkprovider' version '1.0.0'.

[2013-11-04 10:25:23.988] ERROR [ERROR] nnection(21)-192.168.102.155  org.eclipse.virgo.medic.eventlog.default                         DE0500E Unable to install application from URI 'file:/C:/ProgramData/VMware/vSphere%20Web%20Client/vc-packages/vsphere-client-serenity/com.vmware.samples.wssdkui-1.0.0/plugins/vsphere-wssdk-provider.jar'. Cannot satisfy constraints for bundle 'com.vmware.samples.wssdkprovider' version '1.0.0'. Cannot resolve: com.vmware.samples.wssdkprovider

    Resolver report:

        An Import-Package could not be resolved. Caused by missing constraint in bundle <com.vmware.samples.wssdkprovider_1.0.0>

             constraint: <Import-Package: com.vmware.vim25; version="0.0.0">

. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.vmware.samples.wssdkprovider' at version '1.0.0': Cannot resolve: com.vmware.samples.wssdkprovider

    Resolver report:

        An Import-Package could not be resolved. Caused by missing constraint in bundle <com.vmware.samples.wssdkprovider_1.0.0>

             constraint: <Import-Package: com.vmware.vim25; version="0.0.0">

0 Kudos
laurentsd
VMware Employee
VMware Employee

See the SDK doc for this sample in docs/samples-doc/vsphereviews.html#vsphere-ui, you forgot to copy vim25.jar to your server/repository/usr, this library is needed at runtime.

Usage

This sample uses the VMware's WSSDK library vim25.jar, located in /vsphereviews/vsphere-wssdk-provider/lib. In order for the Virgo server to load this library during development it must be copied first in the/server/repository/usr directory, see How to use 3rd party libraries for details. (The other library, commons-logging-1.1.1.jar is already part of the Virgo repository.)

0 Kudos
jonhpk
Contributor
Contributor

I read the SDK doc asking users to copy vim25.jar to the server/repository/usr folder as a quick and dirty short cut for initial development. I didn't see it as something that would be done when deploying it as an actual application on real servers.

It was my understanding that the plugin packages are supposed to be self-contained and will be downloaded from the server(s) using URL they are registered with as needed by each server. If the packages are dependent upon an outside JAR file (like vim25.jar) being copied to each server then large scale deployment will become very messy.

0 Kudos
laurentsd
VMware Employee
VMware Employee

You read correctly 🙂  I thought you were just trying to get the example to work.

The SDK sample shows how to include vim25.jar with the plugin package for a production environment.

In your case the error is with the vim25.jar bundle id in your plugin-package.xml, you have:

   <bundle id="com.vmware.vim25" />

instead of

   <bundle id="com.vmware.wsvim25" />

> In a future release it would be really nice if the SDK samples included XML files necessary to package and deploy them.

They are provided., see samples/build/plugin-packages.

jonhpk
Contributor
Contributor

Thanks for the advice on the plugin-packages location. I had been looking for them with the vsphere-wssdk-provider code or with the vsphereviews parent folder. I didn't realize they were placed under a build folder another level up and had missed any documentation references pointing to it, if there are any.

One other item that caused us a lot of extra head aches. Hopefully this will save others some of the hassle...

There are several DIFFERENT vim25.jar files in the various VMWARE SDK libraries. The vim25.jar that is part of the vsphere-wssdk-provider sample includes a highly customized MANIFEST.MF file with a special settings to enable it to work in the Virgo environment. There are also at least 2 other vim25.jar files in other VMWARE Java SDKs (one is under an Axis folder, another under a JAXWS folder). The JAXWS vim25.jar file works fine in a development scenario when the vim25.jar file is copied to the server/repository/usr folder, but fails when we attempt to deploy it via plugin package because it is missing the MANIFEST.MF customizations. I haven't seen any references or notes around this issue but it's worth noting that not all vim25.jar files are created equal Smiley Wink.

0 Kudos
laurentsd
VMware Employee
VMware Employee

> There are several DIFFERENT vim25.jar files in the various VMWARE SDK libraries

You're right. The important thing is to follow the Web Client SDK doc that explains that all 3rd parties libraries must be OSGI-fied in order to be used with the Virgo server.  For our SDK vim25.jar is just another 3rd party library 🙂

0 Kudos
jonhpk
Contributor
Contributor

I've been looking and I haven't seen any references to OSGI being a requirement for 3rd party libraries in the plugin packages. The on-line documents I've seen don't mention 3rd party libraries at all in this context. The SDK-Tutorial.html which describe packaging much better only include these 2 lines.


<quote>

4. The initial plugin package generation can use only 1 Flex project and 1 optional Java project, but it is possible to add new .war and .jars later as explained below.

5. 3rd party libraries used by your solution should also be added to the /plugins directory and listed in <bundlesOrder/> to be part of the plugin package. These are typically java libraries that are not already available in the server/repository.


<endquote>


There is something an implied dependency on OSGI because of the <buildOlder/> tag but you'll only catch that if you're looking for it or expecting it. A casual reading of this documentation would assume that any random JAR could be used. I'd recommend calling out the OSGI dependency better in the next release.

0 Kudos