TileDb not working in Docker Windows container

Hi,
I’m running a simple java application which performs a dense array creation first and a write next inside a windows docker container and I get these exceptions:

  • using tiledb-java version 0.4.5:
	[TileDB::StorageManager] Error: Cannot open array; Array does not exist
  • using tiledb-java version 0.5.0 and 0.5.1 :
	Caused by: java.lang.UnsatisfiedLinkError: 'long io.tiledb.libtiledb.tiledbJNI.new_tiledb_config_tpp()'
        at io.tiledb.libtiledb.tiledbJNI.new_tiledb_config_tpp(Native Method)
        at io.tiledb.libtiledb.tiledb.new_tiledb_config_tpp(tiledb.java:541)
        at io.tiledb.java.api.Config.<init>(Config.java:68)
        at io.tiledb.java.api.Context.<init>(Context.java:69)
        at tiledb.Test.createArray(Test.java:8)
        at tiledb.Test.main(Test.java:49)
        ... 8 more

Since I don’t get this error running the application outside docker container I suppose it’s strictly related to docker.

The java code fragment is the following

    public static void createArray() throws TileDBError {
        try (Context ctx = new Context();
             Attribute a1 = new Attribute(ctx, "a1", Long.class);
             ArraySchema schema = new ArraySchema(ctx, ArrayType.TILEDB_DENSE)) {
            Dimension<Long> d1 = new Dimension<>(ctx, "d1", Long.class, new Pair<>(1L, 4L), 1L);
            Dimension<Long> d2 = new Dimension<>(ctx, "d2", Long.class, new Pair<>(1L, 4L), 1L);

            // Create getDomain
            Domain domain = new Domain(ctx);
            domain.addDimension(d1);
            domain.addDimension(d2);

            // Create array schema
            schema.setTileOrder(Layout.TILEDB_ROW_MAJOR);
            schema.setCellOrder(Layout.TILEDB_ROW_MAJOR);
            schema.setDomain(domain);
            schema.addAttribute(a1);

            // Check array schema
            schema.check();

            Array.create("my_dense_array", schema);
        }
    }

    public static void writeArray() throws TileDBError {
        try (Context ctx = new Context();
             NativeArray a1Data = new NativeArray(ctx, new long[]{1, 2, 3, 4}, Long.class);
             Array myDenseArray = new Array(ctx, "my_dense_array", QueryType.TILEDB_WRITE);
             Query query = new Query(myDenseArray)) {

            query.setLayout(Layout.TILEDB_GLOBAL_ORDER);
            query.setSubarray(new NativeArray(ctx, new long[]{1, 1, 1, 4}, Long.class));
            query.setBuffer("a1", a1Data);

            query.submit();
        }
    }


    public static void main(String[] args) throws Exception {
        createArray();
        writeArray();
    }

The Dockerfile used to build the image is the following:

FROM winamd64/openjdk:11-jdk-nanoserver-1809

ADD target/testTileDb-1.0-SNAPSHOT.jar C:/App.jar

CMD [ "java","-jar","C:/App.jar" ]

Could you please investigate about it?

Thanks for your help.
Kind regards,

Giordano

Hi @ggalanti ,
I was able to reproduce your error locally. Please try running
./gradlew clean assemble and try again.

Let me know if it solves the problem.

Best,
Dimitris