Hi,

 

I am trying to upgrade our application from Felix 1.6.0 to 2.0.5, but
I'm running into some very weird behavior.

 

It used to be that we did this:

 

1)      Create a Felix config

a.       In the Felix config, set two system activators: AutoActivator
(deprecated in 2.0.5) and PlatformActivator

2)      Login to our appserver

3)      Instantiate Felix

4)      Start Felix

5)      PlatformActivator would get run, Register a service tracker

6)      FOR each registered service (in the servicetracker's
addingService method):

a.       No need to login, as that happened in step 2

b.      Perform actions on the server that require a login context

 

This changed slightly in 2.0.5. Most noticeably, the AutoActivator is
now gone and the config is a Properties object, not a Map.

 

So to load the felix config we now have to pass the configuration to new
Felix() and call Felix.init() afterwards:

We are now doing roughly this:

 

1)      Create a Felix config

a.       In the Felix config, set just one system activator:
PlatformActivator

2)      Login to our appserver

3)      Instantiate Felix(passing config as argument)

4)      Init Felix

5)      Start Felix

6)      PlatformActivator still gets run, Register a service tracker

7)      FOR each registered service (in the servicetracker's
addingService method):

a.       No need to login, as that happened in step 2 (assumption no
longer holds!!)

b.      Perform actions on the server that require a login context

c.       ERROR need to login

 

Here is the weird thing. Everything seems to work fine, BUT once our
servicetracker's addingService method gets fired and it tries to perform
operations on the appserver, assuming it's still logged in, it fails
with a LoginException.

Basically it's as if the login in step 2 never happened.

 

I still have to delve deeper into our login mechanism to find out what
it is exactly doing, but I think the login context may be saved in a
ThreadLocal object on the current Thread.

Which makes me wonder: 

 

Did anything change in the servicetracker with regards to threading?

Any other changes maybe that could cause such behavior changes?

 

I was expecting a lot to go wrong or have to be changed moving from
Felix 1.6.0 to 2.0.5, but it actually went relatively smooth. I didn't
expect any impact in this area though and I am a little surprised by it.

Is there maybe any docs I should read on this? Any pointers are welcome.
Thanks!

 

-Stijn

 

Reply via email to