[GR-66194] java.lang.Object.newInstance()
returns instance of SerializationSupport$StubForAbstractClass
#11429
Labels
Uh oh!
There was an error while loading. Please reload this page.
Describe the Issue
Occurs in https://github.com/googleapis/google-http-java-client when running
mvn test -Pnative
using GraalVM for JDK 24.0.1You can find a partial non-minimal reproducer in googleapis/google-http-java-client#2101 - that helped me understand that there is something in the parent project causing this, maybe the execution profile or some dependency.
The following test case behaves differently in the JDK vs the native image.
In the JDK, the stdout shows as:
However, the native image uses a stub class for some reason.
In order to isolate this within google-http-java-client, I have tried removing all metadata files (i.e. rename
x-config.json
tox-config.bak.json
inside META-INF/native-image/.../), effectively not having any special config affecting this.I'm yet to exhaust other ideas to find out the root cause but I'd like to understand if there is a certain aspect of graalvm configs that could be influencing this in order to narrow this down a bit.
Thanks beforehand for the help!
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
Operating System and Version
Occurs in CYGWIN 10.0 and Ubuntu 22
Troubleshooting Confirmation
Run Command
mvn clean test -Pnative,native-tests,native-deps -Dagent=true -Dtest=com.google.api.client.util.DataTest#testRepro -T1.5C -pl 'google-http-client'
Expected Behavior
Object.class.newInstance()
returns ajava.lang.Object
Actual Behavior
Object.class.newInstance()
returnscom.oracle.svm.core.reflect.serialize.SerializationSupport$StubForAbstractClass
Steps to Reproduce
Occurs in https://github.com/googleapis/google-http-java-client when running
mvn test -Pnative
using GraalVM for JDK 24.0.1You can find a partial non-minimal reproducer in googleapis/google-http-java-client#2101 - that helped me understand that there is something in the parent project causing this, maybe the execution profile or some dependency.
Additional Context
No response
Run-Time Log Output and Error Messages
No response
The text was updated successfully, but these errors were encountered: