-
-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diverse connection problems on Karaf-based runtime #96
Comments
I assume this one looks better 😉
diff --git a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/activebinding.xml b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/activebinding.xml
index 1716bf3..a37e144 100644
--- a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/activebinding.xml
+++ b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/activebinding.xml
@@ -9,7 +9,7 @@
http://www.eclipse.org/legal/epl-v10.html
-->
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="org.openhab.binding.zwave.activebinding">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" immediate="true" name="org.openhab.binding.zwave.activebinding">
<implementation class="org.openhab.binding.zwave.internal.ZWaveActiveBinding"/>
<service>
diff --git a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/genericbindingprovider.xml b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/genericbindingprovider.xml
index 4568107..e926210 100644
--- a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/genericbindingprovider.xml
+++ b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/genericbindingprovider.xml
@@ -9,7 +9,7 @@
http://www.eclipse.org/legal/epl-v10.html
-->
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.openhab.binding.zwave.genericbindingprovider">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.zwave.genericbindingprovider">
<implementation class="org.openhab.binding.zwave.internal.ZWaveGenericBindingProvider"/>
<service>
<provide interface="org.openhab.model.item.binding.BindingConfigReader"/>
diff --git a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/openhabconfiguration.xml b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/openhabconfiguration.xml
index 93bc660..82acdf8 100644
--- a/bundles/binding/org.openhab.binding.zwave/OSGI-INF/openhabconfiguration.xml
+++ b/bundles/binding/org.openhab.binding.zwave/OSGI-INF/openhabconfiguration.xml
@@ -9,7 +9,7 @@
http://www.eclipse.org/legal/epl-v10.html
-->
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.openhab.binding.zwave.configuration">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.zwave.configuration">
<implementation class="org.openhab.binding.zwave.internal.config.ZWaveConfiguration"/>
<!-- <property name="openhabconfig.bundle" type="String" value="org.openhab.binding.zwave"/> |
As you stated in #96 immediate have to be set to true. |
Looks indeed much better (@cdjackson: FYI!). |
OSGi Compendium 5.0.0 |
If I read this correctly "the activation of the component configuration is delayed until the registered service is requested" I would say, that the activation should not be done and if this is done, the DS implementation is not compliant with the spec. |
I don't know if there is a configuration parameter that all delayed components are interpret as immediate components. |
The org.eclipse.equinox.ds bundle of the target platform seems to be not the newest one (1.4.200.v20131126-2331) have to look at the compendium spec this implementation is using. |
I just tried the immediate=true on KNX, but at startup I now have 3 calls to |
I have no KNX hardware at home, so I assume I cannot test this one. |
But you have seen the same effect on other components already - they are started multiple times at system startup. This is definitely something that needs to be solved... Will try to find the reason in this specific case (but I actually think you do not need any KNX hardware for testing, you only have to start the bundle). |
I am not an OSGi expert but perhaps the configuration admin triggers the activation of the component once. After that the component is no longer required and get's deactivated. Sure, I have seen this a long time ago (you solved that for me as I run the first time into it), but I never complained that a non-immediate component gets deactivated. I see that this is a problem now, as the most bundles does not declare themselves to be an immediate one. I just want to help you to find the reasons for the error. |
Regarding your ZWave fix: I actually do not understand, why the immediate should be necessary there:
|
I added it to all of three to see if this changes something at all. Perhaps it is not need for all / just for one. Does what you stated about the activebinding.xml fit to my previous post? |
Don't know, will have to investigate further
No, my observation of the 3 calls in KNX to the same setter of a component was AFTER setting immediate to true. So it might rather
Something like this... |
Some interesting stack which I caught when shutting down the runtime:
The bundle event is about the knx binding bundle - it hence tries to do |
The knx.config DS is the only one that only provides CM and nothing else.
After setting this one to immediate, all are active
But I still don't know, how I can test this binding without hardware. |
If I set ip=127.0.0.1 I get this one (it is clear that establish connection failed)...
|
I'm not quite sure of the link to Zwave here but Zwave does connect to the port and data is received so the connection is working briefly. If I can work out how to replace a bundle under karaf I'll do some further testing tonight (with the latest build, putting a file in the addons folder it wasn't picked up). |
@cdjackson |
At least I hope this is what @maggu2810 demonstrated in #96 (comment) - so this should be the patch to make the ZWave binding work; would be great if @cdjackson could test and confirm this! |
Ok. I've not read through all the messages as am on my phone but will take a look when I get home in an hour or so. Thanks. Sent from my iPhone
|
@maggu2810 Is there any way to replace Apache SCR with Equinox DS in Karaf? I would like to give it a try to see if the problems are resolved then or if I am digging at the wrong place. |
I would assume you can remove the scr bundle and install equinox ds instead. |
The Equinox DS implementation does need org.eclipse.equinox.internal.util.event, so you have also to use Equinox Event Manager |
Will send you a mail... |
Just set up my Raspi2 with Raspbian and the Build 84 of the openhab distro karaf beta. I'm also experiencing this issue that with KNX Binding 1.9.SNAPSHOT I can switch switches but do not receive any events. Just let me know If I could test anything to help. |
Ok - so it seems that for zwave, if I add immediate=true to the activebinding.xml, it works. |
(thanks @maggu2810) |
@maggu2810, Setup a second openHAB 1.8 with KNX Binding, use config like:
The other openHAB2 KNX1.8 Binding, change busaddr or do not set:
Do not set any other configuration parameters of KNX1.8! After that, define a Item and add it to a Sitemap too, like this in both obenHAB:
|
@lewie Thank you, will try it... |
@maggu2810, no need, I think I just have it working in this second! |
Fix for KNX is here: openhab/openhab1-addons#3839 Both ZWave and KNX fixes should be included in https://openhab.ci.cloudbees.com/job/openHAB-Distribution/90/ already - @lewie, would be great if you could test! |
@kaikreuzer, Yeah, well done! :-) In OH2 I get these other abnormalities:
I'm really glad that it now works with karaf, all its Framework features, webconsole and so on. I do a lot with MQTT / ActiveMQ, therefor karaf is extremely helpful. |
Thanks @lewie, that's good news!
Already reported: eclipse-archived/smarthome#870
Already reported: #84
Never seen. But it indeeds points to a bug in the rrd4j bundle. Created openhab/openhab1-addons#3845. |
Closing this issue as there does not seem to be a general problem as initially guessed. |
We have multiple bindings that work smoothly on the alpha2, but not anymore on the Karaf-based beta1, which all show some connectivity problems:
In all cases, the reason for the problem is completely unknown and there are no helpful log entries.
I tested it with the KNX binding myself: Running exactly the same code and configuration from within the IDE is fine, but running it on Karaf results in no events being received from KNX.
Does anybody have any idea, what might cause such things? What is potentially different in Karaf handling sockets or other connections?
The text was updated successfully, but these errors were encountered: