With the latest Felix dep mgr required service dependencies may be null when
start is invoked
---------------------------------------------------------------------------------------------
Key: AMDATU-297
URL: http://jira.amdatu.org/jira/browse/AMDATU-297
Project: Amdatu
Issue Type: Bug
Components: Amdatu Core
Affects Versions: 0.1.0
Reporter: Ivo Ladage - van Doorn
Fix For: 0.1.0
Attachments: AMDATU-297.zip
With the latest 3.0.0-SNAPSHOT version committed in the Amdatu trunk (but the
latest version in the Felix trunk as well) a new issue has been introduced with
services already being started without their required service dependencies
being available. This didn't happen with previous versions of the Felix dep
mgr, as the one attached (not sure what version that is).
The use case is this:
- I have a two tenant aware services; Test service a and Test service b
- Test service B defines a required dependency on Test service A in its init()
method
- Test service B defines a required dependency on the
CassandraPersistenceManager in its init() method
The problem is that the start() method of Test service B is invoked before Test
service A is available, and so the reference to Test service A is null in its
start() method.
I attached two bundles with which the problem can be reproduced, also source
code is attached.
Reproduction steps:
-1- Start a clean Amdatu (so empty work dir)
-2- Copy the two test service bundles to the deploy directory
-3- Probably the error is already visible right now ("!!!!!!!!!!!!!!!! TEST
SERVICE A IS NULL !!!!!!!!!!!!!!").
If not; remove bundle testservice a from the deploy directory, wait for it
to be uninstalled, then add it again
The problem seems to be that two required service dependencies are defined in
the init() method of TestServiceBImpl. If I remove the
CassandraPersistenceManager dependency, it works like a charm.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira