Big file issue
See original GitHub issueHi,
I ran into an interesting issue. If the jar files are very large the order of the files (ZipEntries) matter. If the classes come first then they can be found in a scan. If the classes come last they will not be found.
Here’s a script and a unit test that shows the issue:
src/test/resources/makeBigJar.sh
#!/usr/bin/env bash
mkdir -p tmp/;
cd tmp;
jar -xf ../record.jar
#ASSET_DIR="zz" # Works
ASSET_DIR="aa" # Doesn't Works
mkdir -p ${ASSET_DIR}
cd ${ASSET_DIR}
for number in {1..23}; do
echo "Making file ${number}"
## make a bunch of big files that won't compress
dd if=/dev/urandom of="output${number}.bin" bs=1024 count=102400 2> /dev/null
done
cd ..
echo "Building big jar"
jar -cf ../bigjar.jar *
//Copy of the RecordTest
Test src/test/java/io/github/classgraph/issues/BigFileTest.java
public class BigFileTest {
/** The jar URL. */
private static final URL jarURL = RecordTest.class.getClassLoader().getResource("bigjar.jar");
/**
* Test records (JDK 14+).
*
* @throws Exception
* the exception
*/
@Test
public void recordJar() throws Exception {
try (ScanResult scanResult = new ClassGraph().overrideClassLoaders(new URLClassLoader(new URL[] { jarURL }))
.enableAllInfo().scan()) {
final ClassInfoList classInfoList = scanResult.getAllRecords();
assertThat(classInfoList).isNotEmpty();
final ClassInfo classInfo = classInfoList.get(0);
final FieldInfo fieldInfo = classInfo.getFieldInfo("x");
assertThat(fieldInfo).isNotNull();
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
8 Common Problems For Large File Transfer | Raysync
8 Common Problems For Large File Transfer · Time limit · Solution: · Lack of visibility · Solution: · Restricted file type ·...
Read more >Common problems with large file uploads - Filestack Blog
Common problems with large file uploads · Browser limitations: · Server configuration issues: · Memory issues: · Timeout issues:.
Read more >They all shall pass: a guide to handling large file uploads
1. Low upload speed and latency ... The larger a file, the more bandwidth and time it takes to upload. This rule seems...
Read more >Top 5 Fixes for File Is Too Large for the Destination File ...
Top 5 Fixes for File Is Too Large for the Destination File System Error on Windows 10 · 1. Format Storage to NTFS...
Read more >Fix 'File Is Too Large for Destination File System ... - EaseUS
To fix the "File is too large for the destination file system" error, you have to format the destination drive to NTFS for...
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
Thanks for the quick turn around on this issue! I can confirm the fix is working on my end as well.
I try to make bugfixing a top priority always! Thanks for confirming the fix!