Binding configurations intermittently seem not to load properly

Hi,

First time posting :smile:

Iā€™ve made it a summer project (southern hemisphere, NZ although I hear itā€™s about as warm in TX at the moment!) to get my head around OpenHAB and so far it has gone well mixing some Milight and Insteon gear together, except for one annoying and weird problem.

When I start OpenHAB, whether the milight and insteonplm bindings pick up their configuration from openhab.cfg seems to succeed or fail at random. Sometimes one loads correctly, sometimes the other, sometimes neither, but I have to restart it something like half a dozen times for both bindings to pick up their configs, watching the log output each time.

Milight tries to send light commands to null:50000 if it doesnā€™t pick up its config (I turned on debug logging to see this), and insteonplm reports the right Hub address but claims it has 0 devices and then logs nothing further.

I am using OpenJDK on this box because I have other Java-based services running on it that work well with OpenJDK. Iā€™d rather not change this if possible.

Some log extracts:

Milight, when it fails to load its config:

2015-12-23 21:05:45.315 [DEBUG] [.b.m.internal.MilightActivator] - Milight binding has been started. 2015-12-23 21:05:47.481 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: item is of type nightMode 2015-12-23 21:05:47.481 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: sendNightMode 2015-12-23 21:05:47.482 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: messageBytes to transform: '41:00:55' 2015-12-23 21:05:47.484 [DEBUG] [.o.b.m.internal.MilightBinding] - Sent packet '41:00:55' to bridge 'kitchen' (null:50000)

Milight, when it feels like working (no changes to openhab.cfg):
2015-12-23 21:20:17.240 [DEBUG] [.b.m.internal.MilightActivator] - Milight binding has been started. ... other lines not from Milight binding ... 2015-12-23 21:20:21.423 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: item is of type nightMode 2015-12-23 21:20:21.424 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: sendNightMode 2015-12-23 21:20:21.424 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: messageBytes to transform: '41:00:55' 2015-12-23 21:20:21.425 [DEBUG] [.o.b.m.internal.MilightBinding] - Sent packet '41:00:55' to bridge 'kitchen' (192.168.1.xxx:8899)

When Iā€™ve finally restarted OpenHAB enough times to have both bindings finally load correctly, everything works great until I next need to stop it for whatever reason.

I presume thereā€™s some sort of race condition going on here ā€¦ has anyone else seen anything like this?

Hi,
It is highly recommended to use Oracle Java, not OpenJDK.
We have encountered many problems usind othe Java versions.

Best
Hans-Jƶrg

Thanks. So I tried Oracle Java by downloading and opening jre-8u66-linux-x64.tar.gz into openhab/jre, edited start.sh to point to ./jre/bin/java, and things got weirder.

The intermittent binding failure as described above continued to happen, but also wherever Iā€™d defined a number, sitemapped to a switch for a scene (ie mappings=[0=ā€œOffā€, 1=ā€œKitchenā€, 2=ā€œDiningā€]), the rules for when the state changed to 0 wouldnā€™t fire - Iā€™d get:
2015-12-28 16:22:25.905 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule 'Kitchen scenes': Could not invoke method: org.op enhab.model.script.actions.BusEvent.sendCommand(org.openhab.core.items.Item,org.openhab.core.types.Command) on instance: null

All my scene switches have that problem - any number from 1 above would work for each, 0 didnā€™t work for any. This additional problem went away when I switched back to OpenJDK.

Does that mean I can rule out the Java vendor as a cause?