View Full Version : Unsatisfied leaf constraints:
Beta User
Jun 2nd, 2008, 03:53 AM
Hi,
I have bundled an OSGI project (from Eclipse) and this one runs perfectly in Equinox. But when I deploy it insidde S2AP, I receive the following error :
[2008-06-02 12:51:09.889] Connection(4)-10.66.34.5 <SPDE0018E> Unable to install application from location 'file:/C:/Opensource/springsource-ap-1.0.0.beta4/stage/camel-spring.jar/'. Could not satisfy constraints for bundle 'camel_spring' at version '1.0.0'.
Cannot resolve: camel_spring
Unsatisfied leaf constraints:
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.bundle.spring.core; bundle-version="2.5.0"
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.bundle.spring.context; bundle-version="2.5.0"
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.bundle.spring.beans; bundle-version="2.5.0"
.
[2008-06-02 12:51:10.076] Connection(4)-10.66.34.5 <SPDE0011E> Deployment failed.
Here is my META-INF file of the bundle :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: camel_spring
Bundle-SymbolicName: camel_spring
Bundle-Version: 1.0.0
Export-Package: com.xpectis.services
Bundle-ClassPath: META-INF/lib/jaxb-api-2.1.jar,
META-INF/lib/jaxb-impl-2.1.3.jar,
META-INF/lib/stax-api-1.0-2.jar,
META-INF/lib/activation-1.1.jar,
META-INF/lib/camel-core-1.3.0.jar,
META-INF/lib/camel-osgi-1.3.0.jar,
META-INF/lib/camel-spring-1.3.0.jar,
META-INF/lib/camel-xstream-1.3.0.jar,
META-INF/lib/xbean-spring-3.0.jar,
META-INF/lib/commons-beanutils-1.6.1.jar,
META-INF/lib/commons-collections-3.2.jar,
META-INF/lib/commons-logging-1.1.jar,
target/classes/
Require-Bundle: org.springframework.bundle.spring.beans;bundle-version="2.5.0",
org.springframework.bundle.spring.context;bundle-version="2.5.0",
org.springframework.bundle.spring.core;bundle-version="2.5.0"
What is the root cause of this issue ?
charles
robh
Jun 2nd, 2008, 04:01 AM
Charles,
The Camel bundle has expressed a Require-Bundle constraint on the bundles org.springframework.bundle.spring.core (and .context and .beans). The Spring bundles distributed with the Platform are named:
org.springframework.beans
org.springframework.core
org.springframework.context
You can easily edit the camel bundles to reflect this.
Rob
Beta User
Jun 2nd, 2008, 05:20 AM
The problem is still there even when modifying the meta-inf configuration file
[2008-06-02 14:16:53.999] Connection(4)-10.66.34.5 <SPDE0018E> Unable to install application from location 'file:/C:/Opensource/springsource-ap-1.x/stage/camel-spring.jar/'. Could not satisfy constraints for bundle 'camel_spring' at version '1.0.0'.
Cannot resolve: camel_spring
Unsatisfied leaf constraints:
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.spring.beans; bundle-version="0.0.0"
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.spring.context; bundle-version="0.0.0"
Bundle: camel_spring_1.0.0 - Require-Bundle: org.springframework.spring.core; bundle-version="0.0.0"
Config
Require-Bundle: org.springframework.spring.beans;resolution:=optio nal,
org.springframework.spring.context;resolution:=opt ional,
org.springframework.spring.core;resolution:=option al
or
Require-Bundle: org.springframework.spring.beans
org.springframework.spring.context
org.springframework.spring.core
robh
Jun 2nd, 2008, 05:38 AM
Charles,
You don't need the extra .spring. part in the BSN. Try:
Require-Bundle: org.springframework.beans,org.springframework.cont ext,org.springframework.core
Regards,
Rob
Beta User
Jun 2nd, 2008, 06:25 AM
Youppy, It works but I have the following error :
Caused by: java.lang.ClassNotFoundException: com.xpectis.services.MyTransform not found from bundle [camel_spring]
This class exist in my Eclipse project and is defined in the bundle under Bundle-ClassPath:
target/classes/
robh
Jun 2nd, 2008, 06:31 AM
This is possibly an issue with Camel. I don't really know how it does its classloading. Do you pass it the ClassLoader for your bundle? If so, then I suspect there might be an error in your manifest. If not (as I suspect) then the issue is with Camel. You will have to export the com.xpectis.services package and have Camel import it.
Rob
Beta User
Jun 2nd, 2008, 06:45 AM
Apache Camel has been created top of Spring and use the application context of Spring. So the class loading is done by spring. Under the S2APP folder com.springsource.platform.deployer, I see the folder camel-spring.jar-0. Inside the fodler camel-spring.jar-0, there are two folders (packed and camel-spring.jar). The camel-spring.jar contains the com/xpectis/services folders where my class is. In the META-INF file, my package Export-Package: com.xpectis.services is well declared to be exportable.
REMARK : As mentioned earlier, everything works fine inside equinox of Eclipse
Caused by: org.springframework.beans.factory.CannotLoadBeanCl assException: Cannot find class [com.xpectis.services.MyTransform] for bean with name 'myTransform' defined in URL [bundleentry://71/META-INF/spring/camelContext.xml]; nested exception is java.lang.ClassNotFoundException: com.xpectis.services.MyTransform not found from bundle [camel_spring]
at org.springframework.beans.factory.support.Abstract BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1138)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.predictBeanType(Abstrac tAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.Abstract BeanFactory.isFactoryBean(AbstractBeanFactory.java :1174)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanNamesForType(DefaultList ableBeanFactory.java:222)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeansOfType(DefaultListableB eanFactory.java:303)
at org.springframework.context.support.AbstractApplic ationContext.getBeansOfType(AbstractApplicationCon text.java:948)
at org.apache.camel.spring.CamelContextFactoryBean.in stallRoutes(CamelContextFactoryBean.java:287)
at org.apache.camel.spring.CamelContextFactoryBean.af terPropertiesSet(CamelContextFactoryBean.java:137)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1367)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1333)
... 33 more
Caused by: java.lang.ClassNotFoundException: com.xpectis.services.MyTransform not found from bundle [camel_spring]
at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass(BundleDelegatingClassLoader.java :103)
at org.springframework.osgi.util.BundleDelegatingClas sLoader.loadClass(BundleDelegatingClassLoader.java :156)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.springframework.util.ClassUtils.forName(ClassU tils.java:249)
at org.springframework.beans.factory.support.Abstract BeanDefinition.resolveBeanClass(AbstractBeanDefini tion.java:381)
at org.springframework.beans.factory.support.Abstract BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1135)
... 42 more
Caused by: java.lang.ClassNotFoundException: com.xpectis.services.MyTransform in PlatformBundleClassLoader: [bundle=camel_spring_1.0.0]
at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC lassLoader.java:134)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.loadClass(BundleLoader.java:313)
at org.eclipse.osgi.framework.internal.core.BundleHos t.loadClass(BundleHost.java:227)
at org.eclipse.osgi.framework.internal.core.AbstractB undle.loadClass(AbstractBundle.java:1273)
at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass(BundleDelegatingClassLoader.java :99)
... 47 more
Caused by: java.lang.ClassNotFoundException: com.xpectis.services.MyTransform
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClassInternal(BundleLoader.java:481)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:87)
at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC lassLoader.java:132)
... 52 more
robh
Jun 2nd, 2008, 06:54 AM
Charles,
When running in Equinox without S2AP what version of Spring are you using?
Rob
Beta User
Jun 2nd, 2008, 07:13 AM
Spring 2.5.2.
My environment is Spring Suite Tool 1.0.0 & Spring Dynamic Module 1.0.2 as target platform
robh
Jun 2nd, 2008, 07:45 AM
Up until Spring 2.5.4, the AOP jar had a DynamicImport-Package: * header. The AOP bundle is used by Spring DM in a special fashion, the resulting effect being that DM-powered bundles could happily load almost any type, even those they were not wired to.
I suspect that if you tried running with 2.5.4 in standalone Equinox your application would not work.
It's quite dangerous to rely on DI-P in that fashion, hence the reason we removed it. You don't really have much control over where your types come from which can be disastrous in a multi-version environment.
Rob
Beta User
Jun 2nd, 2008, 08:01 AM
Is the upgrade from 2.5.2 to 2.5.4 available in spring-osgi-1.1.0-m2 ? If this is the case, how can I switch in Spring Suite Tool the target platform from Spring-DM 1.0.2 to 1.1.0 ?
robh
Jun 2nd, 2008, 08:10 AM
You can use 2.5.4 with DM 1.0.2 if you choose. As far as upgrading the target platform goes - I have no idea :)
I've flagged this thread with Christian so you can expect an answer from him.
Regards,
Rob
Beta User
Jun 2nd, 2008, 08:14 AM
Many thank for your help
Christian Dupuis
Jun 2nd, 2008, 02:11 PM
Charles,
depending of the version of Spring IDE and/or STS you are using you can find the target platform definition the following directory:
<eclipse_home>/plugins/org.springframework.ide.eclipse.osgi.targetdefinit ion_<highest_version>/release/target/plugins
There you can find the Spring JARs which you can replace with the 2.5.4 release jars. Make sure to reload the target platform from within Eclipse after you replaced the jars.
Let me know if that works.
Christian
Beta User
Jun 10th, 2008, 02:30 AM
No. The same error already reported is always there.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.