From b0b759d48dd4791e8d3f5a2af169c55c5168cc17 Mon Sep 17 00:00:00 2001 From: neillin Date: Sun, 30 Oct 2022 13:24:39 -0400 Subject: [PATCH] add script to compile to native executable (#90) --- README.md | 14 + config/local/values.yml | 2 +- pom.xml | 2 + .../META-INF/native-image/jni-config.json | 55 + .../native-image/native-image.properties | 8 + .../predefined-classes-config.json | 8 + .../META-INF/native-image/proxy-config.json | 2 + .../META-INF/native-image/reflect-config.json | 1276 +++++++++++++++++ .../native-image/resource-config.json | 33 + .../native-image/serialization-config.json | 6 + 10 files changed, 1405 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/META-INF/native-image/jni-config.json create mode 100644 src/main/resources/META-INF/native-image/native-image.properties create mode 100644 src/main/resources/META-INF/native-image/predefined-classes-config.json create mode 100644 src/main/resources/META-INF/native-image/proxy-config.json create mode 100644 src/main/resources/META-INF/native-image/reflect-config.json create mode 100644 src/main/resources/META-INF/native-image/resource-config.json create mode 100644 src/main/resources/META-INF/native-image/serialization-config.json diff --git a/README.md b/README.md index a4b2f48..c06c8a5 100644 --- a/README.md +++ b/README.md @@ -237,5 +237,19 @@ response: "severity": "ERROR" } ``` +#### Compile to native executable with Graalvm native-image + +Graalvm and its native-image are required to compile uber jar file native executable, please following the [link](https://www.graalvm.org/java/quickstart) to install latest version of Graalvm + +``` + mvn clean install + + native-image -jar target/light-gateway.jar -o target/application +``` +you can execute the generated executable with following command: + +``` + target/application -Dight-4j-config-dir=config/local +``` diff --git a/config/local/values.yml b/config/local/values.yml index 6a36a4b..c26c66d 100644 --- a/config/local/values.yml +++ b/config/local/values.yml @@ -128,7 +128,7 @@ handler.chains.default: - audit - sanitizer - validator - - prefix + #- prefix - router - proxy diff --git a/pom.xml b/pom.xml index 0c623d1..6646622 100644 --- a/pom.xml +++ b/pom.xml @@ -471,6 +471,8 @@ META-INF/*.DSA META-INF/*.RSA META-INF/versions/** + META-INF/native-image/io.netty/** + META-INF/native-image/software.amazon.awssdk/** diff --git a/src/main/resources/META-INF/native-image/jni-config.json b/src/main/resources/META-INF/native-image/jni-config.json new file mode 100644 index 0000000..5e9c7e5 --- /dev/null +++ b/src/main/resources/META-INF/native-image/jni-config.json @@ -0,0 +1,55 @@ +[ +{ + "name":"[Lcom.sun.management.internal.DiagnosticCommandArgumentInfo;" +}, +{ + "name":"[Lcom.sun.management.internal.DiagnosticCommandInfo;" +}, +{ + "name":"com.networknt.server.Server", + "methods":[{"name":"main","parameterTypes":["java.lang.String[]"] }] +}, +{ + "name":"com.sun.management.internal.DiagnosticCommandArgumentInfo", + "methods":[{"name":"","parameterTypes":["java.lang.String","java.lang.String","java.lang.String","java.lang.String","boolean","boolean","boolean","int"] }] +}, +{ + "name":"com.sun.management.internal.DiagnosticCommandInfo", + "methods":[{"name":"","parameterTypes":["java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String","boolean","java.util.List"] }] +}, +{ + "name":"java.lang.Boolean", + "methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"java.lang.String", + "methods":[ + {"name":"lastIndexOf","parameterTypes":["int"] }, + {"name":"substring","parameterTypes":["int"] } + ] +}, +{ + "name":"java.lang.System", + "methods":[ + {"name":"getProperty","parameterTypes":["java.lang.String"] }, + {"name":"setProperty","parameterTypes":["java.lang.String","java.lang.String"] } + ] +}, +{ + "name":"java.util.Arrays", + "methods":[{"name":"asList","parameterTypes":["java.lang.Object[]"] }] +}, +{ + "name":"sun.management.VMManagementImpl", + "fields":[ + {"name":"compTimeMonitoringSupport"}, + {"name":"currentThreadCpuTimeSupport"}, + {"name":"objectMonitorUsageSupport"}, + {"name":"otherThreadCpuTimeSupport"}, + {"name":"remoteDiagnosticCommandsSupport"}, + {"name":"synchronizerUsageSupport"}, + {"name":"threadAllocatedMemorySupport"}, + {"name":"threadContentionMonitoringSupport"} + ] +} +] diff --git a/src/main/resources/META-INF/native-image/native-image.properties b/src/main/resources/META-INF/native-image/native-image.properties new file mode 100644 index 0000000..2811640 --- /dev/null +++ b/src/main/resources/META-INF/native-image/native-image.properties @@ -0,0 +1,8 @@ +Args = -H:+ReportExceptionStackTraces \ + -H:TraceClassInitialization=true \ + --enable-http \ + --enable-https \ + --enable-url-protocols=http,https \ + --report-unsupported-elements-at-runtime \ + --no-fallback \ + --native-image-info \ No newline at end of file diff --git a/src/main/resources/META-INF/native-image/predefined-classes-config.json b/src/main/resources/META-INF/native-image/predefined-classes-config.json new file mode 100644 index 0000000..0e79b2c --- /dev/null +++ b/src/main/resources/META-INF/native-image/predefined-classes-config.json @@ -0,0 +1,8 @@ +[ + { + "type":"agent-extracted", + "classes":[ + ] + } +] + diff --git a/src/main/resources/META-INF/native-image/proxy-config.json b/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 0000000..0d4f101 --- /dev/null +++ b/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/src/main/resources/META-INF/native-image/reflect-config.json b/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000..98d3bfd --- /dev/null +++ b/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,1276 @@ +[ +{ + "name":"[B" +}, +{ + "name":"[C" +}, +{ + "name":"[D" +}, +{ + "name":"[F" +}, +{ + "name":"[I" +}, +{ + "name":"[J" +}, +{ + "name":"[Lcom.fasterxml.jackson.databind.deser.Deserializers;" +}, +{ + "name":"[Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;" +}, +{ + "name":"[Lcom.fasterxml.jackson.databind.deser.ValueInstantiators;" +}, +{ + "name":"[Lcom.fasterxml.jackson.databind.ser.Serializers;" +}, +{ + "name":"[Lcom.networknt.handler.RequestInterceptor;" +}, +{ + "name":"[Lcom.networknt.handler.ResponseInterceptor;" +}, +{ + "name":"[Ljava.lang.String;" +}, +{ + "name":"[Ljavax.management.ObjectName;" +}, +{ + "name":"[Ljavax.management.openmbean.CompositeData;" +}, +{ + "name":"[Lsun.security.pkcs.SignerInfo;" +}, +{ + "name":"[S" +}, +{ + "name":"[Z" +}, +{ + "name":"apple.security.AppleProvider", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.LoggerContext", + "queryAllPublicMethods":true, + "methods":[{"name":"addTurboFilter","parameterTypes":["ch.qos.logback.classic.turbo.TurboFilter"] }] +}, +{ + "name":"ch.qos.logback.classic.encoder.PatternLayoutEncoder", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.ClassOfCallerConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.DateConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.FileOfCallerConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.LevelConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.LineOfCallerConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.LineSeparatorConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.LoggerConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.MDCConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.MessageConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.MethodOfCallerConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.pattern.ThreadConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.classic.turbo.MarkerFilter", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setMarker","parameterTypes":["java.lang.String"] } + ] +}, +{ + "name":"ch.qos.logback.classic.turbo.MatchingFilter", + "methods":[{"name":"setOnMatch","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"ch.qos.logback.core.ConsoleAppender", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.core.OutputStreamAppender", + "methods":[{"name":"setEncoder","parameterTypes":["ch.qos.logback.core.encoder.Encoder"] }] +}, +{ + "name":"ch.qos.logback.core.encoder.LayoutWrappingEncoder", + "methods":[ + {"name":"setImmediateFlush","parameterTypes":["boolean"] }, + {"name":"setParent","parameterTypes":["ch.qos.logback.core.spi.ContextAware"] } + ] +}, +{ + "name":"ch.qos.logback.core.pattern.PatternLayoutEncoderBase", + "methods":[{"name":"setPattern","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"ch.qos.logback.core.rolling.FixedWindowRollingPolicy", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setMaxIndex","parameterTypes":["int"] }, + {"name":"setMinIndex","parameterTypes":["int"] } + ] +}, +{ + "name":"ch.qos.logback.core.rolling.RollingFileAppender", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setFile","parameterTypes":["java.lang.String"] }, + {"name":"setRollingPolicy","parameterTypes":["ch.qos.logback.core.rolling.RollingPolicy"] }, + {"name":"setTriggeringPolicy","parameterTypes":["ch.qos.logback.core.rolling.TriggeringPolicy"] } + ] +}, +{ + "name":"ch.qos.logback.core.rolling.RollingPolicyBase", + "methods":[ + {"name":"setFileNamePattern","parameterTypes":["java.lang.String"] }, + {"name":"setParent","parameterTypes":["ch.qos.logback.core.FileAppender"] } + ] +}, +{ + "name":"ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setMaxFileSize","parameterTypes":["ch.qos.logback.core.util.FileSize"] } + ] +}, +{ + "name":"ch.qos.logback.core.rolling.helper.DateTokenConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.core.rolling.helper.IntegerTokenConverter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"ch.qos.logback.core.util.FileSize", + "methods":[{"name":"valueOf","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"com.fasterxml.jackson.databind.ext.Java7HandlersImpl", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.fasterxml.jackson.databind.ext.Java7SupportImpl", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.github.benmanes.caffeine.cache.BLCHeader$DrainStatusRef", + "fields":[{"name":"drainStatus"}] +}, +{ + "name":"com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueueColdProducerFields", + "fields":[{"name":"producerLimit"}] +}, +{ + "name":"com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueueConsumerFields", + "fields":[{"name":"consumerIndex"}] +}, +{ + "name":"com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueueProducerFields", + "fields":[{"name":"producerIndex"}] +}, +{ + "name":"com.github.benmanes.caffeine.cache.PS", + "fields":[ + {"name":"key"}, + {"name":"value"} + ] +}, +{ + "name":"com.github.benmanes.caffeine.cache.PSW", + "fields":[{"name":"writeTime"}], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.github.benmanes.caffeine.cache.SSW", + "methods":[{"name":"","parameterTypes":["com.github.benmanes.caffeine.cache.Caffeine","com.github.benmanes.caffeine.cache.CacheLoader","boolean"] }] +}, +{ + "name":"com.networknt.audit.AuditHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.balance.RoundRobinLoadBalance", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.body.BodyHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.body.RequestBodyInterceptor", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.body.ResponseBodyInterceptor", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.ChaosMonkeyConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.chaos.ChaosMonkeyGetHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.ChaosMonkeyPostHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.ExceptionAssaultConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.chaos.ExceptionAssaultHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.KillappAssaultConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.chaos.KillappAssaultHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.LatencyAssaultConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.chaos.LatencyAssaultHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.chaos.MemoryAssaultConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.chaos.MemoryAssaultHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.cluster.LightCluster", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.config.reload.handler.ConfigReloadHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.config.reload.handler.ModuleRegistryGetHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.config.reload.model.ConfigReloadConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.correlation.CorrelationConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.correlation.CorrelationHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.cors.CorsConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.cors.CorsHttpHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.decrypt.AESDecryptor", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.exception.ExceptionConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.exception.ExceptionHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.handler.RequestInterceptor" +}, +{ + "name":"com.networknt.handler.RequestInterceptorInjectionHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.handler.ResponseInterceptor" +}, +{ + "name":"com.networknt.handler.ResponseInterceptorInjectionHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.handler.config.HandlerConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.handler.config.PathChain", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.header.HeaderHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.health.HealthConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.health.HealthGetHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.health.HealthGetHandler$HealthResult", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.info.ServerInfoConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.info.ServerInfoGetHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.jsonoverlay.ListOverlay$1", + "methods":[{"name":"getOverlay","parameterTypes":[] }] +}, +{ + "name":"com.networknt.jsonoverlay.MapOverlay$1", + "methods":[{"name":"getOverlay","parameterTypes":[] }] +}, +{ + "name":"com.networknt.limit.LimitHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.logging.handler.LoggerGetHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.logging.handler.LoggerGetLogContentsHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.logging.handler.LoggerPostHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.logging.model.LoggerConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.logging.model.LoggerInfo", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.metrics.MetricsConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.metrics.MetricsHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.openapi.JwtVerifyHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.openapi.OpenApiHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.openapi.ValidatorConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.openapi.ValidatorHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.proxy.LightProxyHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.proxy.ProxyServerInfoHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.registry.URLImpl", + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setHost","parameterTypes":["java.lang.String"] }, + {"name":"setParameters","parameterTypes":["java.util.Map"] }, + {"name":"setPath","parameterTypes":["java.lang.String"] }, + {"name":"setPort","parameterTypes":["int"] }, + {"name":"setProtocol","parameterTypes":["java.lang.String"] } + ] +}, +{ + "name":"com.networknt.registry.support.DirectRegistry", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["com.networknt.registry.URL"] }] +}, +{ + "name":"com.networknt.reqtrans.RequestTransformerInterceptor", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.restrans.ResponseTransformerInterceptor", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.router.GatewayConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.router.GatewayRouterHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.router.middleware.PathPrefixServiceHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.sanitizer.SanitizerHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.schema.PropertiesValidator", + "methods":[{"name":"","parameterTypes":["java.lang.String","com.fasterxml.jackson.databind.JsonNode","com.networknt.schema.JsonSchema","com.networknt.schema.ValidationContext"] }] +}, +{ + "name":"com.networknt.schema.RequiredValidator", + "methods":[{"name":"","parameterTypes":["java.lang.String","com.fasterxml.jackson.databind.JsonNode","com.networknt.schema.JsonSchema","com.networknt.schema.ValidationContext"] }] +}, +{ + "name":"com.networknt.schema.TypeValidator", + "methods":[{"name":"","parameterTypes":["java.lang.String","com.fasterxml.jackson.databind.JsonNode","com.networknt.schema.JsonSchema","com.networknt.schema.ValidationContext"] }] +}, +{ + "name":"com.networknt.server.ServerConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.specification.FaviconHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.specification.SpecDisplayHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.specification.SpecSwaggerUIHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.networknt.specification.SpecificationConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.traceability.TraceabilityConfig", + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true, + "allPublicMethods":true, + "allPublicConstructors":true +}, +{ + "name":"com.networknt.traceability.TraceabilityHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.AESCipher$General", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.AESKeyGenerator", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.ARCFOURCipher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Poly1305", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.DESCipher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.DESedeCipher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.DHParameters", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.GaloisCounterMode$AESGCM", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.HmacSHA1", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.PBKDF2Core$HmacSHA1", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.TlsKeyMaterialGenerator", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.TlsMasterSecretGenerator", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.crypto.provider.TlsPrfGenerator$V12", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.management.GarbageCollectorMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.GcInfo", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.HotSpotDiagnosticMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.ThreadMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.UnixOperatingSystemMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.VMOption", + "queryAllPublicMethods":true +}, +{ + "name":"com.sun.management.internal.GarbageCollectorExtImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"com.sun.management.internal.HotSpotDiagnostic", + "queryAllPublicConstructors":true +}, +{ + "name":"com.sun.management.internal.HotSpotThreadImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"com.sun.management.internal.OperatingSystemImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"float", + "queryAllDeclaredMethods":true +}, +{ + "name":"io.undertow.UndertowLogger_$logger", + "methods":[{"name":"","parameterTypes":["org.jboss.logging.Logger"] }] +}, +{ + "name":"io.undertow.client.http.HttpResponseParser$$generated", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"io.undertow.server.protocol.http.HttpRequestParser$$generated", + "methods":[{"name":"","parameterTypes":["org.xnio.OptionMap"] }] +}, +{ + "name":"io.undertow.server.protocol.http.ServerFixedLengthStreamSinkConduit", + "methods":[{"name":"reset","parameterTypes":["long","io.undertow.server.HttpServerExchange"] }] +}, +{ + "name":"io.undertow.util.Headers", + "allDeclaredFields":true +}, +{ + "name":"io.undertow.util.HttpString", + "fields":[{"name":"hashCode"}] +}, +{ + "name":"io.undertow.util.Methods", + "allDeclaredFields":true +}, +{ + "name":"io.undertow.util.Protocols", + "allDeclaredFields":true +}, +{ + "name":"java.io.FilePermission" +}, +{ + "name":"java.io.Serializable", + "queryAllDeclaredMethods":true +}, +{ + "name":"java.lang.Boolean", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Byte", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Character", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Comparable", + "queryAllDeclaredMethods":true +}, +{ + "name":"java.lang.Deprecated", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.Double", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Float", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Integer", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Long", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.Number", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "name":"java.lang.RuntimePermission" +}, +{ + "name":"java.lang.Short", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.StackTraceElement", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.String" +}, +{ + "name":"java.lang.Thread", + "fields":[{"name":"contextClassLoader"}] +}, +{ + "name":"java.lang.Void", + "fields":[{"name":"TYPE"}] +}, +{ + "name":"java.lang.constant.Constable", + "queryAllDeclaredMethods":true +}, +{ + "name":"java.lang.constant.ConstantDesc", + "queryAllDeclaredMethods":true +}, +{ + "name":"java.lang.management.BufferPoolMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.ClassLoadingMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.CompilationMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.LockInfo", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.ManagementPermission", + "methods":[{"name":"","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"java.lang.management.MemoryMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.MemoryManagerMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.MemoryPoolMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.MemoryUsage", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.MonitorInfo", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.PlatformLoggingMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.RuntimeMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"java.lang.management.ThreadInfo", + "queryAllPublicMethods":true +}, +{ + "name":"java.math.BigDecimal" +}, +{ + "name":"java.math.BigInteger" +}, +{ + "name":"java.net.NetPermission" +}, +{ + "name":"java.net.SocketPermission" +}, +{ + "name":"java.net.URLPermission", + "methods":[{"name":"","parameterTypes":["java.lang.String","java.lang.String"] }] +}, +{ + "name":"java.security.AlgorithmParametersSpi" +}, +{ + "name":"java.security.AllPermission" +}, +{ + "name":"java.security.KeyStoreSpi" +}, +{ + "name":"java.security.SecureRandomParameters" +}, +{ + "name":"java.security.SecurityPermission" +}, +{ + "name":"java.security.interfaces.RSAPrivateKey" +}, +{ + "name":"java.security.interfaces.RSAPublicKey" +}, +{ + "name":"java.sql.Date" +}, +{ + "name":"java.sql.Timestamp" +}, +{ + "name":"java.time.format.DateTimeFormatter", + "fields":[{"name":"ISO_OFFSET_DATE_TIME"}] +}, +{ + "name":"java.util.Date" +}, +{ + "name":"java.util.PropertyPermission", + "methods":[{"name":"","parameterTypes":["java.lang.String","java.lang.String"] }] +}, +{ + "name":"java.util.logging.LogManager", + "methods":[{"name":"getLoggingMXBean","parameterTypes":[] }] +}, +{ + "name":"java.util.logging.LoggingMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"javax.management.MBeanOperationInfo", + "queryAllPublicMethods":true +}, +{ + "name":"javax.management.MBeanServerBuilder", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"javax.management.ObjectName" +}, +{ + "name":"javax.management.openmbean.CompositeData" +}, +{ + "name":"javax.management.openmbean.OpenMBeanOperationInfoSupport" +}, +{ + "name":"javax.management.openmbean.TabularData" +}, +{ + "name":"javax.net.ssl.SSLEngine", + "methods":[{"name":"getApplicationProtocol","parameterTypes":[] }] +}, +{ + "name":"javax.net.ssl.SSLParameters", + "methods":[{"name":"setApplicationProtocols","parameterTypes":["java.lang.String[]"] }] +}, +{ + "name":"javax.security.auth.x500.X500Principal", + "fields":[{"name":"thisX500Name"}], + "methods":[{"name":"","parameterTypes":["sun.security.x509.X500Name"] }] +}, +{ + "name":"jdk.management.jfr.ConfigurationInfo", + "queryAllPublicMethods":true +}, +{ + "name":"jdk.management.jfr.EventTypeInfo", + "queryAllPublicMethods":true +}, +{ + "name":"jdk.management.jfr.FlightRecorderMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"jdk.management.jfr.FlightRecorderMXBeanImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"jdk.management.jfr.RecordingInfo", + "queryAllPublicMethods":true +}, +{ + "name":"jdk.management.jfr.SettingDescriptorInfo", + "queryAllPublicMethods":true +}, +{ + "name":"net.logstash.logback.composite.AbstractFieldJsonProvider", + "methods":[{"name":"setFieldName","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"net.logstash.logback.composite.AbstractFormattedTimestampJsonProvider", + "methods":[{"name":"setPattern","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"net.logstash.logback.composite.AbstractPatternJsonProvider", + "methods":[{"name":"setPattern","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"net.logstash.logback.composite.loggingevent.LoggingEventFormattedTimestampJsonProvider", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"net.logstash.logback.composite.loggingevent.LoggingEventJsonProviders", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"addPattern","parameterTypes":["net.logstash.logback.composite.loggingevent.LoggingEventPatternJsonProvider"] }, + {"name":"addRootStackTraceElement","parameterTypes":["net.logstash.logback.composite.loggingevent.RootStackTraceElementJsonProvider"] }, + {"name":"addStackTrace","parameterTypes":["net.logstash.logback.composite.loggingevent.StackTraceJsonProvider"] }, + {"name":"addTimestamp","parameterTypes":["net.logstash.logback.composite.loggingevent.LoggingEventFormattedTimestampJsonProvider"] } + ] +}, +{ + "name":"net.logstash.logback.composite.loggingevent.LoggingEventPatternJsonProvider", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"net.logstash.logback.composite.loggingevent.RootStackTraceElementJsonProvider", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"net.logstash.logback.composite.loggingevent.StackTraceJsonProvider", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder", + "queryAllPublicMethods":true, + "methods":[ + {"name":"","parameterTypes":[] }, + {"name":"setProviders","parameterTypes":["net.logstash.logback.composite.JsonProviders"] } + ] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutor", + "fields":[ + {"name":"activeCount"}, + {"name":"peakQueueSize"}, + {"name":"peakThreadCount"}, + {"name":"queueSize"}, + {"name":"sequence"}, + {"name":"terminationWaiters"} + ] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutor$MXBeanImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutor$PoolThreadNode", + "fields":[ + {"name":"parked"}, + {"name":"task"} + ] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutor$QNode", + "fields":[{"name":"next"}] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutorBase1", + "fields":[ + {"name":"tail"}, + {"name":"tailLock"} + ] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutorBase3", + "fields":[{"name":"head"}] +}, +{ + "name":"org.jboss.threads.EnhancedQueueExecutorBase5", + "fields":[{"name":"threadStatus"}] +}, +{ + "name":"org.jboss.threads.Messages_$logger", + "methods":[{"name":"","parameterTypes":["org.jboss.logging.Logger"] }] +}, +{ + "name":"org.jboss.threads.management.StandardThreadPoolMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"org.slf4j.spi.LocationAwareLogger", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.xnio._private.Messages_$logger", + "methods":[{"name":"","parameterTypes":["org.jboss.logging.Logger"] }] +}, +{ + "name":"org.xnio.management.XnioProviderMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"org.xnio.management.XnioServerMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"org.xnio.management.XnioWorkerMXBean", + "queryAllPublicMethods":true +}, +{ + "name":"org.xnio.nio.Log_$logger", + "methods":[{"name":"","parameterTypes":["org.jboss.logging.Logger"] }] +}, +{ + "name":"org.xnio.nio.NioTcpServer$1", + "queryAllPublicConstructors":true +}, +{ + "name":"org.xnio.nio.NioXnio$3", + "queryAllPublicConstructors":true +}, +{ + "name":"org.xnio.nio.NioXnioWorker$NioWorkerMetrics", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.ClassLoadingImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.CompilationImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.ManagementFactoryHelper$1", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.ManagementFactoryHelper$PlatformLoggingImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.MemoryImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.MemoryManagerImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.MemoryPoolImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.management.RuntimeImpl", + "queryAllPublicConstructors":true +}, +{ + "name":"sun.misc.Unsafe", + "fields":[{"name":"theUnsafe"}], + "methods":[{"name":"invokeCleaner","parameterTypes":["java.nio.ByteBuffer"] }] +}, +{ + "name":"sun.security.provider.DSA$SHA224withDSA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.DSA$SHA256withDSA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.JavaKeyStore$DualFormatJKS", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.JavaKeyStore$JKS", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.NativePRNG", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA2$SHA224", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA2$SHA256", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA5$SHA384", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA5$SHA512", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.X509Factory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.PSSParameters", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSAKeyFactory$Legacy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSAPSSSignature", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSASignature$SHA224withRSA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.ssl.KeyManagerFactoryImpl$SunX509", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.ssl.ProtocolVersion" +}, +{ + "name":"sun.security.ssl.SSLContextImpl$TLS10Context", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.ssl.SSLContextImpl$TLSContext", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.ssl.SSLEngineImpl" +}, +{ + "name":"sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.util.ObjectIdentifier" +}, +{ + "name":"sun.security.x509.CertificateExtensions" +}, +{ + "name":"sun.security.x509.SubjectKeyIdentifierExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +} +] diff --git a/src/main/resources/META-INF/native-image/resource-config.json b/src/main/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000..ec68ad4 --- /dev/null +++ b/src/main/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,33 @@ +{ + "resources":{ + "includes":[ + { + "pattern":"^META-INF/services/.*\\..*$" + }, + { + "pattern":"^config/.*\\..*$" + }, + { + "pattern":"\\Qio/undertow/version.properties\\E" + }, + { + "pattern":"\\Qlogback.xml\\E" + }, + { + "pattern":"\\Qorg/jboss/threads/Version.properties\\E" + }, + { + "pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E" + }, + { + "pattern":"\\Qorg/xnio/Version.properties\\E" + }, + { + "pattern":"\\Qorg/xnio/nio/Version.properties\\E" + } + ]}, + "bundles":[{ + "name":"jsv-messages", + "locales":[""] + }] +} diff --git a/src/main/resources/META-INF/native-image/serialization-config.json b/src/main/resources/META-INF/native-image/serialization-config.json new file mode 100644 index 0000000..bf554e0 --- /dev/null +++ b/src/main/resources/META-INF/native-image/serialization-config.json @@ -0,0 +1,6 @@ +{ + "types":[ + ], + "lambdaCapturingTypes":[ + ] +}