[SOLVED] Snapshots #1715, 1716, 1717, 1718, 1719, 1720, 1721- restdocs (Rest API) errors

Hello folks!

I have problems with restdocs!

I’ve tried latest snapshot #1715 on several “Windows 10, 64 bit” machines. I’ve installed all from scratch.

I’ve tested several times on the same machine. One installation was successful and two installations failed. On a second Win 10 (64 bit) PC the same problem (one successfull, one failed).

If failed, all have the same errors:

Here are the errors, when I open “REST API Documentation”:

500 : <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 500 Request failed.</title>
</head> <body><h2>HTTP ERROR 500</h2> <p>Problem accessing /rest/swagger.json. Reason: <pre> Request failed.</pre></p><hr>
<a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.18.v20190429</a><hr/> </body> </html> 
http://localhost:8080/rest/swagger.json

.
.

13:40:18.161 [WARN ] [org.eclipse.jetty.server.HttpChannel ] - /rest/swagger.json
javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class io.swagger.converter.ModelConverters
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:88) ~[?:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
        at org.eclipse.jetty.server.Server.handle(Server.java:505) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) [89:org.eclipse.jetty.server:9.4.18.v20190429]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) [89:org.eclipse.jetty.server:9.4.18.v20190429]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [80:org.eclipse.jetty.io:9.4.18.v20190429]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [80:org.eclipse.jetty.io:9.4.18.v20190429]
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [80:org.eclipse.jetty.io:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804) [92:org.eclipse.jetty.util:9.4.18.v20190429]
        at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class io.swagger.converter.ModelConverters
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) ~[?:?]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) ~[?:?]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[?:?]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?]
        ... 15 more
Caused by: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class io.swagger.converter.ModelConverters
        at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:278) ~[?:?]
        at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:260) ~[?:?]
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:509) ~[?:?]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334) ~[?:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) ~[?:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) ~[?:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) ~[?:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) ~[?:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) ~[?:?]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ~[?:?]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) ~[?:?]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[?:?]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?]
        ... 15 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.swagger.converter.ModelConverters
        at io.swagger.jaxrs.Reader.parseMethod(Reader.java:798) ~[?:?]
        at io.swagger.jaxrs.Reader.read(Reader.java:299) ~[?:?]
        at io.swagger.jaxrs.Reader.read(Reader.java:145) ~[?:?]
        at io.swagger.jaxrs.listing.BaseApiListingResource.scan(BaseApiListingResource.java:56) ~[?:?]
        at io.swagger.jaxrs.listing.BaseApiListingResource.process(BaseApiListingResource.java:101) ~[?:?]
        at io.swagger.jaxrs.listing.BaseApiListingResource.getListingJsonResponse(BaseApiListingResource.java:147) ~[?:?]
        at io.swagger.jaxrs.listing.ApiListingResource.getListing(ApiListingResource.java:32) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[?:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) ~[?:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[?:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) ~[?:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[?:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[?:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[?:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[?:?]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) ~[?:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) ~[?:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[?:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) ~[?:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) ~[?:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) ~[?:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) ~[?:?]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ~[?:?]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) ~[?:?]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) ~[?:?]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[?:?]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[?:?]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) ~[?:?]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[?:?]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) ~[?:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[?:?]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?]
        ... 15 more

Are you by any chance using the Chromecast binding?

No. I don’t use chromecast in above examples.

Thanks for yours hints!

There is a known conflict in 2.5M2 and later with several bindings. There is an active issue on GitHub. Since you are using an unstable build for testing, I am sure you already found that though. :wink:
Unstable snapshots are expected to have issues.

Do we know which bindings?

Snapshot users know to look here. The rest of us use search :wink:

@marcel_erkel
@vzorglub
@Bruce_Osborne

In my case I found out now:

When I install Openhab as Windows Service, then the restdocs error appears immediately!

When I’ve used only start.bat before, then the following bindings were running:

package = standard
binding = astro,hue
ui = paper,basic,habpanel,restdocs,homebuilder,habmin
persistence = rrd4j
transformation = map,javascript,jsonpath

And there is no chance to revert it. I’ve uninstalled wrapper and oh2 service. Same error!

EDIT: It was not caused by installation of OpenHab Service, it was installation of jsonpath that causes the errors. But the error appears only after installing another addon.

File an issue on GitHub

I’m going to do so, but after I did some further investigations!

Unfortunately, my further tests have not brought any new findings. It probably depends on the right order, which binding, UI, transformation or misc one chooses. Sometimes the restdocs work and sometimes not.

I’m going to do further investigations until I’ll find the reason or the correct order.

Hello folks,

here are my results:

Here are the bindings,UIs,transformations,miscs that do NOT BREAK restdocs:

binding = allplay,amazondashbutton,astro,avmfritz,feed,harmonyhub,http1,hue,knx,max,ntp,openweathermap,pioneeravr,sonos,tplinksmarthome,weather1,zigbee,zwave
ui = basic,classic,habmin,habpanel,homebuilder,paper,restdocs
persistence = rrd4j
transformation = javascript,map,regex
voice = googletts,marytts
misc = ruleengine,market,openhabcloud

.
.

BREAKING the restdocs:

binding= boschindego,chromecast,groheondus
transformation= jinja,jsonpath
voice = pollytts

.
restdocs is installing also:

211 │ Active │  80 │ 2.4.5                 │ Jackson-annotations
212 │ Active │  80 │ 2.4.5                 │ Jackson-core
213 │ Active │  80 │ 2.4.5                 │ jackson-databind
214 │ Active │  80 │ 2.4.5                 │ Jackson-dataformat-YAML

.
chromecast INSTALLATION:

first uninstalls:

211 │ Active │  80 │ 2.4.5                 │ Jackson-annotations
213 │ Active │  80 │ 2.4.5                 │ jackson-databind

also installs:

225 │ Active │  80 │ 2.9.9                 │ Jackson-annotations
226 │ Active │  80 │ 2.9.9                 │ Jackson-core
227 │ Active │  80 │ 2.9.9                 │ jackson-databind

.
boschindego INSTALLATION:

also installs:

304 | Active |  80 | 2.9.9                 | Jackson-annotations
305 | Active |  80 | 2.9.6                 | Jackson-core
306 | Active |  80 | 2.9.9                 | jackson-databind

.
groheondus INSTALLATION:

also installs:

309 | Active |  80 | 2.9.9                 | Jackson-annotations
310 | Active |  80 | 2.9.6                 | Jackson-core
311 | Active |  80 | 2.9.9                 | jackson-databind

.
jinja INSTALLATION:

also installs:

318 | Active |  80 | 2.9.9                 | Jackson-annotations
319 | Active |  80 | 2.9.6                 | Jackson-core
320 | Active |  80 | 2.9.9                 | jackson-databind

.
pollytts INSTALLATION:

also installs:

336 | Active |  80 | 2.9.9                 | Jackson-annotations
337 | Active |  80 | 2.9.9                 | Jackson-core
338 | Active |  80 | 2.9.9                 | jackson-databind
339 | Active |  80 | 2.9.9                 | Jackson dataformat: CBOR

.
.

jsonpath INSTALLATION:

also installs:

263 | Active |  80 | 2.9.9                 | Jackson-annotations

.
Installation of jsonpath does not break restdocs immediately, but after installing any other addon.

EDIT: I have not tested any other bindings than the ones above. Maybe there are even more that break the restdocs.

EDIT2: chromecast breaks restdocs immediately, the others (boschindego,groheondus, jinja,jsonpath,pollytts) breaks restdocs after installing any other addon.

I guess all addons with this feature dependency are all breaking restdocs: openhab.tp-jackson

See here!!!
Link to github!

And chromecast breaks it immediately while using this bom.xml

<dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.9.9</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.9.9</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.9</version>
      <scope>compile</scope>
    </dependency>
5 Likes

Fantastic work!!
Jsonpath breaks it!! That’s a bummer. I was wiling to disable a binding or two if I didn’t loose too much functionality but I can’t disable Jsonpath. Too much relies on it.

I eould suggest adding your finding to the gitHub thread

1 Like

Done, see here.

2 Likes

As a workaround you first install all other addons and as the very last one: jsonpath

Keep in mind, that installations of any further addon will break restdocs then.

You could do as follows: uninstall jsonpath, install your desired new addon(s), install jsonpath again.

Sadly I tried uninstalling the jsonpath add-on and the rest docs still do not work. I don’t use Chromecast or Pollytts.

However, a restart of oh cleared that up. Then I reinstalled jsonpath and rest continues to be well. Thanks for figuring this out!

1 Like

@rlkoshak
Rich
I am not clear what sequence you followed from your post. I can live without Chromecast for a while. Thanks

Alex… excellent job!!!
I saw you updated the git hub thread with your new info. Hopefully now the developer can find the root cause of the issue. The entire community is appreciative of your hard work :+1:

1 Like

@J-N-K @cweitkamp

Do you know all about this? See above, in this post.

Hi @Celaeno1,

Thank you for all the details. I was not aware of all of them. I am wondering about two facts:

  1. Why do some bindings still install Jackson-core dependency version 2.9.6. Even if they are using openhab-tp.jackson feature which provides version 2.9.9 for all Jackson bundles.

  2. Why does e.g. Jsonpath only install Jackson-annotations? It depends on openhab-tp.jackson too.

// EDIT: Answer for 1.: Maybe the same cause @rlkoshak is talking about.

I can answer 2.: the bundles of the feature are defined as dependency="true", so they are only installed if needed. If you want to make sure that they are installed, you need to remove that.

See https://github.com/openhab/openhab-core/pull/1128

1 Like