Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Weather binding fails to start on openHAB 2 #3829

Closed
kaikreuzer opened this issue Jan 17, 2016 · 4 comments
Closed

Weather binding fails to start on openHAB 2 #3829

kaikreuzer opened this issue Jan 17, 2016 · 4 comments
Assignees

Comments

@kaikreuzer
Copy link
Member

On openHAB 2, I get the following exception:

23:39:46.995 [ERROR] [.weather.internal.bus.WeatherBinding] - Error activating WeatherBinding: CommonId for provider YAHOO with id 0 already exists
java.lang.IllegalArgumentException: CommonId for provider YAHOO with id 0 already exists
    at org.openhab.binding.weather.internal.parser.CommonIdHandler.addCommonId(CommonIdHandler.java:85)
    at org.openhab.binding.weather.internal.parser.CommonIdHandler.loadMapping(CommonIdHandler.java:73)
    at org.openhab.binding.weather.internal.bus.WeatherBinding.activate(WeatherBinding.java:55)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_40]
    at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_40]
    at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)

The binding should allow that the activate() method is called multiple times (with deactivate inbetween of course).

@pyjamasam
Copy link

The weather binding is being activated and deactivated multiple times. The binding.xml wasn't updated with the immediate="true" fix when that was done on a bunch of bindings. (weatherservlet.xml was updated but binding.xml wasn't).

Adding immediate="true" to the binding.xml file causes the binding to be only activated once and we don't get the duplicate id exception.

That being said I get the following lines:

2016-01-21 12:39:35.088 [ERROR] [org.openhab.binding.weather ] - [org.openhab.binding.weather(214)] bind method [addBindingProvider] not found; Component will fail 2016-01-21 12:39:35.097 [ERROR] [org.openhab.binding.weather ] - [org.openhab.binding.weather(214)] bind method [addBindingProvider] not found

And then later in the log the WeatherJobScheduler states:
Disabling weather locationId 'beamsville', no binding available

More then likely they are related as the binding isn't being fully registered.

@watou
Copy link
Contributor

watou commented Jan 21, 2016

This might be similar to @kaikreuzer's PR #3861 earlier today.

@pyjamasam
Copy link

Adding an implementation for addBindingProvider and removeBindingProvider as per that PR makes those errors go away, but so far I still don't have a working weather binding.

WeatherGenericBindingProvider::processBindingConfiguration doesn't ever seem to get called.

Also as a side note, if you start and stop the binding repeatdly you still get the duplicate key error.
Adding providerCommonIds.clear(); to CommonIdHandler::loadMapping cleans that up (and it seams like it should have that as we shouldn't be loading the map over and over again and trying to stuff it into the same structure.

I realize that I am making a bunch of changes and a proper pull request will be the ultimate goal, but for now I am just hacking away and posting my findings here.

@lolodomo
Copy link
Contributor

Just tested the last 2.0 snapshot using Wunderground as weather provider and I got the same result as you @pyjamasam that is "Disabling weather locationId 'home', no binding available".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants