[ https://issues.apache.org/jira/browse/ARIES-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464780#comment-16464780 ]
Raymond Augé commented on ARIES-1799: ------------------------------------- it's because of a bug in {{public ServiceRegistrationOSGiImpl( String[] clazz, Supplier<Object> service, Supplier<Map<String, ?>> properties)}} which just passes the supplier rather than invoking it. > [component-dsl] When registering a service from a Supplier<T> an exception > occurs > --------------------------------------------------------------------------------- > > Key: ARIES-1799 > URL: https://issues.apache.org/jira/browse/ARIES-1799 > Project: Aries > Issue Type: Bug > Reporter: Raymond Augé > Priority: Major > > using the method > {\{static <T> OSGi<ServiceRegistration<T>> register(Class<T> clazz, > Supplier<T> service, Supplier<Map<String, ?>> properties)}} > I get an exception like so: > {code} > ! Failed to start bundle > org.apache.aries.jax.rs.whiteboard-0.0.1.201805051342, exception activator > error The service object is not an instance of the service class > javax.ws.rs.ext.MessageBodyReader from: > org.eclipse.osgi.internal.serviceregistry.ServiceRegistry:registerService#220 > org.osgi.framework.BundleException: Exception in > org.apache.aries.jax.rs.whiteboard.activator.CxfJaxrsBundleActivator.start() > of bundle org.apache.aries.jax.rs.whiteboard. > at > org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792) > at > org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) > at > org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941) > at > org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318) > at org.eclipse.osgi.container.Module.doStart(Module.java:571) > at org.eclipse.osgi.container.Module.start(Module.java:439) > at > org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392) > at aQute.launcher.Launcher.startBundles(Launcher.java:517) > at aQute.launcher.Launcher.activate(Launcher.java:423) > at aQute.launcher.Launcher.run(Launcher.java:301) > at aQute.launcher.Launcher.main(Launcher.java:147) > Caused by: java.lang.IllegalArgumentException: The service object is not an > instance of the service class javax.ws.rs.ext.MessageBodyReader > at > org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:220) > at > org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) > at > org.apache.aries.component.dsl.internal.ServiceRegistrationOSGiImpl.lambda$new$2(ServiceRegistrationOSGiImpl.java:67) > at org.apache.aries.component.dsl.internal.OSGiImpl.run(OSGiImpl.java:50) > at org.apache.aries.component.dsl.OSGi.lambda$effects$61(OSGi.java:520) > at > org.apache.aries.component.dsl.internal.OSGiImpl.lambda$create$0(OSGiImpl.java:39) > at org.apache.aries.component.dsl.internal.OSGiImpl.run(OSGiImpl.java:50) > at > org.apache.aries.component.dsl.internal.IgnoreImpl.lambda$new$1(IgnoreImpl.java:29) > at org.apache.aries.component.dsl.internal.OSGiImpl.run(OSGiImpl.java:50) > at > org.apache.aries.component.dsl.internal.AllOSGi.lambda$null$0(AllOSGi.java:40) > at > java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) > at > java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) > at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) > at > java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) > at > java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) > at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) > at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) > at > org.apache.aries.component.dsl.internal.AllOSGi.lambda$new$2(AllOSGi.java:41) > at org.apache.aries.component.dsl.internal.OSGiImpl.run(OSGiImpl.java:50) > at org.apache.aries.component.dsl.internal.OSGiImpl.run(OSGiImpl.java:44) > at > org.apache.aries.jax.rs.whiteboard.activator.CxfJaxrsBundleActivator.start(CxfJaxrsBundleActivator.java:105) > at > org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) > at > org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) > at java.security.AccessController.doPrivileged(Native Method) > at > org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) > ... 10 more > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)