Coder Social home page Coder Social logo

Comments (17)

ljkr avatar ljkr commented on July 30, 2024 1

@dimafeng the same problem with 0.13.0

org.testcontainers:testcontainers does not contain dependency on jsr-305 where CheckForNull comes from.

So adding jsr-305 (see below) to the project should fix the issue.

diff --git a/core/pom.xml b/core/pom.xml
index 00cc48d..f3eadf8 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -27,6 +27,12 @@
             <version>1.7.25</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <version>3.0.2</version>
+        </dependency>
+
         <dependency>
             <groupId>com.github.docker-java</groupId>
             <artifactId>docker-java</artifactId>
@@ -222,7 +228,7 @@
                             <include>org.apache.httpcomponents:*</include>
                             <include>org.glassfish.*:*</include>
                             <include>org.aopalliance.*:*</include>
-                            <include>javax.annotation:*</include>
+                            <include>com.google.code.findbugs:*</include>
                             <include>javax.inject:*</include>
                             <include>javax.ws.rs:*</include>
                             <include>com.fasterxml.*:*</include>

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

Hi @zaharidichev
I'll take a look tonight or tomorrow.

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

Thanks a lot. It really is causing me quite a lot of headache :(

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@zaharidichev could you please show the list of your dependencies and their versions?

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

@dimafeng Thanks for looking into that. Following is a list of the dependencies.

ch.qos.logback.logback.classic.1.1.1
ch.qos.logback.logback.core.1.1.1
com.beust.jcommander.1.12
com.dimafeng.testcontainers.scala.0.11.0
com.fasterxml.jackson.core.jackson.annotations.2.3.2
com.fasterxml.jackson.core.jackson.annotations.2.7.8
com.fasterxml.jackson.core.jackson.core.2.3.2
com.fasterxml.jackson.core.jackson.core.2.7.8
com.fasterxml.jackson.core.jackson.databind.2.3.2
com.fasterxml.jackson.core.jackson.databind.2.7.8
com.fasterxml.jackson.datatype.jackson.datatype.jdk8.2.7.8
com.fasterxml.jackson.datatype.jackson.datatype.jsr310.2.7.8
com.github.fakemongo.fongo.2.0.11
com.github.jnr.jffi.1.2.15
com.github.jnr.jffi.1.2.15.native
com.github.jnr.jnr.constants.0.9.8
com.github.jnr.jnr.ffi.2.1.4
com.github.jnr.jnr.posix.3.0.41
com.github.jnr.jnr.x86asm.1.0.2
com.github.nscala.time.nscala.time.1.0.0
com.google.guava.guava.18.0
com.googlecode.disruptor.disruptor.2.10.4
com.kohlschutter.junixsocket.junixsocket.common.2.0.4
com.kohlschutter.junixsocket.junixsocket.native.common.2.0.4
com.twitter.scrooge.core.3.17.0
com.typesafe.akka.akka.actor.2.3.4
com.typesafe.akka.akka.testkit.2.3.4
com.typesafe.config.1.2.1
com.typesafe.config.1.3.0
com.typesafe.play.play.datacommons.2.3.10
com.typesafe.play.play.datacommons.2.5.10
com.typesafe.play.play.functional.2.3.10
com.typesafe.play.play.functional.2.5.10
com.typesafe.play.play.iteratees.2.3.10
com.typesafe.play.play.iteratees.2.5.10
com.typesafe.play.play.json.2.3.10
com.typesafe.play.play.json.2.5.10
com.vividsolutions.jts.1.13
commons.cli.commons.cli.1.1
commons.codec.commons.codec.1.10
commons.io.commons.io.2.5
commons.lang.commons.lang.2.5
commons.lang.commons.lang.2.6
de.grundid.opendatalab.geojson.jackson.1.2
joda.time.joda.time.2.3
joda.time.joda.time.2.9.6
junit.junit.4.12
org.apache.commons.commons.compress.1.12
org.apache.commons.commons.lang3.3.3.2
org.apache.thrift.libthrift.0.8.0
org.aspectj.aspectjrt.1.8.6
org.beanshell.bsh.2.0b4
org.bouncycastle.bcprov.jdk15on.1.54
org.hamcrest.hamcrest.core.1.3
org.jetbrains.annotations.13.0
org.joda.joda.convert.1.6
org.joda.joda.convert.1.8.1
org.mockito.mockito.all.1.9.5
org.mongodb.casbah.commons.3.1.1
org.mongodb.casbah.core.3.1.1
org.mongodb.casbah.query.3.1.1
org.mongodb.mongo.java.driver.3.2.2
org.mozilla.rhino.1.7.7.1
org.ow2.asm.asm.5.0.3
org.ow2.asm.asm.analysis.5.0.3
org.ow2.asm.asm.commons.5.0.3
org.ow2.asm.asm.tree.5.0.3
org.ow2.asm.asm.util.5.0.3
org.rnorth.duct.tape.duct.tape.1.0.6
org.rnorth.tcp.unix.socket.proxy.1.0.1
org.rnorth.visible.assertions.visible.assertions.2.0.0
org.scala.lang.modules.scala.parser.combinators.1.0.4
org.scala.lang.modules.scala.xml.1.0.5
org.scala.lang.scala.library.8
org.scala.lang.scala.reflect.1
org.scala.lang.scala.reflect.7
org.scala.lang.scala.reflect.8
org.scala.sbt.test.interface.1.0
org.scala.stm.scala.stm.0.7
org.scalacheck.scalacheck.1.11.3
org.scalactic.scalactic.3.0.1
org.scalatest.scalatest.3.0.1
org.scijava.native.lib.loader.2.0.2
org.scoverage.scalac.scoverage.plugin.1.1.0
org.scoverage.scalac.scoverage.runtime.1.1.0
org.slf4j.jcl.over.slf4j.1.7.21
org.slf4j.slf4j.api.1.7.13
org.slf4j.slf4j.api.1.7.25
org.slf4j.slf4j.ext.1.7.25
org.testcontainers.testcontainers.1.4.3
org.testng.testng.6.1.1
org.yaml.snakeyaml.1.6
org.zeroturnaround.zt.exec.1.8

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@zaharidichev
I checked codebase of org.testcontainers.testcontainers.1.4.3 and didn't find any usages of the org.testcontainers.shaded.javax.annotation.CheckForNull as well as there are no usages in testcontainers-scala.
Could you please try to switch to a DEBUG level of compilation logging? The answer may be there, we need to find out where that class is accessed from.

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

I did try setting:

scalacOptions ++= Seq("-unchecked", "-feature", "-explaintypes", "-print-types")

However that did not display any additional information. Quite strange. Just the same old error. Something is getting severely mixed up on the compiler level. This type does not even exist. I do not understand what and why is trying to access it.

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

I'll try to create an SBT project to reproduce the issue.

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

@dimafeng
Interestingly enough, we are using your library in another project and it does not show such problems. I am not sure what is so special with this one and this set of dependencies that causes so much headache. Same version of scala, same version of sbt

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

Right...
So @dimafeng running the compiler in verbose mode yields the following:

[info] [loaded package loader jackson in 0ms]
[info] [loaded package loader annotation in 0ms]
[info] [loaded package loader javax in 0ms]
[error] Class org.testcontainers.shaded.javax.annotation.CheckForNull not found - continuing with a stub.
[error] Class org.testcontainers.shaded.javax.annotation.CheckForNull not found - continuing with a stub.
[error] Class org.testcontainers.shaded.javax.annotation.CheckForNull not found - continuing with a stub.
[info] [loaded class file /Users/zahari/.ivy2/cache/org.testcontainers/testcontainers/jars/testcontainers-1.4.3.jar(com/github/dockerjava/api/command/InspectContainerResponse.class) in 2ms]
[info] [loaded package loader traits in 0ms]

This is happening right before the loader picks up InspectContainerResponse. Looking a bit further into that class, it looks like (an excerpt):

import org.testcontainers.shaded.com.fasterxml.jackson.annotation.JsonIgnore;
import org.testcontainers.shaded.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.testcontainers.shaded.com.fasterxml.jackson.annotation.JsonProperty;
import org.testcontainers.shaded.javax.annotation.CheckForNull; <----- this guy here !

@JsonIgnoreProperties(
    ignoreUnknown = true
)
public class InspectContainerResponse {
    @JsonProperty("Args")
    private String[] args;
    @JsonProperty("Config")

There is no such class org.testcontainers.shaded.javax.annotation.CheckForNull in the test containers jar on my classpath. For reference, I am currently running that with:

  • testcontainers-scala_2.110.12.0.jar
  • testcontainers-1.4.3.jar

Seems like they missed something while shading the javax or I am getting confused somehow

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@zaharidichev sorry for the late response. This is interesting.

@rnorth @bsideup do you guys know where org.testcontainers.shaded.javax.annotation.CheckForNull should come from?

from testcontainers-scala.

bsideup avatar bsideup commented on July 30, 2024

@dimafeng I think I know where it comes from... Not related to testcontainers-scala, we need to fix that in testcontainers-core.

@zaharidichev thanks for reporting!

from testcontainers-scala.

zaharidichev avatar zaharidichev commented on July 30, 2024

@bsideup Is there any estimation of when would that get fixed so I can pull in a snapshot at least. Alternatively I can give yo a hand and prepare a PR for it.

from testcontainers-scala.

ljkr avatar ljkr commented on July 30, 2024

I have the same problem.
@zaharidichev, did you fixed or worked-around the issue on your side?

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@ljkr sorry to hear that. It seems that issue was fixed in the latest version of testcontainers-java. I'll release a new version of testcontainers-scala with that fix later today.

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@ljkr @zaharidichev please try version 0.13.0

from testcontainers-scala.

dimafeng avatar dimafeng commented on July 30, 2024

@ljkr @zaharidichev should be fixed in testcontainers-scala 0.14.0, please try - testcontainers/testcontainers-java#563 was released in testcontainers-java 1.6.0

from testcontainers-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.