Scanning on LinuxKit doesn't work when scan root is not root directory of a jarfile
See original GitHub issueThe line indicated is getting null from nestedJarHandler, when then is wrapped and throw as an IOException. This is preventing matching classes from being processed for a jar.
2018-01-23T18:52:34.862+0000 FastClasspathScanner -- Searching for "Class-Path:" entries within manifest files
2018-01-23T18:52:34.874+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/localedata.jar
2018-01-23T18:52:34.874+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/sunjce_provider.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/sunpkcs11.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/cldrdata.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/zipfs.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/sunec.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/jfxrt.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/nashorn.jar
2018-01-23T18:52:34.877+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/jaccess.jar
2018-01-23T18:52:34.878+0000 FastClasspathScanner ---- Ignoring JRE jar: /usr/java/jdk1.8.0_131/jre/lib/ext/dnsns.jar
2018-01-23T18:52:34.880+0000 FastClasspathScanner ---- Could not canonicalize path: /acceptance-1.22-SNAPSHOT.jar!/BOOT-INF/classes
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ java.io.IOException: Exception while getting jarfile jar:file:/acceptance-1.22-SNAPSHOT.jar!/BOOT-INF/classes
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.RelativePath.getFile(RelativePath.java:223)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.RelativePath.exists(RelativePath.java:290)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.RelativePath.isValidClasspathElement(RelativePath.java:313)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.Scanner$1.processWorkUnit(Scanner.java:235)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.Scanner$1.processWorkUnit(Scanner.java:224)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.utils.WorkQueue.runWorkLoop(WorkQueue.java:182)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.utils.WorkQueue$1.call(WorkQueue.java:147)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.utils.WorkQueue$1.call(WorkQueue.java:144)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at java.lang.Thread.run(Thread.java:748)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ Caused by: java.lang.NullPointerException
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ at io.github.lukehutch.fastclasspathscanner.scanner.RelativePath.getFile(RelativePath.java:208)
2018-01-23T18:52:34.880+0000 FastClasspathScanner ------ ... 11 more
This has been seen using 2.9.5 or later releases. 2.9.4 is a version that does not have this problem.
Issue Analytics
- State:
- Created 6 years ago
- Comments:59 (29 by maintainers)
Top Results From Across the Web
Scanning is slower in 2.12.0 · Issue #174 - GitHub
lukehutch mentioned this issue on May 3, 2018. Scanning on LinuxKit doesn't work when scan root is not root directory of a jarfile...
Read more >Scan all unmanaged JAR files - Snyk User Docs
The Snyk CLI can scan unmanaged JAR files in Java applications to identify which open source package they contain. · The CLI identifies...
Read more >Scan class or jar file in Java - Stack Overflow
From exmaple depot: How to load a Class that is not on the classpath: // Create a File object on the root of...
Read more >Running Java From the Command Line - JHU CS
To run the checkstyle jar as an executable (note we don't need to compile ... Scanner in your code, you are basically telling...
Read more >Java - Read a file from resources folder - Mkyong.com
Usually, the files in the resources folder will copy to the root of the classpath ... The getResource method is not working in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ncoe Sure, that will do it. Although digging into this issue uncovered two other issues so far, so we’re making progress 😃
It looks like 2.21 is still working.