saalfeldlab / n5-universe

Functionality shared across all n5
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

Using an absolute path in windows causes N5Factory to try and load GoogleCloudUtils #25

Open odinsbane opened 1 month ago

odinsbane commented 1 month ago

Here is a test case.

public static void main(String[] args){
    String localPath = "test.zarr";
    String absolutePath = Paths.get(localPath).toAbsolutePath().toString();
    System.out.println(absolutePath);
    N5Writer n5 = new N5Factory().openWriter(absolutePath);
}

This will output:

C:\Users\username\IdeaProjects\DeformingMesh3D-plugin\test.zarr Exception in thread "main" java.lang.NoClassDefFoundError: org/janelia/saalfeldlab/googlecloud/GoogleCloudUtils at org.janelia.saalfeldlab.n5.universe.N5Factory$KeyValueAccessBackend.lambda$static$0(N5Factory.java:584) at org.janelia.saalfeldlab.n5.universe.N5Factory$KeyValueAccessBackend.test(N5Factory.java:618) at org.janelia.saalfeldlab.n5.universe.N5Factory$KeyValueAccessBackend.apply(N5Factory.java:611) at org.janelia.saalfeldlab.n5.universe.N5Factory.getKeyValueAccess(N5Factory.java:243) at org.janelia.saalfeldlab.n5.universe.N5Factory.openN5Container(N5Factory.java:547) at org.janelia.saalfeldlab.n5.universe.N5Factory.openWriter(N5Factory.java:477) at org.janelia.saalfeldlab.n5.universe.N5Factory.openN5Container(N5Factory.java:567) at org.janelia.saalfeldlab.n5.universe.N5Factory.openWriter(N5Factory.java:488) at deformablemesh.experimental.BrokenImgPlus.main(BrokenImgPlus.java:40) Caused by: java.lang.ClassNotFoundException: org.janelia.saalfeldlab.googlecloud.GoogleCloudUtils at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ... 9 more

If I use the local path the volume will be correctly created/used. Also if I use 'toUri()' I get the same exception.

odinsbane commented 1 month ago

I also tried using a relative path, ".\filename.zarr" and it tried to load the google cloud class.

cmhulbert commented 1 week ago

I'm hoping to try and test some of the windows related bugs we have seen. Could you tell me if this still happens with the most recent version of N5-Universe? Should be version 1.6.0

odinsbane commented 1 week ago

1.6.0 is the same version I was using. I tried it again and I get the same error.