Hi,

I'm puzzling through some strange behaviour in my application related to what appears to be a race and/or some weird interaction between services registered via SCR and bundles trying to monitor these services via the ServiceTracker API.

I don't have any good theories at the moment, so I was hoping if I described what I'm seeing it might job somebody's memory...

Here's my situation. I have an application made up of about a half- dozen or so bundles, most (but not all) of which register their services using DS/SCR. I'm using pax:exam to run automated functional tests for this application. Unfortunately, my tests are not reliable - they fail intermittently. When there's a failure, it's always because of an NPE on one of the SCR-injected @Reference attributes of a service/component. It's hard to tell for sure, but what looks like is happening is this:
1. The SCR starts and registers a component/service
2. The functional test, which was waiting for that service to become available, gets a reference to the service 3. The SCR stops the service, then immediately starts and registers a new instance of the service

Unfortunately, at this point the test bundle now has a reference to the "stopped" instance of the service, which has had all of its @Reference fields set to null (hence the NPE).

What I can't figure out is why this is happening.

Anyone have any suggestions about where I should look next, or any known SCR gotchas that I might be running into?

Thanks,

Kris

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to