I went ahead and fixed this more “properly”. Basically, I updated the Spring version range in the bundle manifests to allow 4.x for the imports. It IS possible (with a BUNCH of restrictions) to use Spring 4 in OSGi, just not with spring-dm. Thus, allowing the import is important.
However, for the karaf features.xml file, I restricted it to 3.x since the features file also installs spring-dm. Thus, when using Karaf, you will get spring3.2.x and spring-dm. The tests thus pass (other than a couple tests that are failing for me, but they are failing without this change as well). Dan > On Nov 1, 2014, at 6:23 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: > > -1 > > You cannot use spring 4.x in karaf/osgi as spring-dm fails, and you > get a ton of errors. Try running > > cd tests > cd camel-itest-osgi > mvn clean install > > And you get errors such as > > 2014-11-01 11:22:02,028 | INFO | FelixStartLevel | Activator > | 69 - org.apache.camel.camel-core - 2.15.0.SNAPSHOT | > Camel activator started > ERROR: Bundle org.apache.camel.camel-spring [91] Error starting > mvn:org.apache.camel/camel-spring/2.15-SNAPSHOT > (org.osgi.framework.BundleException: Uses constraint violation. Unable > to resolve bundle revision org.apache.camel.camel-spring [91.0] > because it is exposed to package > 'org.springframework.beans.factory.support' from bundle revisions > org.apache.servicemix.bundles.spring-beans [80.0] and > org.apache.servicemix.bundles.spring-beans [74.0] via two dependency > chains. > > Chain 1: > org.apache.camel.camel-spring [91.0] > import: > (&(osgi.wiring.package=org.springframework.beans.factory.support)(version>=3.2.0)(!(version>=4.2.0))) > | > export: osgi.wiring.package=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-beans [80.0] > > Chain 2: > org.apache.camel.camel-spring [91.0] > import: > (&(osgi.wiring.package=org.springframework.transaction.support)(version>=3.2.0)(!(version>=4.2.0))) > | > export: osgi.wiring.package=org.springframework.transaction.support; > uses:=org.springframework.aop.scope > org.apache.servicemix.bundles.spring-tx [89.0] > import: > (&(osgi.wiring.package=org.springframework.aop.scope)(version>=4.0.5.RELEASE)(!(version>=4.1.0))) > | > export: osgi.wiring.package=org.springframework.aop.scope; > uses:=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-aop [75.0] > import: > (&(osgi.wiring.package=org.springframework.beans.factory.support)(version>=4.0.5.RELEASE)(!(version>=4.1.0))) > | > export: osgi.wiring.package=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-beans [74.0]) > org.osgi.framework.BundleException: Uses constraint violation. Unable > to resolve bundle revision org.apache.camel.camel-spring [91.0] > because it is exposed to package > 'org.springframework.beans.factory.support' from bundle revisions > org.apache.servicemix.bundles.spring-beans [80.0] and > org.apache.servicemix.bundles.spring-beans [74.0] via two dependency > chains. > > Chain 1: > org.apache.camel.camel-spring [91.0] > import: > (&(osgi.wiring.package=org.springframework.beans.factory.support)(version>=3.2.0)(!(version>=4.2.0))) > | > export: osgi.wiring.package=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-beans [80.0] > > Chain 2: > org.apache.camel.camel-spring [91.0] > import: > (&(osgi.wiring.package=org.springframework.transaction.support)(version>=3.2.0)(!(version>=4.2.0))) > | > export: osgi.wiring.package=org.springframework.transaction.support; > uses:=org.springframework.aop.scope > org.apache.servicemix.bundles.spring-tx [89.0] > import: > (&(osgi.wiring.package=org.springframework.aop.scope)(version>=4.0.5.RELEASE)(!(version>=4.1.0))) > | > export: osgi.wiring.package=org.springframework.aop.scope; > uses:=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-aop [75.0] > import: > (&(osgi.wiring.package=org.springframework.beans.factory.support)(version>=4.0.5.RELEASE)(!(version>=4.1.0))) > | > export: osgi.wiring.package=org.springframework.beans.factory.support > org.apache.servicemix.bundles.spring-beans [74.0] > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4006) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) > at > org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) > at java.lang.Thread.run(Thread.java:744) > > > I am reverting the import range to limit spring as 3.x > > > On Thu, Oct 30, 2014 at 7:35 PM, <cmuel...@apache.org> wrote: >> Repository: camel >> Updated Branches: >> refs/heads/master 3e77f050d -> f1b2010b1 >> >> >> CAMEL-7887: Executing of 'mvn clean install -Pvalidate' in >> camel/platforms/karaf/features is failing >> >> >> Project: http://git-wip-us.apache.org/repos/asf/camel/repo >> Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f1b2010b >> Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f1b2010b >> Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f1b2010b >> >> Branch: refs/heads/master >> Commit: f1b2010b14ade983cfd69432611a31b2ff19d1f4 >> Parents: 3e77f05 >> Author: Christian Mueller <cmuel...@apache.org> >> Authored: Thu Oct 30 19:34:40 2014 +0100 >> Committer: Christian Mueller <cmuel...@apache.org> >> Committed: Thu Oct 30 19:34:56 2014 +0100 >> >> ---------------------------------------------------------------------- >> parent/pom.xml | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/camel/blob/f1b2010b/parent/pom.xml >> ---------------------------------------------------------------------- >> diff --git a/parent/pom.xml b/parent/pom.xml >> index 92b27c4..c58fee8 100644 >> --- a/parent/pom.xml >> +++ b/parent/pom.xml >> @@ -409,8 +409,7 @@ >> <spring-ldap-version>1.3.1.RELEASE</spring-ldap-version> >> <spring-ldap-bundle-version>1.3.1.RELEASE_2</spring-ldap-bundle-version> >> <spring-retry-version>1.0.3.RELEASE</spring-retry-version> >> - <!-- spring-dm does not support spring 4.x so import-range must be 3.x >> only until a solution in karaf exists --> >> - <spring-version-range>[3.2,4)</spring-version-range> >> + <spring-version-range>[3.2,4.2)</spring-version-range> >> <spring-version>${spring4-version}</spring-version> >> <spring32-version>3.2.11.RELEASE</spring32-version> >> <spring40-version>4.0.7.RELEASE</spring40-version> >> > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > Email: cib...@redhat.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > hawtio: http://hawt.io/ > fabric8: http://fabric8.io/ -- Daniel Kulp dk...@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com