Skip to content

Commit

Permalink
Prevent IAE when accessing GraalVM classes
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Oct 18, 2023
1 parent 96df8a5 commit e788e14
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package io.quarkus.omnifaces.runtime;

import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport;
import org.graalvm.nativeimage.hosted.RuntimeClassInitialization;

public class OmniFacesFeature implements Feature {

private final static String REASON = "OmniFaces runtime initialization";

@Override
public void afterRegistration(AfterRegistrationAccess access) {
final RuntimeClassInitializationSupport runtimeInit = ImageSingletons.lookup(RuntimeClassInitializationSupport.class);
runtimeInit.initializeAtRunTime("org.omnifaces.config.WebXmlSingleton", REASON);
RuntimeClassInitialization.initializeAtRunTime("org.omnifaces.config.WebXmlSingleton", REASON);
}

@Override
Expand Down

0 comments on commit e788e14

Please sign in to comment.