Skip to content

Commit 303adbe

Browse files
committed
Proper resource load via classloading delegation.
1 parent 6b7fa6e commit 303adbe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/water/Boot.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ private byte[] getMD5(InputStream is) throws IOException {
7575
}
7676

7777
private Boot() throws IOException {
78+
79+
super(Thread.currentThread().getContextClassLoader());
7880
final String ownJar = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
7981
Log.POST(2000, "ownJar is " + ownJar);
8082
ZipFile jar = null;
@@ -372,7 +374,10 @@ private void extractInternalFiles() throws IOException {
372374

373375
public InputStream getResource2(String uri) {
374376
if( fromJar() ) {
375-
return _systemLoader.getResourceAsStream("resources"+uri);
377+
InputStream is = _systemLoader.getResourceAsStream("resources"+uri);
378+
if (is==null) is = this.getClass().getClassLoader().getResourceAsStream("resources"+uri);
379+
if (is==null) is = Thread.currentThread().getContextClassLoader().getResourceAsStream("resources"+uri);
380+
return is;
376381
} else {
377382
try {
378383
File resources = new File("lib/resources");

0 commit comments

Comments
 (0)