Skip to content

Commit 4508d2f

Browse files
mbelladebeikov
authored andcommitted
HHH-17705 Load default bytecode provider using the correct ClassLoader
1 parent c7114ce commit 4508d2f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/bytecode/internal/BytecodeProviderInitiator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ public Class<BytecodeProvider> getServiceInitiated() {
6161

6262
@Internal
6363
public static BytecodeProvider buildDefaultBytecodeProvider() {
64-
return getBytecodeProvider( ServiceLoader.load( BytecodeProvider.class ) );
64+
// Use BytecodeProvider's ClassLoader to ensure we can find the service
65+
return getBytecodeProvider( ServiceLoader.load(
66+
BytecodeProvider.class,
67+
BytecodeProvider.class.getClassLoader()
68+
) );
6569
}
6670

6771
@Internal

0 commit comments

Comments
 (0)