openhab-core: [thing actions] Actions fail to execute after a binding restart
Reference my comment here.
Most (if not all) thing action implementations contain code that looks like this.
public static void restart(@Nullable ThingActions actions) {
if (actions instanceof DoorbirdActions) {
((DoorbirdActions) actions).restart();
} else {
throw new IllegalArgumentException("Instance is not a DoorbirdActionsService class");
}
}
Normally, the instanceof
test succeeds. However, after installing a new version of the binding, this test fails, which causes the code to throw IllegalArgumentException
when invoking the action from a rule. This condition can only be cleared by restarting openHAB. There are several ways to reproduce this, one of which is to drop a new version of a binding into addons
that overwrites an older version that’s already there.
After installing the new version of the binding, it appears that the classloader instances are different. I suspect this is what’s causing the instanceof
test to fail.
Before installing new binding version:
2019-12-09 09:23:02.018 [INFO ] [ding.doorbird.action.DoorbirdActions] - DoorbirdActions classloader org.eclipse.osgi.internal.loader.EquinoxClassLoader@50578098[org.openhab.binding.doorbird:2.5.0.201912091420(id=245)]
2019-12-09 09:23:02.019 [INFO ] [ding.doorbird.action.DoorbirdActions] - ThingActions actions classloader org.eclipse.osgi.internal.loader.EquinoxClassLoader@50578098[org.openhab.binding.doorbird:2.5.0.201912091420(id=245)]
After installing new binding version:
2019-12-09 09:24:39.813 [INFO ] [ding.doorbird.action.DoorbirdActions] - DoorbirdActions classloader org.eclipse.osgi.internal.loader.EquinoxClassLoader@50578098[org.openhab.binding.doorbird:2.5.0.201912091423(id=245)]
2019-12-09 09:24:39.814 [INFO ] [ding.doorbird.action.DoorbirdActions] - ThingActions actions classloader org.eclipse.osgi.internal.loader.EquinoxClassLoader@1c14e241[org.openhab.binding.doorbird:2.5.0.201912091423(id=245)]
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 33 (33 by maintainers)
Commits related to this issue
- [lgwebos] Thing actions still working after a bundle restart Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to openhab/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to openhab/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: CSchlipp <christian@schlipp.de> — committed to CSchlipp/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to CSchlipp/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: MPH80 <michael@hazelden.me> — committed to MPH80/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-core#1... — committed to MPH80/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to andrewfg/openhab-addons by lolodomo 4 years ago
- [hue] Thing actions still working after a bundle restart (#8115) Related to openhab/openhab-core#1265 Signed-off-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: Daan Meijer <daan@studioseptembe... — committed to DaanMeijer/openhab-addons by lolodomo 4 years ago
- [lgwebos] Thing actions still working after a bundle restart (#8114) * [lgwebos] Thing actions still working after a bundle restart * Action getApplications removed Related to openhab/openhab-cor... — committed to DaanMeijer/openhab-addons by lolodomo 4 years ago
How many? At least 9. That is a lot when you face of such issue.
What is blocking us from making a bug fix release for core? These ugly workarounds are lots of work and also are not very inviting to add more thing actions to current bindings?
The good news is that so far I’ve not been able to replicate the issue using the NGRE.