Skip to content
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

[ahawastecollection] IllegalArgumentException: Unknown waste type: Weihnachtsbäume #17879

Open
Marco5943 opened this issue Dec 10, 2024 · 5 comments · May be fixed by #17950
Open

[ahawastecollection] IllegalArgumentException: Unknown waste type: Weihnachtsbäume #17879

Marco5943 opened this issue Dec 10, 2024 · 5 comments · May be fixed by #17950
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@Marco5943
Copy link

Marco5943 commented Dec 10, 2024

Expected Behavior

Waste collection dates are captured from the AHA website through defined and linked items.

Current Behavior

Waste collection dates are no longer captured due to following exception.

2024-12-10 17:34:58.290 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.IllegalArgumentException: Unknown waste type: Weihnachtsbäume
	at org.openhab.binding.ahawastecollection.internal.CollectionDate$WasteType.parseValue(CollectionDate.java:64) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaCollectionScheduleImpl.parseWasteType(AhaCollectionScheduleImpl.java:173) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaCollectionScheduleImpl.parseRows(AhaCollectionScheduleImpl.java:132) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaCollectionScheduleImpl.getCollectionDates(AhaCollectionScheduleImpl.java:109) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaWasteCollectionHandler.loadCollectionDates(AhaWasteCollectionHandler.java:84) ~[?:?]
	at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
	at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaWasteCollectionHandler.updateCollectionDates(AhaWasteCollectionHandler.java:167) ~[?:?]
	at org.openhab.binding.ahawastecollection.internal.AhaWasteCollectionHandler.lambda$2(AhaWasteCollectionHandler.java:124) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:840) [?:?]

Possible Solution

There might be a new waste category "Weihnachtsbäume" that is not supported by the binding yet.

Steps to Reproduce (for Bugs)

  1. Restart the binding (Thing) or Openhab and the exception shows up. Items stay at NULL

Context

Your Environment

  • Version used: openHAB 4.2.3
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...):
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): Openhabian
@Marco5943 Marco5943 added the bug An unexpected problem or unintended behavior of an add-on label Dec 10, 2024
@lsiepel
Copy link
Contributor

lsiepel commented Dec 24, 2024

Can you try this jar https://1drv.ms/u/s!AnMcxmvEeupwj49KMnQ3vzEIZLkpRA?e=pmrC4d it should work on 4.3.0.

  1. Make sure you have openHAB 4.3.0
  2. Uninstall the shipped binding (does not affect your configuration of items/channels etc)
  3. Drop the downloaded jar file in your addon folder
  4. Report back your results. if there are still issues, verify in main UI that the proper binding version is loaded.

@Marco5943
Copy link
Author

Thanks for investigating. Seems that is only a network binding that you provided? For me it has something to do with the ahawastecollection binding as AHA provided new data element for collecting christmas trees (Weihnachtsbäume). The binding throws that exception because it only expects generalWaste, leightweightPackaging, bioWaste and paper. During christmas time there is another date in their calendars called Weihnachtsbäume for collecting christmas trees.

Problem is that the binding exits with the exception and does not fill the other date attributes that could be captured correctly from the response.

In addition I found out that the documentation on how to find out the right Thing parameters is not working any more. There is no Form Data any more that could be found within the Developer Editor... have to investigate into that again but now I also haven't got the right configuration parameters any more.

@lsiepel
Copy link
Contributor

lsiepel commented Dec 25, 2024

Thanks for investigating. Seems that is only a network binding that you provided? For me it has something to do with the ahawastecollection binding as AHA provided new data element for collecting christmas trees (Weihnachtsbäume). The binding throws that exception because it only expects generalWaste, leightweightPackaging, bioWaste and paper. During christmas time there is another date in their calendars called Weihnachtsbäume for collecting christmas trees.

Problem is that the binding exits with the exception and does not fill the other date attributes that could be captured correctly from the response.

In addition I found out that the documentation on how to find out the right Thing parameters is not working any more. There is no Form Data any more that could be found within the Developer Editor... have to investigate into that again but now I also haven't got the right configuration parameters any more.

Sorry link to wrong file, will provide a new link later today.

@lsiepel
Copy link
Contributor

lsiepel commented Dec 25, 2024

This should be the right link: https://1drv.ms/u/s!AnMcxmvEeupwj49KMnQ3vzEIZLkpRA?e=ubHWGK

@Marco5943
Copy link
Author

Unfortunately another error occurs. Seems that there is another package needed "org.josup". Do I need an additional package for that?
2024-12-26 12:06:21.222 [ERROR] [Events.Framework ] - FrameworkEvent ERROR org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.ahawastecollection [300] Unresolved requirement: Import-Package: org.jsoup; version="[1.15.0,2.0.0)" at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1783) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi-3.18.0.jar:?] 2024-12-26 12:06:26.157 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.ahawastecollection-5.0.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.ahawastecollection [300] Unresolved requirement: Import-Package: org.jsoup; version="[1.15.0,2.0.0)" at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?] at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.7.4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants