-
Notifications
You must be signed in to change notification settings - Fork 81
JacksonBlackbirdAccess
Class access exception with Groovy Script Serialization using BlackbirdModule
#285
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
Comments
Hi, would like to know if there are any workarounds for this. Any suggestions? |
My main suggestion would be to try a more recent version -- ideally 2.18.2 -- of Jackson components. Otherwise I suspect Groovy-generated class has name that somehow Blackbird has issues with. Perhaps it is in the "default package" (i.e. one without name) and BB does not handle that case well. @stevenschlansker WDYT? |
I tried with 2.18.2 and see the same error unfortunately.
@cowtowncoder How can I inspect this Groovy generated class to root cause this? |
To be honest, I don't know. Maybe debugging on |
@cowtowncoder Debugging accessClassIn method, accessClassName = ".$$JacksonBlackbirdAccess" What made my test pass is adding a package name at beginning of script
While i couldn't test this exactly, i think handling case where
to
|
@apoorvam Thank you for sharing! This should help resolve the issue -- main challenge is probably just adding a test to verify (ideally not adding Groovy dependency even just for tests). Might work with just root-level test class -- or maybe using JDK script support. That is: I think your fix would probably work, but we'd need a verification of some kind to prove it (and guard against regression). |
@cowtowncoder Something like this? I'll have to test it though. I couldn't test it because CrossLoaderAccess class isn't exposed externally |
I was thinking more an actual end-to-end test of serializing/deserializing root-level value class. Sort of reproducing your actual use case wrt value class not being in any package. |
Is there a CI pipeline that i can run my test on? #289 @cowtowncoder |
Thanks for tracking this down, I did not consider the default package when writing this, I agree that is likely the problem. |
@apoorvam I had to approve running of CI since you're new contributor. |
JacksonBlackbirdAccess
Class access exception with Groovy Script Serialization using BlackbirdModule
@cowtowncoder When will 2.19 be released? Also, amended a change: #292 |
Looking forward for v2.19.0 with this fix! Thank you. |
I'm encountering an issue when attempting to use the BlackbirdModule in a Spring Boot 3.2 application with Groovy scripting. The goal is to serialize a Groovy object into JSON using the Jackson ObjectMapper with the BlackbirdModule. However, the test case below fails with an exception during the serialization of a Groovy object.
Exception:
I am using
jackson-bom
version 2.15.4 and Groovy 4.0.17 that's default with Spring Boot 3.2. Any suggestions? Removing Blackbird module in above test passes, works even with afterburner module. Just not with blackbird module.The text was updated successfully, but these errors were encountered: