Problem registering service [message #676965] |
Tue, 07 June 2011 02:26  |
Eclipse User |
|
|
|
Hello.
I am trying to register this OSGi service via Spring DM:
<bean id="bundleInspector" class="com.iggroup.administrator.business.internal.BundleInspector">
<property name="bundleContext" ref="bundleContext" />
</bean>
<osgi:service id="bundleInspector" ref="bundleInspector"
interface="com.iggroup.administrator.api.business.BundleService"/>
where BundleInspector implements BundleService.
However I get the exception below. Any idea what I may be doing wrong?
TIA,
B.
[2011-06-07 07:13:23.291] region-dm-3 <AG0000E> Application context creation failure for bundle 'com.iggroup.administrator.business' version '0.0.1.SNAPSHOT'. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bundleInspector': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Exported service object does not implement the given interface: interface org.osgi.framework.ServiceRegistration is not assignable to interface com.iggroup.administrator.api.business.BundleService
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
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:662)
Caused by: java.lang.IllegalArgumentException: Exported service object does not implement the given interface: interface org.osgi.framework.ServiceRegistration is not assignable to interface com.iggroup.administrator.api.business.BundleService
at org.springframework.util.Assert.isAssignable(Assert.java:368)
at org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean.afterPropertiesSet(OsgiServiceFactoryBean.java:197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 17 common frames omitted
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03261 seconds