-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Describe the issue
There is no org.graalvm.nativeimage:svm:22.1.0 artifact in maven central. Building with 22.0.0.2 dependency on graal 22.1.0 leads to error:
[error] Error: ImageSingletons.add must not overwrite existing key com.oracle.svm.core.jdk.ProtectionDomainSupport
[error] Existing value: com.oracle.svm.core.jdk.ProtectionDomainSupport@5217f3d0
[error] New value: com.oracle.svm.core.jdk.ProtectionDomainSupport@37ebc9d8
[error] Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
I'm using svm to implement autofeature:
import com.oracle.svm.core.annotate.*;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.hosted.RuntimeClassInitialization;
import org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport;
import java.security.Security;
@AutomaticFeature
public class BouncyCastleFeature implements Feature {
@Override
public void afterRegistration(AfterRegistrationAccess access) {
RuntimeClassInitialization.initializeAtBuildTime("org.bouncycastle");
RuntimeClassInitializationSupport rci = ImageSingletons.lookup(RuntimeClassInitializationSupport.class);
rci.rerunInitialization("org.bouncycastle.jcajce.provider.drbg.DRBG$Default", "");
rci.rerunInitialization("org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV", "");
Security.addProvider(new BouncyCastleProvider());
}
}
Describe GraalVM and your environment:
- GraalVM version (latest snapshot builds can be found here), or commit id if built from source: 22.1.0