Can't get OpenHAB started (the 500 error)

Description > Setup > Error log

Description
Hello everybody, I’ve spent the past 6 hours trying to install OpenHAB. None of the solutions I have found online up until now have worked. I followed the Wiki completely (the apt-get method); I can’t even get the demo running.
I’ve tried to track the errors (Java Exceptions) but have not had any luck finding anything. A friend told me his setup works fine, it might just be the version (1.8.1).

Setup
Raspberry Pi 1 B+ running Raspbian Wheezy, ran apt-get update & apt-get upgrade today. Had Domoticz running before installing OpenHab, but removed it from init.d and rebooted so that shouldn’t be an issue.

Error log
From the tails log (tail -f /var/log/openhab/openhab.log)

016-05-07 00:24:24.827 [ERROR] [.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.lang.ClassCastException: org.openhab.binding.http.internal.HttpGenericBindingProvider cannot be cast to org.openhab.binding.http.HttpBindingProvider
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:135) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]

From the website (ipaddress:8080/openhab.app

HTTP ERROR 500

Problem accessing /openhab.app. Reason:

Sitemap 'demo' could not be found

Caused by:

org.openhab.ui.webapp.render.RenderException: Sitemap ‘demo’ could not be found
at org.openhab.ui.webapp.internal.servlet.WebAppServlet.service(WebAppServlet.java:115)
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)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:350)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:744)

This is exactly the configuration I have working, so it shouldn’t be a problem. Version 1.8.1 actually worked better that 1.8.2 in regards to gui updating, so its probably better to stick with that.

I’m not sure about the first trace, but the second indicates that it can’t find the demo.sitemap file, which should be in /etc/openhab/configurations/sitemaps/ with read permissions for user openhab.

This is my sitemap directory listing

$ ls -l
total 20
-rwxrw-rw-  1 openhab openhab 5855 May  4 14:35 default.sitemap
-rw-r--r--  1 openhab openhab  233 Mar 21 23:31 README
-rw-r--r--+ 1 openhab openhab 5502 Mar 26 09:43 temperatures.sitemap

Are you sure its there with the correct permissions?

1 Like

Thank you so much, this really helped.

  • I didn’t have the sitemaps in the etc/openhab/configurations/sitemaps folder, but in the opt/openhab/configurations/sitemaps folder; a simple cp solved this.
  • The permissions were not configured correctly either, chown solved this
    Thanks for your help, this information isn’t on the wiki (afaik).
    Time to try out openhab!

Yes, they are, but the little problem here is, that you have to know if you did a manual install or an apt-get install:

Sitemap files are stored in ${openhab_home}/configurations/sitemaps.

site configuration /etc/openhab

So if people do a manual install, sitemap files go to opt/openhab/configurations/sitemaps, if they do an apt-get install, sitemap files go to /etc/openhab/configurations/sitemaps.

1 Like