diff --git a/gateway/enforcer/Dockerfile b/gateway/enforcer/Dockerfile index 469575d4b..ecf65f38e 100644 --- a/gateway/enforcer/Dockerfile +++ b/gateway/enforcer/Dockerfile @@ -35,7 +35,7 @@ COPY resources/lib/enforcer-${VERSION}.jar . - RUN native-image -jar enforcer-${VERSION}.jar -H:TraceClassInitialization=false -H:Name=enforcer --no-fallback + RUN native-image -jar enforcer-${VERSION}.jar -H:Name=enforcer --no-fallback FROM ubuntu:22.04 diff --git a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle b/gateway/enforcer/org.wso2.apk.enforcer/build.gradle index 08709a2d9..152a74138 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle +++ b/gateway/enforcer/org.wso2.apk.enforcer/build.gradle @@ -94,7 +94,6 @@ dependencies { implementation libs.openfeign.feign.gson implementation libs.openfeign.feign.slf4j implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1' - implementation 'org.bouncycastle:bctls-jdk18on:1.78.1' test { implementation libs.junit implementation libs.mockito.inline diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image.properties b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image.properties deleted file mode 100644 index e69de29bb..000000000 diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/jni-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/jni-config.json similarity index 100% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/jni-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/jni-config.json diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/native-image.properties b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/native-image.properties new file mode 100644 index 000000000..a5551ab67 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/native-image.properties @@ -0,0 +1,22 @@ +Args = --features=org.wso2.apk.enforcer.commons.svm.BouncyCastleFeature \ + --initialize-at-build-time=org.apache.logging.log4j \ + --initialize-at-build-time=org.slf4j \ + --initialize-at-build-time=org.apache.logging.slf4j.Log4jMarkerFactory \ + --initialize-at-build-time=org.apache.logging.slf4j.Log4jLoggerFactory \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.epoll.Epoll \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.epoll.Native \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventArray \ + -H:ClassInitialization=org.bouncycastle.jcajce.provider.drbg.DRBG\$Default:rerun,org.bouncycastle.jcajce.provider.drbg.DRBG\$NonceAndIV:rerun \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.unix.IovArray \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.unix.Errors \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.SSLPrivateKeyMethod \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.SSL \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateVerifier \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateCompressionAlgo \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.channel.unix.Limits \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslAsyncPrivateKeyMethod \ + --initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslPrivateKeyMethod \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/predefined-classes-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/predefined-classes-config.json similarity index 100% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/predefined-classes-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/predefined-classes-config.json diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/proxy-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/proxy-config.json similarity index 100% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/proxy-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/proxy-config.json diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/reflect-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/reflect-config.json similarity index 99% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/reflect-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/reflect-config.json index a2da55cb1..3ffd72bb0 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/reflect-config.json +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/reflect-config.json @@ -1289,6 +1289,30 @@ { "name":"sun.security.x509.SubjectKeyIdentifierExtension", "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] - } + }, + { + "name": "org.apache.logging.log4j.util.Strings", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "org.apache.logging.log4j.status.StatusLogger", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "org.apache.logging.slf4j.Log4jLoggerFactory", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "org.slf4j.impl.StaticLoggerBinder", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + } ] \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/resource-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/resource-config.json similarity index 100% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/resource-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/resource-config.json diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/serialization-config.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/serialization-config.json similarity index 100% rename from gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/serialization-config.json rename to gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/META-INF/native-image/org.wso2.apk.org.wso2.apk.enforcer/serialization-config.json