eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
861 stars 784 forks source link

404 on rest/events caused by enocean binding #3931

Closed mjohenneken closed 7 years ago

mjohenneken commented 7 years ago

Bug description The REST endpoint "rest/events" returns only 404 Not Found. I think this happens because the system is not able to start the bundle org.eclipse.smarthome.io.rest.sse because of an Exception(stacktrace below) in SseActivator.start(). This is caused by line 44 new SseFeature() not able to cast bundleresource://21.fwk737394/javax/ws/rs/ext/RuntimeDelegate.class to bundleresource://21.fwk737394/javax/ws/rs/ext/RuntimeDelegate.class .

I uninstalled the enocean Binding but that doesn't help.

How to reproduce

Details openhab version: 2.1.0 Hardware: Raspberry Pi 2 (openhabian Image) Installed bundles bundle:list

START LEVEL 100 , List Threshold: 50
 ID | State    | Lvl | Version                | Name
------------------------------------------------------------------------------------------------------
  9 | Active   |  80 | 5.3.1.201602281253     | OSGi JAX-RS Connector
 10 | Active   |  80 | 2.3.1                  | Gson
 11 | Active   |  80 | 18.0.0                 | Guava: Google Core Libraries for Java
 12 | Active   |  80 | 3.0.0.v201312141243    | Google Guice (No AOP)
 13 | Active   |  80 | 1.5.8                  | swagger-annotations
 14 | Active   |  80 | 3.19.0.GA              | Javassist
 16 | Active   |  80 | 3.5.2                  | JmDNS
 19 | Active   |  80 | 1.1.0.Final            | Bean Validation API
 21 | Active   |  80 | 2.0.1                  | javax.ws.rs-api
 23 | Active   |  80 | 3.2.0.v201101311130    | ANTLR Runtime
 26 | Active   |  80 | 1.6.0                  | Commons Codec
 27 | Active   |  80 | 3.2.1                  | Commons Collections
 28 | Active   |  80 | 1.1                    | Commons Exec
 29 | Active   |  80 | 2.2.0                  | Commons IO
 30 | Active   |  80 | 2.6                    | Commons Lang
 35 | Active   |  80 | 4.2.3                  | Apache HttpClient OSGi bundle
 36 | Active   |  80 | 4.2.3                  | Apache HttpCore OSGi bundle
 57 | Active   |  80 | 4.0.8                  | Apache Karaf :: Wrapper :: Core
 58 | Active   |  80 | 3.1.0.7                | Apache ServiceMix :: Bundles :: commons-httpclient
 63 | Active   |  80 | 2.11.0.v20150805-0538  | EMF Common
 64 | Active   |  80 | 2.11.1.v20150805-0538  | EMF Ecore
 65 | Active   |  80 | 2.11.1.v20150805-0538  | EMF XML/XMI Persistence
 66 | Active   |  80 | 3.8.0.v20160509-1230   | Common Eclipse Runtime
 67 | Active   |  80 | 3.6.100.v20160223-2218 | Extension Registry Support
 94 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Config Core
 95 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Configuration Discovery
 96 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Config Dispatcher
 97 | Active   |  75 | 0.9.0.b5               | Eclipse SmartHome Config XML
 98 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core
 99 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core Audio
100 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome AutoUpdate Binding
101 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core Binding XML
102 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core ID
103 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core Persistence
104 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Scheduler Service
105 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core Thing
106 | Active   |  75 | 0.9.0.b5               | Eclipse SmartHome Core Thing XML
107 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Transformation Service
108 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core Voice
109 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Console
110 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Console for OSGi runtime Karaf
111 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome JavaSound I/O, Fragments: 169
112 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Monitor
113 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Net I/O Bundle
114 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome REST Interface Bundle
115 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Core REST API
116 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome REST mDNS Announcer
117 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Sitemap REST API
118 | Resolved |  80 | 0.9.0.b5               | Eclipse SmartHome SSE REST API
119 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Voice REST API
120 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Bonjour/MDS Service Discovery Bundle
121 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Web Audio Support
122 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Model Core
123 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Item Model
124 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Item Model Runtime
125 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Persistence Model
126 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Persistence Runtime
127 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Rule Model
128 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Rule Runtime
129 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Script
130 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Script Runtime
131 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Sitemap Model
132 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Sitemap Runtime
133 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Thing Model
134 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Thing Model Runtime
135 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Json Storage Service
136 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome UI
137 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome UI Icons
138 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Classic IconSet
139 | Active   |  80 | 2.9.2                  | Xtend Runtime Library
140 | Active   |  80 | 2.9.2                  | Xtend Macro Interfaces
141 | Active   |  80 | 2.9.2                  | Xtext
142 | Active   |  80 | 2.9.2                  | Xtext Common Types
143 | Active   |  80 | 2.9.2                  | JSR-45 Smap installer
144 | Active   |  80 | 2.9.2                  | Xtext Utility
145 | Active   |  80 | 2.9.2.v20160428-1452   | Xbase Model
146 | Active   |  80 | 2.9.2                  | Xbase Runtime Library
162 | Active   |  80 | 2.2.0                  | JUPnP Library
163 | Active   |  80 | 1.9.6                  | MIME streaming extension
164 | Active   |  80 | 5.0.2                  | Require-Bundle Fix :: org.objectweb.asm
166 | Active   |  90 | 2.1.0                  | openHAB Core
167 | Active   |  80 | 2.1.0                  | openHAB Karaf Integration
169 | Resolved |  80 | 2.1.0                  | openHAB Sound Support, Hosts: 111
170 | Active   |  80 | 2.1.0                  | openHAB Dashboard UI
175 | Active   |  80 | 3.2.0                  | Commons Net
176 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Basic UI, Fragments: 178
177 | Active   |  80 | 0.9.0.b5               | Eclipse SmartHome Paper UI, Fragments: 180
178 | Resolved |  75 | 2.1.0                  | openHAB Basic UI Fragment, Hosts: 176
179 | Active   |  80 | 2.1.0                  | HABPanel User Interface
180 | Resolved |  75 | 2.1.0                  | openHAB Paper UI Theme Fragment, Hosts: 177
181 | Active   |  80 | 1.10.0                 | openHAB Mail Action
182 | Active   |  80 | 2.1.0                  | openHAB 1.x Compatibility Layer
185 | Active   |  80 | 2.1.0                  | HABmin User Interface
186 | Active   |  80 | 2.1.0                  | MaryTTS Voice Service
187 | Active   |  80 | 2.1.0                  | VoiceRSS TTS Voice Service
21:04:11.914 [ERROR] [org.eclipse.smarthome.io.rest.sse   ] - FrameworkEvent ERROR - org.eclipse.smarthome.io.rest.sse
org.osgi.framework.BundleException: Exception in org.eclipse.smarthome.io.rest.sse.internal.SseActivator.start() of bundle org.eclipse.smarthome.io.rest.sse.
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:717)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:491)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:437)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:955)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1336)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
Caused by: java.lang.LinkageError: ClassCastException: attempting to castbundleresource://21.fwk737394/javax/ws/rs/ext/RuntimeDelegate.class to bundleresource://21.fwk737394/javax/ws/rs/ext/RuntimeDelegate.class
        at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:146)
        at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
        at org.glassfish.jersey.media.sse.SseFeature.<clinit>(SseFeature.java:62)
        at org.eclipse.smarthome.io.rest.sse.internal.SseActivator.start(SseActivator.java:44)
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_121]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        ... 14 more
triller-telekom commented 7 years ago

This sounds like it does not have anything to do with the enocean binding... Also i cannot reproduce it here either. Could you please try to stop your openHAB instance, clean the caches and restart it again?

Cleaning the cache works by clearing these directories

sudo rm --recursive /var/lib/openhab2/cache/*
sudo rm --recursive /var/lib/openhab2/tmp/*

Though, please double check if your openhabian installed openHAB into /var/lib/openhab2.

mjohenneken commented 7 years ago

OK i did what you suggested and the event endpoint is now working as expected again. It is a bit curious, i had the same issue on a second Rasberry Pi 2. If i ran into this issue again i will reopen this issue.