VMware {code} Community
virat1234
Enthusiast
Enthusiast

Unable to satisfy dependency "org.springframework.http" on vCenter 5.5.1

[2017-05-25 23:25:45.806] [ERROR] TCP Connection(9)-127.0.0.1 org.eclipse.virgo.medic.eventlog.default DE0002E Installation of bundle 'com.company.hi' version '5.0.0' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.company.hi' at version '5.0.0': Cannot resolve: com.company.hi

  Resolver report:

  An Import-Package could not be resolved. Resolver error data <Import-Package: org.springframework.http; version="3.1.4">. Caused by missing constraint in bundle <com.company.hi_5.0.0>

  constraint: <Import-Package: org.springframework.http; version="3.1.4">

vSphere web client version: Version 5.5.0 Build 1588022

This works fine on 6.0 and 6.5 vCenter, but not on 5.5.1. I can see the jars on the server but for some reason it is unable to pick it up

localhost:/usr/lib/vmware-vsphere-client # find . -name *spring-web*

./server/repository/ext/spring-web-3.1.2.RELEASE.jar

./server/repository/ext/spring-webmvc-3.1.2.RELEASE.jar

./server/repository/ext/spring-webmvc-portlet-3.1.2.RELEASE.jar

localhost:/usr/lib/vmware-vsphere-client # pwd

/usr/lib/vmware-vsphere-client

in my MANIFEST.MF I have the following under import-packages

Import-Package: org.apache.commons.logging,

org.springframework.flex.core,

flex.messaging,

com.vmware.vise.usersession,

com.vmware.vise.data,

com.vmware.vise.data.query,

com.vmware.vise.data.uri,

com.vmware.vise.vim.data,

javax.activation,

javax.xml.ws,

javax.net.ssl,

javax.jws,

javax.servlet.http,

javax.xml.bind,

javax.xml.bind.annotation,

javax.xml.datatype,

javax.xml.namespace,

org.springframework.http,

org.springframework.beans.factory.annotation,

org.springframework.stereotype,

org.springframework.util,

org.springframework.web.bind.annotation,

org.springframework.web.servlet

0 Kudos
3 Replies
_vladi_
VMware Employee
VMware Employee

Hi Virat,

Thanks for the provided details and good problem description.

To me it looks like there is something missing:

- your server has spring-web version 3.1.2 which is the default version that all plugins reuse and cannot override (it becomes the main one to use in the OSGi container).

- your bundle fails to deploy expecting version 3.1.4

- yet I don't see your MANIFEST.MF specifying this version dependency. It has no versions of the Import-Packages (note that having versioned imports is a best practice, as the latest samples demonstrate). This means that your bundle's dependency to org.springframework.http can be satisfied by any deployed bundle exporting the package and should have been satisfied by the existing version 3.1.2.

Here we are in a hunt for the bundle that is specifying dependency to 3.1.4. Could it be another bundle of yours? What is Bundle-SymbolicName of the MANIFEST.MF you attached?

Could you please also provide a longer stacktrace of the dependency error as sometimes the issue is hidden in there?

Thanks a lot.

Cheers,

Vladi

0 Kudos
virat1234
Enthusiast
Enthusiast

Hi Vlad,

I noticed that one of our UI packages manifest had the version info specified for that particular package, I removed that and it worked. I was looking in wrong manifest file until now.

0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi Virat,

Great you found it.

Just FYI, it is always better to specify a version (we even log warnings in the plugin-medic.log for that) - just make sure the version covers the Web Client versions supported by your plugin. For example in your case the best practice is to specify: org.springframework.http;version="3.1.2" which means "version 3.1.2 or above". This covers future Web Client releases as well but you could limit it if required e.g. org.springframework.http;version="[3.1.2, 3.2.0)" in case you are using features that could be deprecated/removed in major releases of the library.

Cheers,

Vladi

0 Kudos