-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graalvm build failure #2414
Comments
solution: private final static Map<Integer,JdbcType> codeLookup = new HashMap<>();
JdbcType(int code) {
this.TYPE_CODE = code;
}
public static JdbcType forCode(int code) {
if (codeLookup.isEmpty()) {
for (JdbcType type : JdbcType.values()) {
codeLookup.put(type.TYPE_CODE, type);
}
}
return codeLookup.get(code);
} |
4 tasks
Mybatis provides support for different modules in both Spring Native and Quarkus, and I don't think the corresponding GraalVM json file should be added to mybatis itself. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MyBatis version
3.5.9
Database vendor and version
mysql 5.7
Test case or example project
Steps to reproduce
Expected result
build success
Actual result
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
org.apache.ibatis.type.JdbcType was unintentionally initialized at build time. org.apache.ibatis.type.JdbcType caused initialization of this class with the following trace:
at org.apache.ibatis.type.JdbcType.(JdbcType.java:30)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Unknown Source)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:568)
at java.lang.Class.getEnumConstantsShared(Class.java:3837)
at java.lang.Class.enumConstantDirectory(Class.java:3859)
at java.lang.Enum.valueOf(Enum.java:267)
at sun.reflect.annotation.AnnotationParser.parseEnumValue(AnnotationParser.java:479)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:344)
at java.lang.reflect.Method.getDefaultValue(Method.java:717)
at sun.reflect.annotation.AnnotationType.(AnnotationType.java:133)
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
at com.oracle.svm.core.code.MethodMetadataEncoder.prepareMetadataForClass(MethodMetadataEncoder.java:107)
at com.oracle.svm.core.code.CodeInfoEncoder.prepareMetadataForClass(CodeInfoEncoder.java:240)
at com.oracle.svm.hosted.image.NativeImageCodeCache.buildRuntimeMetadata(NativeImageCodeCache.java:230)
at com.oracle.svm.hosted.image.LIRNativeImageCodeCache.layoutMethods(LIRNativeImageCodeCache.java:106)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:608)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:599)
The text was updated successfully, but these errors were encountered: