使用docker-client

时间:2018-11-13 09:25:04

标签: java spotify-docker-client

我正在尝试使用Spotify docker-client的阴影版本为我的应用程序创建一个阴影(fat)jar。但是我收到以下错误:

[2018-11-13 14:46:06,146] WARN  {com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.ext.Java7Support} - Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added  
[2018-11-13 14:46:06,653] ERROR {org.ballerinalang.launcher.Main} - java.lang.ClassNotFoundException: com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyClientBuilder 
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyClientBuilder
    at com.spotify.docker.client.shaded.javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:103)
    at com.spotify.docker.client.DefaultDockerClient.<init>(DefaultDockerClient.java:469)
    at com.spotify.docker.client.DefaultDockerClient$Builder.build(DefaultDockerClient.java:3174)
    at org.ballerinax.docker.DockerArtifactHandler.buildImage(DockerArtifactHandler.java:79)
    at org.ballerinax.docker.DockerAnnotationProcessor.createDockerArtifacts(DockerAnnotationProcessor.java:229)
    at org.ballerinax.docker.DockerAnnotationProcessor.processDockerModel(DockerAnnotationProcessor.java:88)
    at org.ballerinax.docker.DockerPlugin.codeGenerated(DockerPlugin.java:158)
    at org.wso2.ballerinalang.compiler.BinaryFileWriter.lambda$writeExecutableBinary$0(BinaryFileWriter.java:121)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.wso2.ballerinalang.compiler.BinaryFileWriter.writeExecutableBinary(BinaryFileWriter.java:120)
    at org.wso2.ballerinalang.compiler.BinaryFileWriter.writeExecutableBinary(BinaryFileWriter.java:102)
    at org.wso2.ballerinalang.compiler.BinaryFileWriter.write(BinaryFileWriter.java:86)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at org.wso2.ballerinalang.compiler.Compiler.write(Compiler.java:111)
    at org.ballerinalang.packerina.BuilderUtils.compileWithTestsAndWrite(BuilderUtils.java:106)
    at org.ballerinalang.packerina.cmd.BuildCommand.execute(BuildCommand.java:95)
    at java.util.Optional.ifPresent(Optional.java:159)
    at org.ballerinalang.launcher.Main.main(Main.java:65)
Caused by: java.lang.ClassNotFoundException: com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyClientBuilder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.spotify.docker.client.shaded.javax.ws.rs.client.FactoryFinder.newInstance(FactoryFinder.java:115)
    at com.spotify.docker.client.shaded.javax.ws.rs.client.FactoryFinder.find(FactoryFinder.java:225)
    at com.spotify.docker.client.shaded.javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:86)
    ... 17 more

我添加了以下内容,以包括maven-shade-plugin部分,

<includes>
    <include>commons-io:commons-io</include>
    <include>commons-codec:commons-codec</include>
    <incldue>com.spotify:*</incldue>
</includes>

但是我仍然收到“ java.lang.ClassNotFoundException:com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyClientBuilder”的错误。如何处理呢?

0 个答案:

没有答案