Hi,

Most likely this error is caused by bundle start sequence. Per the async nature 
of OSGi, your logic shouldn't rely on the bundle start sequence.
So if you want to send message to 
ENDPOINT_NAME=ID:myhost-13ab72ce48c-0:0
but this endpoint isn't up yet, you see such exception.

Several options.
Option1
if you use karaf feature to deploy bundles, you can specify lower start-level 
to the bundle which you wanna start early. This way is simple and very helpful 
in most cases, but it still can't fully guarantee bundle start sequence.

So Option2
The only way I know can guarantee one bundle(A) fully started before another 
one(bundleB) is  that bundle A export an OSGi service and bundle B refer this 
OSGi service.

Freeman

-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-10-31, at 下午11:31, gasius wrote:

> Hi,
> 
> I need to call JBI endpoint from my OSGi bundle using blueprint (route to
> legacy application). At first I received NPE in JbiEndpoint when deploying
> bundle. After finding issue 
> https://issues.apache.org/jira/browse/SMXCOMP-945
> <https://issues.apache.org/jira/browse/SMXCOMP-945>   I installed
> servicemix-camel version 2011.02.2 and it solved that problem. But now
> everything works well only before SMX restart. After restart I receive NPE
> in another place /JbiBinding.createJbiMessageExchange(JbiBinding.java:151)/.
> The only way to fix this is to stop SMX, clean data/cache directory, start
> SMX and make fresh installation of my applications. But this is very tedious
> activity.
> 
> Comparing logs of fresh and not-fresh start of application I have found one
> difference. When it is fresh start I see this:
> 
> /ManagementEndpointRegistry       | 170 -
> org.apache.servicemix.nmr.management - 1.5.0 | Registering endpoint:
> org.apache.servicemix.nmr.core.InternalEndpointWrapper@9ce5306e with
> properties {ENDPOINT_NAME=ID:myhost-13ab72ce48c-0:0,
> javax.jbi.servicedesc.ServiceEndpoint=org.apache.servicemix.common.ExternalEndpoint@2091ad16,
> jbi.external=true,
> NAME={http://camel.apache.org/schema/jbi}provider:ID:myhost-13ab72ce48c-0:0,
> objectClass=[Ljava.lang.String;@3bfa900e, service.id=426,
> SERVICE_NAME={http://camel.apache.org/schema/jbi}provider,
> UNTARGETABLE=true}/
> 
> But I cannot see anything like this for non-fresh start. Can someone advise
> me?
> 
> 
> 
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/Can-not-call-JBI-endpoint-from-blueprint-tp5714805.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to