You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Ephemeris Lappis <ep...@gmail.com> on 2023/02/16 10:01:04 UTC

Invalid service reference in bundle

Hello.

A new strange issue on service references. I've been deploying and
testing many times the same bundles with a similar Karaf
configuration, and after a last fresh install, I've a strange state on
a service reference.

A bundle exposes a service, and it appears clearly with "ls" :

[info.xxxxxx.yyyyy.com.caterpillar.buddy.ExchangeBuddy]
-------------------------------------------------------
 osgi.service.blueprint.compname = myBuddy
 service.bundleid = 209
 service.id = 527
 service.scope = bundle
Provided by :
 Caterpillar::Buddy::Service (209)

A bundle that references the service is started, with Camel routes
started too. But when I execute the routes and the service is called,
the proxy link seems to be broken, and throws an exception :

Caused by: java.lang.IllegalStateException: getService() returned null
for [info.xxxxxx.yyyyy.com.caterpillar.buddy.ExchangeBuddy]
at org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:285)
~[?:?]
at org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:57)
~[?:?]
at org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:341)
~[?:?]
at Proxyd0de80fb_17c6_4baf_b52d_6af454df575e.transcode(Unknown Source) ~[?:?]
at info.xxxxxx.yyyyy.com.brick.bbbmmm999_f901.util.DemoHelper.printValeurTranscodee(DemoHelper.java:20)
~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor27.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:382)
~[?:?]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:494) ~[?:?]
at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:316)
~[?:?]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:286)
~[?:?]
at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:146)
~[?:?]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81)
~[?:?]
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:818)
~[?:?]
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:726)
~[?:?]

No error message when deploying all the features...
What does it mean ? How can we be sure that deployed features/bundles
with no error are actually ready to work ?

FYI, just restarting the bundle makes it work again.

Thanks for your help.

Regards.