Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Try to use osgi compendium services Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Try to use osgi compendium services

    Hi everybody,

    i try to set up a project using "maven" defining the project. "bundlor" to create the osgi manifest, "Spring extender" to instantiate and get references of services. Virgo as the osgi runtime org.osgi.compendium as the api imported and equinox bundles as implementations of the compendium services !

    in mavens pom i defined the api´s i need and defined the scope as provided, because i think they are available in the runtime. (i also provided them into the runtime to be sure they are available)

    pom.xml
    Code:
    		<dependency>
    			<groupId>org.osgi</groupId>
    			<artifactId>org.osgi.core</artifactId>
    			<version>4.2.0</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.osgi</groupId>
    			<artifactId>org.osgi.compendium</artifactId>
    			<version>4.2.0</version>
    			<scope>provided</scope>
    		</dependency>
    the manifest file created by the bundlor (only the import) i think this looks right.

    manifest.mf
    Code:
    Import-Package: org.osgi.framework,org.osgi.service.cm,org.osgi.servic
    e.event,org.osgi.service.log,org.springframework.beans.factory.annotatio
    n,org.springframework.core.style,org.springframework.util
    the spring extender tries to get an instance of the LogService by interface

    bundle-context-osgi.xml
    Code:
    	<reference
    		id="logService"
    		interface="org.osgi.service.log.LogService" />
    to be sure not missing anything i served these jar into the pickup folder of vigor

    pickup folder
    Code:
    org.eclipse.equinox.cm_1.0.200.v20100520.jar
    org.eclipse.equinox.event_1.2.0.v20100503.jar
    org.eclipse.equinox.log_1.2.100.v20100503.jar
    org.eclipse.equinox.util_1.0.200.v20100503.jar
    org.eclipse.osgi.util_3.2.100.v20100503.jar
    org.osgi.compendium-4.2.0.jar
    org.osgi.core-4.2.0.jar
    and i face to this output and have no clue how to solve this issue.
    Code:
    [2010-10-10 16:46:42.378] Thread-7                     <AG0000E> Application context creation failure for bundle 'osgi.supervisor.scada' version '0.0.0'. org.sp
    ringframework.beans.factory.BeanCreationException: Error creating bean with name 'logService': Initialization of bean failed; nested exception is org.springfram
    ework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class[]' for property 'interfaces'; n
    ested exception is java.lang.IllegalArgumentException: Cannot find class [org.osgi.service.log.LogService]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    	at org.springframework.osgi.extender.internal.dependencies.startup.MandatoryImporterDependencyFactory.getServiceDependencies(MandatoryImporterDependencyFactory
    .java:63)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.doFindDependencies(DependencyServiceManager.java:272)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.access$700(DependencyServiceManager.java:40)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager$1.run(DependencyServiceManager.java:213)
    	at org.springframework.osgi.extender.internal.util.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:124)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.findServiceDependencies(DependencyServiceManager.java:209)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecut
    or.java:239)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecuto
    r.java:169)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
    	at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
    	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:619)
    Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class[]' for
     property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.osgi.service.log.LogService]
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:457)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1351)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1310)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    	... 19 common frames omitted
    Caused by: java.lang.IllegalArgumentException: Cannot find class [org.osgi.service.log.LogService]
    	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:294)
    	at org.springframework.beans.propertyeditors.ClassArrayEditor.setAsText(ClassArrayEditor.java:67)
    	at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:474)
    	at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:446)
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:215)
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
    	... 23 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.osgi.service.log.LogService not found from bundle [osgi.supervisor.scada]
    	at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
    	at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    	at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
    	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:291)
    	... 29 common frames omitted
    Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.osgi.service.log.LogService in KernelBundleClassLoader: [bundle=osgi.supe
    rvisor.scada_0.0.0]
    	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:139)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)
    	at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
    	... 33 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.osgi.service.log.LogService
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135)
    	... 38 common frames omitted

    meanwhile i try to get an instance of the eventAdmin Service of the osgi.compendium an i packed a small project where this exception occurs.
    the project has just the aim to get a reference to the eventAdmin Service with spring tools.
    maybe you could give it a try ? please.
    in the project there is only one OSGi class which sould autowired with an instance of the eventAdmin Service.
    the eventAdmin service is defined in the bundle-context-osgi.xml.
    the imports are all generated with spring-bundlor and an template definition.
    hope anyone can find a solution for my problem.

    i use a default virgo.webserver installation without any modifications and start all out of SpringToolsSuite (eclipse)

    i would appreciate any help

    thanks
Working...
X