Enable Safe Composition of Metadata for ShardingSphere Proxy Native#33179
Merged
Conversation
8018a74 to
d4cd0ac
Compare
linghengqian
commented
Oct 10, 2024
Member
Author
There was a problem hiding this comment.
- This PR became quite complicated because the Warning Log even included GraalVM CE's internal missing GRM, which definitely involved multiple potential GraalVM bugs.
Before supporting compiling shardingsphere project with GraalVM CE For JDK23, I needed to change-H:ThrowMissingRegistrationErrors=to-H:ThrowMissingRegistrationErrors=org.apache.shardingsphereto avoid a wider range of impacts.
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access
com.oracle.svm.core.genscavenge.HeapImplMemoryMXBean.getConstructors()
without it being registered for runtime reflection. Add com.oracle.svm.core.genscavenge.HeapImplMemoryMXBean.getConstructors() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
java.base@22.0.2/java.lang.Class.getConstructors(DynamicHub.java:1028)
java.management@22.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.findConstructors(MBeanIntrospector.java:461)
java.management@22.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:432)
java.management@22.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:391)- The path scanned by seata client is also suspicious. I don't believe the seata client uses the
registryfile directly.
com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path
registry
without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
java.base@22.0.2/java.lang.ClassLoader.getResource(ClassLoader.java:1407)
org.apache.seata.config.FileConfiguration.getFileFromClasspath(FileConfiguration.java:194)
org.apache.seata.config.FileConfiguration.getConfigFile(FileConfiguration.java:144)
org.apache.seata.config.FileConfiguration.<init>(FileConfiguration.java:108)4e0fc60 to
b66fc2d
Compare
strongduanmu
approved these changes
Oct 11, 2024
54 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #29052.
Changes proposed in this pull request:
Adds GraalVM Reachability Metadata for
ch.qos.logback:logback-core:1.2.13Adds GraalVM Reachability Metadata for
com.alibaba:druid:1.2.7Adds GraalVM Reachability Metadata for
com.github.docker-java:docker-java:3.4.0Adds GraalVM Reachability Metadata for
com.mysql:mysql-connector-j:8.3.0Adds GraalVM Reachability Metadata for
io.grpc:grpc-netty:1.65.1Adds GraalVM Reachability Metadata for
io.vertx:vertx-core:4.5.1Adds GraalVM Reachability Metadata for
io.netty:netty-transport-classes-epoll:4.1.112.FinalAdds GraalVM Reachability Metadata for
org.apache.groovy:groovy:4.0.22Adds GraalVM Reachability Metadata for
org.apache.hadoop:hadoop-common:3.3.6Adds GraalVM Reachability Metadata for
org.apiguardian:apiguardian-api:1.1.2Adds GraalVM Reachability Metadata for
org.jboss.logging:jboss-logging:3.2.1.FinalAdds GraalVM Reachability Metadata for
org.jboss.narayana.jta:jta:5.12.7.FinalAdds GraalVM Reachability Metadata for
org.junit.jupiter:junit-jupiter:5.11.1Adds GraalVM Reachability Metadata for
org.testcontainers:junit-jupiter:1.20.2Adds GraalVM Reachability Metadata for
com.typesafe:config:1.2.1Adds GraalVM Reachability Metadata for
com.google.protobuf:protobuf-java:3.21.12. This sounds like what I missed in Add support forcom.google.protobuf:protobuf-java-util:3.21.12oracle/graalvm-reachability-metadata#167 .Adds GraalVM Reachability Metadata for
org.springframework:spring-jcl:5.3.27Adds GraalVM Reachability Metadata for
com.clickhouse:clickhouse-jdbc:0.6.3Updates documentation. According to Unable to apply parallel builds to thread-unsafe
native-maven-plugingraalvm/native-build-tools#619 , GraalVM Native Build Tools 0.10.3 no longer prevents parallel builds of Maven.As for [GR-49770] Safe Composition of Metadata oracle/graal#5173, the SCM proposal involving
buildArgentered GraalVM CE For JDK22 as an experimental option and became an official option on GraalVM CE For JDK23. The SCM proposal brings more readable Error Logs, which is definitely beneficial to contributors. The Error Logs brought by the SCM proposal are as follows.{"excludeClasses": "java.**"}. Because this type of GRM begins to be required by Safe Composition of Metadata. There are obviously too manyjava.**GRM JSONs that need to be defined.{"excludeClasses": "java.**"}, {"includeClasses": "java.io.BufferedWriter"}, {"includeClasses": "java.io.Closeable"}, {"includeClasses": "java.io.Flushable"}, {"includeClasses": "java.io.InputStream"}, {"includeClasses": "java.io.OutputStream"}, {"includeClasses": "java.io.Reader"}, {"includeClasses": "java.io.Writer"}, {"includeClasses": "java.lang.Appendable"}, {"includeClasses": "java.lang.AutoCloseable"}, {"includeClasses": "java.lang.Boolean"}, {"includeClasses": "java.lang.ClassLoader"}, {"includeClasses": "java.lang.CharSequence"}, {"includeClasses": "java.lang.Comparable"}, {"includeClasses": "java.lang.Integer"}, {"includeClasses": "java.lang.Iterable"}, {"includeClasses": "java.lang.Long"}, {"includeClasses": "java.lang.Number"}, {"includeClasses": "java.lang.Process"}, {"includeClasses": "java.lang.Readable"}, {"includeClasses": "java.lang.constant.ConstantDesc"}, {"includeClasses": "java.lang.reflect.AnnotatedElement"}, {"includeClasses": "java.lang.management.RuntimeMXBean"}, {"includeClasses": "java.util.AbstractCollection"}, {"includeClasses": "java.util.AbstractMap"}, {"includeClasses": "java.util.Collection"}, {"includeClasses": "java.util.Deque"}, {"includeClasses": "java.util.Enumeration"}, {"includeClasses": "java.util.HashSet"}, {"includeClasses": "java.util.Iterator"}, {"includeClasses": "java.util.LinkedHashSet"}, {"includeClasses": "java.util.List"}, {"includeClasses": "java.util.Map"}, {"includeClasses": "java.util.NavigableSet"}, {"includeClasses": "java.util.Properties"}, {"includeClasses": "java.util.Set"}, {"includeClasses": "java.util.SortedMap"}, {"includeClasses": "java.util.SortedSet"}, {"includeClasses": "java.util.Timer"}, {"includeClasses": "java.util.concurrent.BlockingQueue"}, {"includeClasses": "java.util.concurrent.atomic.LongAdder"}Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.