eclipse-archived / smarthome-packaging-sample

Eclipse Public License 2.0
12 stars 12 forks source link

Sample not starting when running with ESH 0.9.0 beta 5 #13

Closed aluedt closed 6 years ago

aluedt commented 7 years ago

I tried to get the sample working with ESH 0.9.0.b5. I only changed the version numbers in smarthome-packaging-sample/pom.xml and smarthome-packaging-sample/distro/runtime/concierge/smarthome.xargs accordingly. The project builds fine then, but it does not start properly anymore. Most bundles remain in state "resolved" and never get "active".

There seems to be some problem with the org.eclipse.smarthome.automation.providers bundle. When I comment this in smarthome.xargs the remaining bundles start just fine and are "active" finally. Only the rule engine is not working properly then (module type registry is empty).

Any ideas?

sjsf commented 7 years ago

Any more details why it doesn't start? What gets printed to the console when you manually try to activate it? I assume some dependency is not fulfilled, but it's hard to guess without any details.

aluedt commented 7 years ago

The problem is that there's loads of bundles not starting with the sample using ESH 0.9.0.b5.

In the unmodified setup with the org.eclipse.smarthome.automation.providers bundle included the bundles are in the following state finally: Concierge> bundles Bundles: [ 0] (active) org.eclipse.concierge [ 1] (resolved) Eclipse Concierge Shell (Incubation) [ 2] (resolved) Eclipse Concierge PackageAdmin Service (Incubation) [ 3] (resolved) Eclipse Concierge StartLevel Service (Incubation) [ 4] (resolved) Eclipse Concierge XmlParser Service (Incubation) [ 5] (resolved) Apache Felix Metatype Service [ 6] (resolved) Apache Felix Configuration Admin Service [ 7] (resolved) Apache Felix EventAdmin [ 8] (resolved) Apache Felix Declarative Services [ 9] (resolved) Apache Felix Servlet API [10] (resolved) org.osgi:org.osgi.service.http [11] (resolved) slf4j-api [12] (resolved) slf4j-jdk14 [13] (resolved) jcl-over-slf4j [14] (resolved) OSGi LogService implemented over SLF4J [15] (resolved) log4j-over-slf4j [16] (resolved) Java Servlet API [17] (resolved) Commons IO [18] (resolved) Commons Lang [19] (resolved) Commons Codec [20] (resolved) Commons Exec [21] (resolved) Apache Commons Collections [22] (resolved) Commons Logging [23] (resolved) International Components for Unicode for Java (ICU4J) Replacement plug-in [24] (resolved) ANTLR Runtime [25] (resolved) Guava: Google Core Libraries for Java 1.5 [26] (resolved) Google Guice (No AOP) [27] (resolved) Gson [28] (resolved) jersey-min [29] (resolved) OSGi JAX-RS Connector [30] (resolved) JAX-RS Gson Provider [31] (resolved) Http Services Servlet [32] (resolved) Jetty :: Utilities [33] (resolved) Jetty :: IO Utility [34] (resolved) Jetty :: Http Utility [35] (resolved) Jetty :: Server Core [36] (resolved) Jetty :: Rewrite Handler [37] (resolved) Jetty :: Continuation [38] (resolved) Jetty :: Security [39] (resolved) Jetty :: Servlet Handling [40] (resolved) OSGi HttpService [41] (resolved) Jetty :: XML utilities [42] (resolved) Jetty :: Webapp Application Support [43] (resolved) Jetty :: Deployers [44] (resolved) Jetty :: OSGi :: Boot [45] (resolved) Apache Apache HttpCore OSGi bundle [46] (resolved) Apache Apache HttpClient OSGi bundle [47] (resolved) Jetty :: Asynchronous HTTP Client [48] (resolved) mapdb [49] (resolved) JUPnP Library [50] (resolved) JmDNS [51] (resolved) Eclipse SmartHome Core [52] (resolved) Eclipse SmartHome AutoUpdate Binding [53] (resolved) Eclipse SmartHome Config Core [54] (resolved) Eclipse SmartHome Core Persistence [55] (active) Eclipse SmartHome Console [56] (resolved) Eclipse SmartHome Console for OSGi Console RFC 147 [57] (resolved) Eclipse SmartHome Core Thing [58] (resolved) Eclipse SmartHome Configuration Discovery [59] (resolved) Eclipse SmartHome Config XML [60] (resolved) Eclipse SmartHome Core Binding XML [61] (resolved) Eclipse SmartHome Core Thing XML [62] (resolved) Eclipse SmartHome Scheduler Service [63] (resolved) Eclipse SmartHome Transformation Service [64] (resolved) Eclipse SmartHome Core ID [65] (resolved) Eclipse SmartHome MapDB Storage Service [66] (resolved) Eclipse SmartHome Core Audio [67] (resolved) Eclipse SmartHome Core Voice [68] (resolved) Eclipse SmartHome REST Interface Bundle [69] (resolved) Eclipse SmartHome Core REST API [70] (resolved) Eclipse SmartHome SSE REST API [71] (resolved) Eclipse SmartHome Monitor [72] (resolved) Eclipse SmartHome Net I/O Bundle [73] (resolved) Eclipse SmartHome Bonjour/MDS Service Discovery Bundle [74] (resolved) Eclipse SmartHome UPnP Transport Bundle [75] (resolved) Eclipse SmartHome Automation API [76] (resolved) Eclipse SmartHome Automation commands [77] (resolved) Eclipse SmartHome Automation Core [78] (resolved) Eclipse SmartHome Automation GSON Parser [79] (resolved) Eclipse SmartHome Automation Providers [80] (active) Eclipse SmartHome Automation REST API [81] (active) Eclipse SmartHome Automation Module Core [82] (active) Eclipse SmartHome Automation Module Script [83] (active) Eclipse SmartHome Automation Script Globals [84] (active) Eclipse SmartHome Automation Module Timer [85] (active) Eclipse SmartHome Paper UI [86] (active) YahooWeather Binding [87] (active) Eclipse SmartHome Config Dispatcher [88] (active) Apache Felix Web Management Console (All In One) [89] (active) Apache Felix File Install

As you can see, most of the bundles remain in state "resolved". Of course I could activate all (more than 60 actually) manually, but as they all start fine when I simply comment the following line

-istart ${esh.dir}/org.eclipse.smarthome.automation.providers-${esh.version}*.jar

in smarthome-packaging-sample/distro/runtime/concierge/smarthome.xargs I don't think there is a problem with dependencies of these bundles.

With the above line commented (so with everything included except org.eclipse.smarthome.automation.providers) it seems to start just fine resulting in the following state: Concierge> bundles Bundles: [ 0] (active) org.eclipse.concierge [ 1] (active) Eclipse Concierge Shell (Incubation) [ 2] (active) Eclipse Concierge PackageAdmin Service (Incubation) [ 3] (active) Eclipse Concierge StartLevel Service (Incubation) [ 4] (active) Eclipse Concierge XmlParser Service (Incubation) [ 5] (active) Apache Felix Metatype Service [ 6] (active) Apache Felix Configuration Admin Service [ 7] (active) Apache Felix EventAdmin [ 8] (active) Apache Felix Declarative Services [ 9] (active) Apache Felix Servlet API [10] (active) org.osgi:org.osgi.service.http [11] (active) slf4j-api [12] (resolved) slf4j-jdk14 [13] (active) jcl-over-slf4j [14] (active) OSGi LogService implemented over SLF4J [15] (active) log4j-over-slf4j [16] (active) Java Servlet API [17] (active) Commons IO [18] (active) Commons Lang [19] (active) Commons Codec [20] (active) Commons Exec [21] (active) Apache Commons Collections [22] (active) Commons Logging [23] (active) International Components for Unicode for Java (ICU4J) Replacement plug-in [24] (active) ANTLR Runtime [25] (active) Guava: Google Core Libraries for Java 1.5 [26] (active) Google Guice (No AOP) [27] (active) Gson [28] (active) jersey-min [29] (active) OSGi JAX-RS Connector [30] (active) JAX-RS Gson Provider [31] (active) Http Services Servlet [32] (active) Jetty :: Utilities [33] (active) Jetty :: IO Utility [34] (active) Jetty :: Http Utility [35] (active) Jetty :: Server Core [36] (active) Jetty :: Rewrite Handler [37] (active) Jetty :: Continuation [38] (active) Jetty :: Security [39] (active) Jetty :: Servlet Handling [40] (active) OSGi HttpService [41] (active) Jetty :: XML utilities [42] (active) Jetty :: Webapp Application Support [43] (active) Jetty :: Deployers [44] (active) Jetty :: OSGi :: Boot [45] (active) Apache Apache HttpCore OSGi bundle [46] (active) Apache Apache HttpClient OSGi bundle [47] (active) Jetty :: Asynchronous HTTP Client [48] (active) mapdb [49] (active) JUPnP Library [50] (active) JmDNS [51] (active) Eclipse SmartHome Core [52] (active) Eclipse SmartHome AutoUpdate Binding [53] (active) Eclipse SmartHome Config Core [54] (active) Eclipse SmartHome Core Persistence [55] (active) Eclipse SmartHome Console [56] (active) Eclipse SmartHome Console for OSGi Console RFC 147 [57] (active) Eclipse SmartHome Core Thing [58] (active) Eclipse SmartHome Configuration Discovery [59] (active) Eclipse SmartHome Config XML [60] (active) Eclipse SmartHome Core Binding XML [61] (active) Eclipse SmartHome Core Thing XML [62] (active) Eclipse SmartHome Scheduler Service [63] (active) Eclipse SmartHome Transformation Service [64] (active) Eclipse SmartHome Core ID [65] (active) Eclipse SmartHome MapDB Storage Service [66] (active) Eclipse SmartHome Core Audio [67] (active) Eclipse SmartHome Core Voice [68] (active) Eclipse SmartHome REST Interface Bundle [69] (active) Eclipse SmartHome Core REST API [70] (active) Eclipse SmartHome SSE REST API [71] (active) Eclipse SmartHome Monitor [72] (active) Eclipse SmartHome Net I/O Bundle [73] (active) Eclipse SmartHome Bonjour/MDS Service Discovery Bundle [74] (active) Eclipse SmartHome UPnP Transport Bundle [75] (active) Eclipse SmartHome Automation API [76] (active) Eclipse SmartHome Automation commands [77] (active) Eclipse SmartHome Automation Core [78] (active) Eclipse SmartHome Automation GSON Parser [79] (active) Eclipse SmartHome Automation REST API [80] (active) Eclipse SmartHome Automation Module Core [81] (active) Eclipse SmartHome Automation Module Script [82] (active) Eclipse SmartHome Automation Script Globals [83] (active) Eclipse SmartHome Automation Module Timer [84] (active) Eclipse SmartHome Paper UI [85] (active) YahooWeather Binding [86] (active) Eclipse SmartHome Config Dispatcher [87] (active) Apache Felix Web Management Console (All In One) [88] (active) Apache Felix File Install

The problem then is that the module type registry of the rule engine is empty, so rules are not working properly. Thus, the org.eclipse.smarthome.automation.providers bundle is definitely required, but there seems to be some major problem when the sample is started with this bundle included.

sjsf commented 7 years ago

What happens when you start it? I.e. in the above situation where it's stuck enter start 79 in the console?

aluedt commented 7 years ago

So only start the org.eclipse.smarthome.automation.providers bundle and ignore the other bundles not started for now, right? Here's what happens...

State before (just as in my last post, loads of bundles "resolved" only):

Concierge> bundles Bundles: [ 0] (active) org.eclipse.concierge [ 1] (resolved) Eclipse Concierge Shell (Incubation) [ 2] (resolved) Eclipse Concierge PackageAdmin Service (Incubation) [ 3] (resolved) Eclipse Concierge StartLevel Service (Incubation) [ 4] (resolved) Eclipse Concierge XmlParser Service (Incubation) [ 5] (resolved) Apache Felix Metatype Service [ 6] (resolved) Apache Felix Configuration Admin Service [ 7] (resolved) Apache Felix EventAdmin [ 8] (resolved) Apache Felix Declarative Services [ 9] (resolved) Apache Felix Servlet API [10] (resolved) org.osgi:org.osgi.service.http [11] (resolved) slf4j-api [12] (resolved) slf4j-jdk14 [13] (resolved) jcl-over-slf4j [14] (resolved) OSGi LogService implemented over SLF4J [15] (resolved) log4j-over-slf4j [16] (resolved) Java Servlet API [17] (resolved) Commons IO [18] (resolved) Commons Lang [19] (resolved) Commons Codec [20] (resolved) Commons Exec [21] (resolved) Apache Commons Collections [22] (resolved) Commons Logging [23] (resolved) International Components for Unicode for Java (ICU4J) Replacement plug-in [24] (resolved) ANTLR Runtime [25] (resolved) Guava: Google Core Libraries for Java 1.5 [26] (resolved) Google Guice (No AOP) [27] (resolved) Gson [28] (resolved) jersey-min [29] (resolved) OSGi JAX-RS Connector [30] (resolved) JAX-RS Gson Provider [31] (resolved) Http Services Servlet [32] (resolved) Jetty :: Utilities [33] (resolved) Jetty :: IO Utility [34] (resolved) Jetty :: Http Utility [35] (resolved) Jetty :: Server Core [36] (resolved) Jetty :: Rewrite Handler [37] (resolved) Jetty :: Continuation [38] (resolved) Jetty :: Security [39] (resolved) Jetty :: Servlet Handling [40] (resolved) OSGi HttpService [41] (resolved) Jetty :: XML utilities [42] (resolved) Jetty :: Webapp Application Support [43] (resolved) Jetty :: Deployers [44] (resolved) Jetty :: OSGi :: Boot [45] (resolved) Apache Apache HttpCore OSGi bundle [46] (resolved) Apache Apache HttpClient OSGi bundle [47] (resolved) Jetty :: Asynchronous HTTP Client [48] (resolved) mapdb [49] (resolved) JUPnP Library [50] (resolved) JmDNS [51] (resolved) Eclipse SmartHome Core [52] (resolved) Eclipse SmartHome AutoUpdate Binding [53] (resolved) Eclipse SmartHome Config Core [54] (resolved) Eclipse SmartHome Core Persistence [55] (active) Eclipse SmartHome Console [56] (resolved) Eclipse SmartHome Console for OSGi Console RFC 147 [57] (resolved) Eclipse SmartHome Core Thing [58] (resolved) Eclipse SmartHome Configuration Discovery [59] (resolved) Eclipse SmartHome Config XML [60] (resolved) Eclipse SmartHome Core Binding XML [61] (resolved) Eclipse SmartHome Core Thing XML [62] (resolved) Eclipse SmartHome Scheduler Service [63] (resolved) Eclipse SmartHome Transformation Service [64] (resolved) Eclipse SmartHome Core ID [65] (resolved) Eclipse SmartHome MapDB Storage Service [66] (resolved) Eclipse SmartHome Core Audio [67] (resolved) Eclipse SmartHome Core Voice [68] (resolved) Eclipse SmartHome REST Interface Bundle [69] (resolved) Eclipse SmartHome Core REST API [70] (resolved) Eclipse SmartHome SSE REST API [71] (resolved) Eclipse SmartHome Monitor [72] (resolved) Eclipse SmartHome Net I/O Bundle [73] (resolved) Eclipse SmartHome Bonjour/MDS Service Discovery Bundle [74] (resolved) Eclipse SmartHome UPnP Transport Bundle [75] (resolved) Eclipse SmartHome Automation API [76] (resolved) Eclipse SmartHome Automation commands [77] (resolved) Eclipse SmartHome Automation Core [78] (resolved) Eclipse SmartHome Automation GSON Parser [79] (resolved) Eclipse SmartHome Automation Providers [80] (active) Eclipse SmartHome Automation REST API [81] (active) Eclipse SmartHome Automation Module Core [82] (active) Eclipse SmartHome Automation Module Script [83] (active) Eclipse SmartHome Automation Script Globals [84] (active) Eclipse SmartHome Automation Module Timer [85] (active) Eclipse SmartHome Paper UI [86] (active) YahooWeather Binding [87] (active) Eclipse SmartHome Config Dispatcher [88] (active) Apache Felix Web Management Console (All In One) [89] (active) Apache Felix File Install

Then manually start the org.eclipse.smarthome.automation.providers bundle and check the result:

Concierge> start 79 [org.eclipse.smarthome.automation.providers-0.9.0.b5] started.

Concierge> services 79 Services: [org.eclipse.smarthome.automation.providers-0.9.0.b5]

Concierge> bundles Bundles: [ 0] (active) org.eclipse.concierge [ 1] (resolved) Eclipse Concierge Shell (Incubation) [ 2] (resolved) Eclipse Concierge PackageAdmin Service (Incubation) [ 3] (resolved) Eclipse Concierge StartLevel Service (Incubation) [ 4] (resolved) Eclipse Concierge XmlParser Service (Incubation) [ 5] (resolved) Apache Felix Metatype Service [ 6] (resolved) Apache Felix Configuration Admin Service [ 7] (resolved) Apache Felix EventAdmin [ 8] (resolved) Apache Felix Declarative Services [ 9] (resolved) Apache Felix Servlet API [10] (resolved) org.osgi:org.osgi.service.http [11] (resolved) slf4j-api [12] (resolved) slf4j-jdk14 [13] (resolved) jcl-over-slf4j [14] (resolved) OSGi LogService implemented over SLF4J [15] (resolved) log4j-over-slf4j [16] (resolved) Java Servlet API [17] (resolved) Commons IO [18] (resolved) Commons Lang [19] (resolved) Commons Codec [20] (resolved) Commons Exec [21] (resolved) Apache Commons Collections [22] (resolved) Commons Logging [23] (resolved) International Components for Unicode for Java (ICU4J) Replacement plug-in [24] (resolved) ANTLR Runtime [25] (resolved) Guava: Google Core Libraries for Java 1.5 [26] (resolved) Google Guice (No AOP) [27] (resolved) Gson [28] (resolved) jersey-min [29] (resolved) OSGi JAX-RS Connector [30] (resolved) JAX-RS Gson Provider [31] (resolved) Http Services Servlet [32] (resolved) Jetty :: Utilities [33] (resolved) Jetty :: IO Utility [34] (resolved) Jetty :: Http Utility [35] (resolved) Jetty :: Server Core [36] (resolved) Jetty :: Rewrite Handler [37] (resolved) Jetty :: Continuation [38] (resolved) Jetty :: Security [39] (resolved) Jetty :: Servlet Handling [40] (resolved) OSGi HttpService [41] (resolved) Jetty :: XML utilities [42] (resolved) Jetty :: Webapp Application Support [43] (resolved) Jetty :: Deployers [44] (resolved) Jetty :: OSGi :: Boot [45] (resolved) Apache Apache HttpCore OSGi bundle [46] (resolved) Apache Apache HttpClient OSGi bundle [47] (resolved) Jetty :: Asynchronous HTTP Client [48] (resolved) mapdb [49] (resolved) JUPnP Library [50] (resolved) JmDNS [51] (resolved) Eclipse SmartHome Core [52] (resolved) Eclipse SmartHome AutoUpdate Binding [53] (resolved) Eclipse SmartHome Config Core [54] (resolved) Eclipse SmartHome Core Persistence [55] (active) Eclipse SmartHome Console [56] (resolved) Eclipse SmartHome Console for OSGi Console RFC 147 [57] (resolved) Eclipse SmartHome Core Thing [58] (resolved) Eclipse SmartHome Configuration Discovery [59] (resolved) Eclipse SmartHome Config XML [60] (resolved) Eclipse SmartHome Core Binding XML [61] (resolved) Eclipse SmartHome Core Thing XML [62] (resolved) Eclipse SmartHome Scheduler Service [63] (resolved) Eclipse SmartHome Transformation Service [64] (resolved) Eclipse SmartHome Core ID [65] (resolved) Eclipse SmartHome MapDB Storage Service [66] (resolved) Eclipse SmartHome Core Audio [67] (resolved) Eclipse SmartHome Core Voice [68] (resolved) Eclipse SmartHome REST Interface Bundle [69] (resolved) Eclipse SmartHome Core REST API [70] (resolved) Eclipse SmartHome SSE REST API [71] (resolved) Eclipse SmartHome Monitor [72] (resolved) Eclipse SmartHome Net I/O Bundle [73] (resolved) Eclipse SmartHome Bonjour/MDS Service Discovery Bundle [74] (resolved) Eclipse SmartHome UPnP Transport Bundle [75] (resolved) Eclipse SmartHome Automation API [76] (resolved) Eclipse SmartHome Automation commands [77] (resolved) Eclipse SmartHome Automation Core [78] (resolved) Eclipse SmartHome Automation GSON Parser [79] (active) Eclipse SmartHome Automation Providers [80] (active) Eclipse SmartHome Automation REST API [81] (active) Eclipse SmartHome Automation Module Core [82] (active) Eclipse SmartHome Automation Module Script [83] (active) Eclipse SmartHome Automation Script Globals [84] (active) Eclipse SmartHome Automation Module Timer [85] (active) Eclipse SmartHome Paper UI [86] (active) YahooWeather Binding [87] (active) Eclipse SmartHome Config Dispatcher [88] (active) Apache Felix Web Management Console (All In One) [89] (active) Apache Felix File Install So the org.eclipse.smarthome.automation.providers bundle is "active" after starting it manually. There is no error message on the console, but though in state "active" there are no services available from the bundle. There should be 3 services up all with immediate="true" in the component definition xml (see respective component definitions in OSGI-INF in org.eclipse.smarthome.automation.providers).
sjsf commented 7 years ago

That's weird - I expected it to have some resolution errors or anything...

I just it with the latest build from yesterday on my setup (also on concierge), and I can indeed confirm this behavior! That doesn't help you yet, but at least we know it wasn't fixed in the meantime and is a good starting.

Now the question is whether the automation.providers bundle is misbehaving anyhow, or if there is a flaw in concierge that gets hit...

sjsf commented 7 years ago

Oh, I think I found it...

The automation.providers bundle does some weird s**t in HostFragmentMappingUtil.java which is used by one of its services AutomationResourceBundlesTracker.java. There it mainly tracks new bundles and on such an event it resolves some others via this utility class using the OSGi PackageAdmin service. This apparently results in a dead-lock in concierge:

"main" #1 prio=5 os_prio=31 tid=0x00007fe20b006800 nid=0x1b03 waiting on condition [0x000070000fd7c000]
   java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x0000000779608320> (a java.util.concurrent.CountDownLatch$Sync)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1037)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1328)
    at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277)
    at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:193)
    at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)
    at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)
    at org.eclipse.concierge.Concierge.notifyBundleListeners(Concierge.java:3685)
    at org.eclipse.concierge.Concierge.notifyBundleListeners(Concierge.java:3620)
    at org.eclipse.concierge.BundleImpl$Revision.markResolved(BundleImpl.java:2133)
    at org.eclipse.concierge.Concierge$ResolverImpl.resolveResource(Concierge.java:3291)
    at org.eclipse.concierge.Concierge$ResolverImpl.resolve0(Concierge.java:2879)
    at org.eclipse.concierge.Concierge.resolve(Concierge.java:2509)
    - locked <0x00000006c032ed78> (a org.eclipse.concierge.Concierge)
    at org.eclipse.concierge.Concierge.resolveBundles(Concierge.java:2272)
    at org.eclipse.concierge.compat.packageadmin.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:223)
    at org.eclipse.smarthome.automation.internal.core.provider.HostFragmentMappingUtil.fillHostFragmentMapping(HostFragmentMappingUtil.java:70)
    at org.eclipse.smarthome.automation.internal.core.provider.AutomationResourceBundlesTracker.addingBundle(AutomationResourceBundlesTracker.java:187)
    at org.eclipse.smarthome.automation.internal.core.provider.AutomationResourceBundlesTracker.addingBundle(AutomationResourceBundlesTracker.java:1)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:414)
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
    at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
    at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)
    at org.eclipse.smarthome.automation.internal.core.provider.AutomationResourceBundlesTracker.activate(AutomationResourceBundlesTracker.java:78)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)
    at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39)
    at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624)
    at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508)
    at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:149)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:315)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:127)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:871)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:838)
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:850)
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:419)
    at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:376)
    at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:172)
    at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:120)
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:258)
    at org.apache.felix.scr.impl.Activator.access$000(Activator.java:45)
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:185)
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:479)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:414)
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)
    at org.eclipse.concierge.Concierge.notifyBundleListeners(Concierge.java:3685)
    at org.eclipse.concierge.Concierge.notifyBundleListeners(Concierge.java:3620)
    at org.eclipse.concierge.BundleImpl.activate0(BundleImpl.java:586)
    at org.eclipse.concierge.BundleImpl.activate(BundleImpl.java:552)
    - locked <0x0000000779308270> (a org.eclipse.concierge.BundleImpl)
    at org.eclipse.concierge.BundleImpl.start(BundleImpl.java:506)
    at org.eclipse.concierge.BundleImpl.start(BundleImpl.java:444)
    at org.eclipse.concierge.compat.service.XargsFileLauncher.processXargsInputStream(XargsFileLauncher.java:183)
    at org.eclipse.concierge.compat.service.XargsFileLauncher.processXargsFile(XargsFileLauncher.java:83)
    at org.eclipse.concierge.Concierge.doMain(Concierge.java:606)
    at org.eclipse.concierge.Concierge.main(Concierge.java:525)

Your hint with the missing services was a pretty good one!!

maggu2810 commented 7 years ago

The automation.providers bundle does some weird s**t in HostFragmentMappingUtil.java which is used by one of its services AutomationResourceBundlesTracker.java. There it mainly tracks new bundles and on such an event it resolves some others via this utility class using the OSGi PackageAdmin service. This apparently results in a dead-lock in concierge:

Thanks for your analysis!

kaikreuzer commented 7 years ago

Most bundles remain in state "resolved" and never get "active".

Brief correction: They go active, but then shortly after fall back to resolved (no clue what causes this...)

FTR: There is no deadlock in 0.9.0.b4, so this issue seems to be provoked by changes that have been done between 0.9.0.b4 and 0.9.0.b5.

sjsf commented 6 years ago

closing as #14 added a workaround.

kaikreuzer commented 6 years ago

Well, https://github.com/eclipse/smarthome/pull/4451 fixed the issue that was reported here and #14 made this now available to the sample packaging. The workaround you refer to only addresses some other issues that popped up when using a different startup order.