testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.03k stars 1.65k forks source link

Container won't start #3236

Open lionchi opened 4 years ago

lionchi commented 4 years ago

java.util.ServiceConfigurationError: org.testcontainers.dockerclient.DockerClientProviderStrategy: Provider org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy could not be instantiated at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:584) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:806) at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:724) at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1396) at java.base/java.lang.Iterable.forEach(Iterable.java:74) at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:124) at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:147) at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14) at org.testcontainers.LazyDockerClient.listImagesCmd(LazyDockerClient.java:12) at org.testcontainers.images.LocalImagesCache.maybeInitCache(LocalImagesCache.java:68) at org.testcontainers.images.LocalImagesCache.get(LocalImagesCache.java:32) at org.testcontainers.images.AbstractImagePullPolicy.shouldPull(AbstractImagePullPolicy.java:18) at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:59) at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:26) at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:20) at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:27) at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1277) at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:613) at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:320) at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:311) at ru.jpixel.personaldiaryuserservice.repositories.AbstractContainerBaseTest.(AbstractContainerBaseTest.java:14) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:250) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:260) at org.junit.runners.BlockJUnit4ClassRunner$2.runReflectiveCall(BlockJUnit4ClassRunner.java:309) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) Caused by: java.lang.NullPointerException at com.github.dockerjava.core.DefaultDockerClientConfig.checkDockerHostScheme(DefaultDockerClientConfig.java:101) at com.github.dockerjava.core.DefaultDockerClientConfig.(DefaultDockerClientConfig.java:90) at com.github.dockerjava.core.DefaultDockerClientConfig$Builder.build(DefaultDockerClientConfig.java:432) at org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy.(EnvironmentAndSystemPropertyClientProviderStrategy.java:21) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:782) ... 45 more

I can not understand what I'm doing wrong

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.