« Return to Thread: [OSGI] SLSB Business Interfaces registered multiple times as Services

Re: Re: [OSGI] SLSB Business Interfaces registered multiple times as Services

by Guillaume Sauthier :: Rate this Message:

Reply to Author | View in Thread

ekke a écrit :

> Guillaume,
>
> Bean A has @Local and @Remote
> so there should be 2 registered services for this bean:
> one for the local and one for the remote
>
> but if I have Beans A,B,C,D then there should be 8 services,
> buit there are 20:
> 8 for A
> 6 for B
> 4 for C
> 2 for D
>
> and if I list the services from OSGI console I see (looking at the id)
> that they are registered like the list below
In this order ?
Or is D started first, and then C, then B and finally A ?

After a little digging in our code ,I've seen something wrong, but it
does not explains the behavior at first glance...
In EZB, we have the concept of BindingFactory, that manage how we
publishes business interfaces of the beans.
So there is a default one, that manages JNDI. And for OSGi, we added an
OSGiBindingFactory. This is that class that register/unregister services
for your bean's interfaces.
This factory is added in a singleton BindingManager.
It's added during the core component startup, but it's never removed.
You see where I wanna go ?
if you start multiple cores, the OSGiBindingFactory will be registered
multiple times, with the effect of adding 2 more services (1 for @Local
1 for @Remote) for each of your beans ...

So the question is: "Do you start multiple cores ?"

Cheers
--Guillaume

>
> so I think there must be something wrong
>
> I think you have testcases with more then one bean to see if the
> services are registered, but perhaps you only test if there's a service
> found for the remote or local interface and not how many exist ?
>
> ekke
>
> Guillaume Sauthier schrieb:
>> Yes, that's strange
>> Business interfaces should be registered only when the ejbjar is
>> started.
>> Notice that all the business interfaces of the bean are registered,
>> so if you have multiples local or remote interfaces, it ends up with
>> multiple registration.
>> Are your beans reusing the interfaces? so it's normal that they gets
>> registered multiple times ...
>>
>> --G
>>
>> ekke a écrit :
>>> just noticed a strange thing,
>>> while tracking services I noticed, that Services for SLSB are
>>> registered more then one time.
>>>
>>> think your loop is wrong
>>>
>>> it goes this way:
>>>
>>> ALocal
>>> ARemote
>>> ALocal
>>> ARemote
>>> BLocal
>>> BRemote
>>> ALocal
>>> ARemote
>>> BLocal
>>> BRemote
>>> CLocal
>>> CRemoteALocal
>>> ARemote
>>> BLocal
>>> BRemote
>>> CLocal
>>> CRemote
>>> DLocal
>>> DRemote
>>>
>>> and so on...
>>> my service.id is > 80.000 ;-)
>>>
>>> should I report this as bug ?
>>>
>>> ekke
>>> (using 1.1.0 snapshot 2008_07_23)
>>>
>>>
>>>
>>
>
>
>

[Guillaume_Sauthier.vcf]

begin:vcard
fn:Guillaume Sauthier
n:Sauthier;Guillaume
org:<a href="http://www.ow2.org"><img title="OW2" alt="OW2 Consortium" border="0" src="http://www.ow2.org/xwiki/bin/skin/XWiki/DefaultSkin/logoOW2.png" /></a>
adr:;;;;;;France
email;internet:guillaume.sauthier@...
title:<a href="http://jonas.ow2.org">JOnAS Application Server</a>
x-mozilla-html:TRUE
url:http://jonas.ow2.org
version:2.1
end:vcard


 « Return to Thread: [OSGI] SLSB Business Interfaces registered multiple times as Services