Menu

#5 FileNotFoundException for path with '+'

v1.0 (example)
open
nobody
None
5
2019-09-06
2019-09-06
No

While building jnati on LINUX-AMD64, I run into the following problem. My absolute filesystem path contains '+', and that seems to cause FileNotFoundException:

java.io.FileNotFoundException: /home/andrius/debian-packages/jni-inchi-0.8 dfsg/target/classes/META-INF/jniinchi/1.03_1/LINUX-AMD64/MANIFEST.xml (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at net.sf.jnati.deploy.source.FileSource.openFile(FileSource.java:43)
at net.sf.jnati.deploy.source.ArtefactSource.loadManifest(ArtefactSource.java:42)
at net.sf.jnati.deploy.NativeArtefactLocator.findArtefactOnFilesystem(NativeArtefactLocator.java:181)
at net.sf.jnati.deploy.NativeArtefactLocator.getArtefact(NativeArtefactLocator.java:60)
at net.sf.jnati.deploy.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:47)
at net.sf.jnati.deploy.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:41)
at net.sf.jnati.deploy.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:37)
<trimmed brevity="" for=""></trimmed></init>

The location of the MANIFEST.xml is /home/andrius/debian-packages/jni-inchi-0.8+dfsg/target/classes/META-INF/jniinchi/1.03_1/LINUX-AMD64/MANIFEST.xml, but the exception message above contains ' ' instead of '+', so I assume there is a problem with path translation.

Discussion

  • Andrius Merkys

    Andrius Merkys - 2019-09-06

    Update: I run into the same issue (failing tests) when I try building jnati in a location where the absolute path contains '+' (say /home/andrius/src/build+jnati/jnati). However, if I replace '+' with '-', I get a successful build.

     
  • Andrius Merkys

    Andrius Merkys - 2019-09-06

    Update: this is possibly caused by URLDecoder.decode(...) used in ClasspathRepository.java, as URL decode perceives '+' in URLs as spaces.

     

Log in to post a comment.