ItemNotFoundException / Cannot retrieve item

2,889 views
Skip to first unread message

prav...@gmail.com

unread,
Dec 25, 2013, 5:00:10 PM12/25/13
to ope...@googlegroups.com
Just in case someone has the same issue - I set up an openhab instance on a raspberry pi and created / edited the config files on my windows machine with Notepad++ via TotalCommander SFTP plugin.
Somehow my item configuration files got corrupted, giving me something like this in the openhab log whenever i tried to load the web site or pushed the test switch:

22:46:10.329 DEBUG o.o.m.i.i.GenericItemProvider[:133] - Read items from model 'knx.items'
22:46:10.336 DEBUG o.o.m.i.i.GenericItemProvider[:133] - Read items from model 'tcp.items'
22:46:10.343 DEBUG o.o.m.i.i.GenericItemProvider[:133] - Read items from model 'fritzbox.items'
22:46:28.515 WARN  o.o.u.w.i.r.SwitchRenderer[:70] - Cannot determine item type of 'Testlampe'
org.openhab.core.items.ItemNotFoundException: Item 'Testlampe' could not be found in the item registry
        at org.openhab.core.internal.items.ItemRegistryImpl.getItem(ItemRegistryImpl.java:80)
        at org.openhab.ui.internal.items.ItemUIRegistryImpl.getItem(ItemUIRegistryImpl.java:517)
        at org.openhab.ui.webapp.internal.render.SwitchRenderer.renderWidget(SwitchRenderer.java:57)
        at org.openhab.ui.webapp.internal.render.PageRenderer.renderWidget(PageRenderer.java:158)
        at org.openhab.ui.webapp.internal.render.PageRenderer.processChildren(PageRenderer.java:121)
        at org.openhab.ui.webapp.internal.render.PageRenderer.processChildren(PageRenderer.java:138)
        at org.openhab.ui.webapp.internal.render.PageRenderer.processPage(PageRenderer.java:86)
        at org.openhab.ui.webapp.internal.servlet.WebAppServlet.service(WebAppServlet.java:126)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
22:46:28.542 ERROR o.o.u.i.i.ItemUIRegistryImpl[:401] - Cannot retrieve item 'Testlampe' for widget org.openhab.model.sitemap.Switch
22:46:28.560 ERROR o.o.u.i.i.ItemUIRegistryImpl[:401] - Cannot retrieve item 'Testlampe' for widget org.openhab.model.sitemap.Switch
22:46:28.568 ERROR o.o.u.i.i.ItemUIRegistryImpl[:401] - Cannot retrieve item 'Testlampe' for widget org.openhab.model.sitemap.Switch
22:46:28.578 ERROR o.o.u.i.i.ItemUIRegistryImpl[:401] - Cannot retrieve item 'Testlampe' for widget org.openhab.model.sitemap.Switch
22:46:30.137 WARN  o.o.u.w.i.servlet.CmdServlet[:100] - Received command 'TOGGLE' for item 'Testlampe', but the item does not exist in the registry
22:46:31.833 WARN  o.o.u.w.i.servlet.CmdServlet[:100] - Received command 'TOGGLE' for item 'Testlampe', but the item does not exist in the registry

(Using logback_debug.xml)

After some investigation it turned out to be the UTF-8 byte order mark (BOM), thats was confusing openhab. If you create config files with Notepad++, make sure you chose "UTF-8 without BOM" from the encoding menu.

I tried with and without BOM and removing it solved the issue.

Kai Kreuzer

unread,
Dec 25, 2013, 7:32:07 PM12/25/13
to ope...@googlegroups.com
Hi,

Thanks a lot for this analysis! This indeed explains an effect that I have heard from many users already (especially the ones not using the openHAB Designer ;-)).
I would actually consider this as a bug; UTF-8 encoded files should also be read correctly when they have a BOM. I have entered a new issue for it: https://github.com/openhab/openhab/issues/670

Cheers,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages