Skip to content

Commit f1e064b

Browse files
committed
Add substitution that ensures Classloader#library is never used in native
Fixes: #8785
1 parent 65e1252 commit f1e064b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,13 @@ public String resolveAdditionalQueryParametersFromTxtRecords(final String host)
173173
throw new UnsupportedOperationException("mongo+srv:// not supported in native mode");
174174
}
175175
}
176+
177+
@TargetClass(com.sun.jna.Native.class)
178+
final class JnaNativeSubstitutions {
179+
180+
// This method can trick GraalVM into thinking that Classloader#findLibrary is getting called
181+
@Substitute
182+
public static String getWebStartLibraryPath(final String libName) {
183+
return null;
184+
}
185+
}

0 commit comments

Comments
 (0)