Skip to content

Upgraded jackson-jaxrs-json-provider dependency - #407

Merged
KostyaSha merged 1 commit into
docker-java:masterfrom
igracia:master
Dec 18, 2015
Merged

KostyaSha merged 1 commit into
docker-java:masterfrom
igracia:master

Conversation

@igracia

@igracia igracia commented Dec 18, 2015

Copy link
Copy Markdown
Contributor

There is a version problem when using spring-boot-starter-web 1.3.0, as it needs a later version than the one that the transitive dependency brings.

@KostyaSha

Copy link
Copy Markdown
Member

Please provide logs of what exactly problem do you see.

@igracia

igracia commented Dec 18, 2015

Copy link
Copy Markdown
Contributor Author

Here is the stack trace

javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.ObjectWriter.getJsonFactory()Lcom/fasterxml/jackson/core/JsonFactory;
    at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255)
    at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:683)
    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:228)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424)
    at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:679)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:435)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:338)
    at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:32)
    at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:14)
    at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
    at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
    at com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:142)
    at org.kurento.test.services.KmsService.startDockerizedKms(KmsService.java:443)
    at org.kurento.test.services.KmsService.startKms(KmsService.java:340)
    at org.kurento.test.services.KmsService.start(KmsService.java:233)
    at org.kurento.test.lifecycle.KurentoTestListener.invokeServices(KurentoTestListener.java:79)
    at org.kurento.test.lifecycle.KurentoTestListener.testStarted(KurentoTestListener.java:109)
    at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
    at org.kurento.test.lifecycle.KurentoRunNotifier$3.notifyListener(KurentoRunNotifier.java:91)
    at org.kurento.test.lifecycle.KurentoRunNotifier$SafeNotifier.run(KurentoRunNotifier.java:52)
    at org.kurento.test.lifecycle.KurentoRunNotifier.fireTestStarted(KurentoRunNotifier.java:93)
    at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runLeaf2(KurentoBlockJUnit4ClassRunnerWithParameters.java:39)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runChild(KurentoBlockJUnit4ClassRunnerWithParameters.java:28)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runChild(KurentoBlockJUnit4ClassRunnerWithParameters.java:14)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.kurento.test.lifecycle.KurentoTestRunner.run(KurentoTestRunner.java:79)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:108)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:78)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:54)
    at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:144)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.getJsonFactory()Lcom/fasterxml/jackson/core/JsonFactory;
    at com.fasterxml.jackson.jaxrs.json.annotation.EndpointConfig.initWriter(EndpointConfig.java:159)
    at com.fasterxml.jackson.jaxrs.json.annotation.EndpointConfig.forWriting(EndpointConfig.java:63)
    at com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:531)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at com.github.dockerjava.jaxrs.filter.LoggingFilter.aroundWriteTo(LoggingFilter.java:301)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1154)
    at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:503)
    at com.github.dockerjava.jaxrs.connector.ApacheConnector$2.writeTo(ApacheConnector.java:576)
    at org.apache.http.impl.execchain.RequestEntityProxy.writeTo(RequestEntityProxy.java:123)
    at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:158)
    at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:162)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
    at com.github.dockerjava.jaxrs.connector.ApacheConnector.apply(ApacheConnector.java:441)
    at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246)
    at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:683)
    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:228)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424)
    at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:679)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:435)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:338)
    at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:32)
    at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:14)
    at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
    at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
    at com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:142)
    at org.kurento.test.services.KmsService.startDockerizedKms(KmsService.java:443)
    at org.kurento.test.services.KmsService.startKms(KmsService.java:340)
    at org.kurento.test.services.KmsService.start(KmsService.java:233)
    at org.kurento.test.lifecycle.KurentoTestListener.invokeServices(KurentoTestListener.java:79)
    at org.kurento.test.lifecycle.KurentoTestListener.testStarted(KurentoTestListener.java:109)
    at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
    at org.kurento.test.lifecycle.KurentoRunNotifier$3.notifyListener(KurentoRunNotifier.java:91)
    at org.kurento.test.lifecycle.KurentoRunNotifier$SafeNotifier.run(KurentoRunNotifier.java:52)
    at org.kurento.test.lifecycle.KurentoRunNotifier.fireTestStarted(KurentoRunNotifier.java:93)
    at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runLeaf2(KurentoBlockJUnit4ClassRunnerWithParameters.java:39)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runChild(KurentoBlockJUnit4ClassRunnerWithParameters.java:28)
    at org.kurento.test.lifecycle.KurentoBlockJUnit4ClassRunnerWithParameters.runChild(KurentoBlockJUnit4ClassRunnerWithParameters.java:14)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.kurento.test.lifecycle.KurentoTestRunner.run(KurentoTestRunner.java:79)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:108)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:78)
    at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:54)
    at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:144)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

docker-java depends on version 2.1.2, while spring-boot uses jackson 2.6.3. Since spring-boot-dependencies management pom does not include the dependency jackson-jaxrs-json-provider to fix a version, when we use docker-java with a spring-boot app, there is a transitive dependency issue. We can fix that in our pom files, of course, but thought that it would be better to solve that upgrading your dependency version, unless you have any concerns.

@KostyaSha

Copy link
Copy Markdown
Member

I think docker-java can update dependency, but you can't satisfy everybody. Such update may break deps for somebody else, usually it should be done with using shaded artifacts #340 but it requires reorganise project to multi-module project.

@igracia

igracia commented Dec 18, 2015

Copy link
Copy Markdown
Contributor Author

We have multi-module project. We shaded the artifact since it's the most common way to resolve that. Just thought that updating that would be a good idea, as that dependency does not remove the methods, just marks them as deprecated so it keeps backwards compatibility.

Maybe I didn't perform the most extensive tests ever, but seems like upgrading the dependency is more compatible than keeping it that way.

@KostyaSha

Copy link
Copy Markdown
Member

Again, jenkins for example uses guava 11, but it doesn't mean that libraries should downgrade guava from 18 to 11.

@igracia

igracia commented Dec 18, 2015

Copy link
Copy Markdown
Contributor Author

Of course not. As I said, we've shaded the artifact, which as you also pointed out is the most common way to do that. For me that's perfectly fine, but still seems like the most compatible and comfortable way, in case of this particular dependency, is upgrading the version. We found this issue when including docker-java and spring-boot-starter-web in the same pom.xml file, not when deploying.

I can close the pull request if you want me too. I really do understand your point and your concerns.

@KostyaSha

Copy link
Copy Markdown
Member

@igracia i will keep up to @marcuslinke as i also like periodically update deps. Probably for 3.0 we can bump all deps and i will check in reference implementation.

@KostyaSha

Copy link
Copy Markdown
Member

Well, let's try.

KostyaSha added a commit that referenced this pull request Dec 18, 2015
Upgraded jackson-jaxrs-json-provider dependency
@KostyaSha
KostyaSha merged commit 93132a8 into docker-java:master Dec 18, 2015
@KostyaSha

Copy link
Copy Markdown
Member

Mmm.. PR validator is again unavailable. Seems i need back my own.

@igracia

igracia commented Dec 18, 2015

Copy link
Copy Markdown
Contributor Author

Cool, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants