question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraalVM issue with JsonNode serialization

See original GitHub issue

Describe the bug

When trying to serialize a JsonNode in native, we get the following error::

15:03:51,390 INFO  [app] 15:03:50,362 HTTP Request to /hello/big-serialize-list?expSize=99961 failed, error id: 23a57a4c-cb9d-4db1-b8a4-a0d362bdbb2f-1: org.jboss.resteasy.spi.UnhandledException: com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor class not found for declaringClass: com.fasterxml.jackson.databind.node.BaseJsonNode (targetConstructorClass: com.fasterxml.jackson.databind.JsonNode). Usually adding com.fasterxml.jackson.databind.node.BaseJsonNode to serialization-config.json fixes the problem.
15:03:51,392 INFO  [app]        at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:105)
15:03:51,393 INFO  [app]        at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:359)
15:03:51,394 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218)
15:03:51,395 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519)
15:03:51,396 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
15:03:51,396 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
15:03:51,397 INFO  [app]        at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
15:03:51,398 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
15:03:51,399 INFO  [app]        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
15:03:51,399 INFO  [app]        at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
15:03:51,400 INFO  [app]        at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:151)
15:03:51,400 INFO  [app]        at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:91)
15:03:51,401 INFO  [app]        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
15:03:51,401 INFO  [app]        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)

Quarkus Upstream: 999-SNAPSHOT Java: 11 Mandrel: 21.2.0.2-Final Mandrel Distribution (Java Version 11.0.13+8)

Reproducer: Project: https://github.com/pjgg/quarkus-test-suite/tree/feat/QUARKUS-1554 cmd: mvn clean verify -Pnative -Dit.test=SerializationIT#serializeBigList Note: serializeBigList is disabled, so remove this tag first.

Serialization config: https://github.com/pjgg/quarkus-test-suite/blob/feat/QUARKUS-1554/http/jaxrs/src/main/java/io/quarkus/ts/security/core/SerializationConfig.java

The test is pointing to this endpoint: https://github.com/pjgg/quarkus-test-suite/blob/feat/QUARKUS-1554/http/jaxrs/src/main/java/io/quarkus/ts/security/core/GreetingResource.java#L85

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Jan 5, 2022

Well, maybe it’s an easy fix but if it’s not, I doubt it’s a good investment of our time to test this in native.

0reactions
zakkakcommented, Nov 29, 2022

So shall we close this as won’t fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error wher use Json serialization on graalVM - Stack Overflow
I would like to use rest API to retrieve info for my app write whith gluon-mobile and graalvm. How I can serialize my...
Read more >
Writing JSON REST Services - Quarkus
JSON serialization libraries use Java reflection to get the properties of an object and serialize them. When using native executables with GraalVM, all...
Read more >
SerializationFeature (jackson-databind 2.13.0 API) - FasterXML
Enumeration that defines simple on/off features that affect the way Java objects are serialized. Note that features can be set both through ObjectMapper...
Read more >
Jackson JsonNode - Jenkov.com
This Jackson JsonNode tutorial will also explain how to build JsonNode object graphs from scratch, so you can serialize them to JSON later....
Read more >
Native Image Compatibility and Optimization Guide - GraalVM
The Java architects have announced that the existing serialization mechanism will be replaced with a new mechanism avoiding these problems in the near ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found