Closed aryeharmon closed 6 years ago
I would assume this is because the name at https://github.com/openhab/openhab2-addons/blame/master/addons/binding/org.openhab.binding.coolmasternet/OSGI-INF/coolmasternetHandlerFactory.xml#L14 is wrong with the respect to upper case cs lower case. What platform do you run on?
i am running on a mac
java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
@projectgus do you have time to take a look at this, my suggestion might be the solution but there could also be another problem.
@martinvw i tried what you suggested and got:
15:05:40.982 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling thing handler factory 'org.openhab.binding.coolmasternet.internal.CoolMasterNetHandlerFactory@676f89d0': org.eclipse.smarthome.core.thing.internal.ThingImpl cannot be cast to org.eclipse.smarthome.core.thing.Bridge
java.lang.ClassCastException: org.eclipse.smarthome.core.thing.internal.ThingImpl cannot be cast to org.eclipse.smarthome.core.thing.Bridge
at org.openhab.binding.coolmasternet.internal.CoolMasterNetHandlerFactory.createHandler(CoolMasterNetHandlerFactory.java:47)[184:org.openhab.binding.coolmasternet:2.2.0.201707091119]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerHandler(BaseThingHandlerFactory.java:98)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
at org.eclipse.smarthome.core.thing.internal.ThingManager.doRegisterHandler(ThingManager.java:606)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
@martinvw actually i had to reconfigure my settings for some reason. So this worked. Thanks a lot. I will make a pull request later today.
Thanks @martinvw, @aryeharmon . Apologies, I think as part of the original PR review I changed some class casing and I obviously missed a spot. If @aryeharmon deoesn't have time to send a PR then let me know and I can.
@aryeharmon will you create the PR?
Would be a perfect time to use annotations instead of manually creating the OSGi DS xmls.
After changing coolmasternetHandlerFactory.xml it works.
@projectgus can you make the PR, please also follow @davidgraeff his hint to use annotations instead, see for example https://github.com/openhab/openhab2-addons/pull/2673
@davidgraeff do you have a better example for @projectgus ?
I tried changing the name in the OSGi file but got the same error as aryeharmon. what specifically did you do to make it work that?
thanks!