blob: a38fb96cd54a28de5400f681c31db76e7c12d0aa [file] [log] [blame]
Carsten Ziegelerdb301862011-11-18 09:40:49 +00001OSGi Service Diagnostics and WebConsole Plugin
2==============================================
3
Arjun Panday0462b392012-11-07 18:55:10 +00004This projects aims at easing diagnostics of OSGi services and finding about missing and/or circular dependencies.
Carsten Ziegelerdb301862011-11-18 09:40:49 +00005
6Typically in a large system with many cascading dependencies managed by different trackers such as DeclarativeService, DependencyManager or others, tracking the root cause of a top level service not being started can become very cumbersome. When building service oriented architectures, it is often the case that a single missing requirement will lock a full stack of services, but to find that one requirement is like finding a needle in a haystack!
7
8The basic idea here is to ask each dependency manager instance about its unresolved dependencies, merge all answers and filter the result to keep only the root causes.
9
10Typically, if A depends on B which depends on C which depends on D, and D is nowhere to be found, I need only show the "C -> D" missing requirement; if D is resolved, then the whole stack is unlocked.
11
12Similarly, if D is known by another dependency management system, but unregistered because it depends on E which is missing, then only the "D -> E" requirement is relevant.
13
14Project organization (core):
15============================
16* servicediagnostics: the API package. It holds the main service interface as well as the plugin interface, to extend to other dependency management systems
17
18* servicediagnostics.impl: the implementation package. It contains plugins implementations for org.apache.felix.scr and org.apache.felix.dependencymanager, as well as the main service implementation.
19
20* servicediagnostics.webconsole: a Felix WebConsole plugin that displays a graphical view of the diagnostics result. Alternatively it can also show a graph of all services currently registered in the service registry and the bundles using them. See Screenshot-notavail.png and Screenshot-all.png.
21
22The "sample" part simply contains some test classes and a helper class to launch Felix.
23
24How to build the project:
25=========================
26
27> mvn install
28
29How to run:
30===========
31I'm providing a simple run script just to try out the service.
Carsten Ziegelerdb301862011-11-18 09:40:49 +000032> ./run.sh
33
34It should display:
35[INFO] Started jetty 6.1.x at port(s) HTTP:8080
36
37You can then point your browser to
38http://localhost:8080/system/console/servicegraph
39
40(login/password is admin/admin)
Arjun Panday1ac6f912012-11-25 22:53:28 +000041then click on either "Show Not Avail" or "Show Service Registry"
42The nodes can be dragged around for better readability. The colors are random and don't mean anything.
43On the "Service Registry" view, arrows point from bundles to the services they use.
44On the "Not Avail" view, arrows point from a leaf component to its missing dependencies.
Carsten Ziegelerdb301862011-11-18 09:40:49 +000045
46(note: the lib directory is provided for dependencies that are not readily available as OSGi bundles from maven)
47
48Issues & TODOs:
49===============
Carsten Ziegelerdb301862011-11-18 09:40:49 +000050* no support for iPojo, Blueprint, basic ServiceTrackers... more plugins could be developed. I only wrote the ones i'm using.
Arjun Panday1ac6f912012-11-25 22:53:28 +000051* should package proper tests