IllegalAccessError with Jackson Afterburner
See original GitHub issueI am using immutables v2.8.2 and jackson v2.12.3 with Afterburner module. However this is causing some issue regarding access modifers.
I created a sample project with 2 test. One of them is registering AfterBurner and other one is not. The one without afterburner is working properly. However other one is not.
https://github.com/cemo/immutable-afterburner-issue
Here is the sample error
WARNING: Disabling Afterburner serialization for class com.mycompany.app.ImmutableVal (field #0; mutator com.fasterxml.jackson.module.afterburner.ser.IntMethodPropertyWriter), due to access error (type java.lang.IllegalAccessError, message=failed to access class com.mycompany.app.ImmutableVal from class com.mycompany.app.ImmutableVal$Access4JacksonSerializer7db6db1a (com.mycompany.app.ImmutableVal is in unnamed module of loader 'app'; com.mycompany.app.ImmutableVal$Access4JacksonSerializer7db6db1a is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @5c30a9b0))
java.lang.IllegalAccessError: failed to access class com.mycompany.app.ImmutableVal from class com.mycompany.app.ImmutableVal$Access4JacksonSerializer7db6db1a (com.mycompany.app.ImmutableVal is in unnamed module of loader 'app'; com.mycompany.app.ImmutableVal$Access4JacksonSerializer7db6db1a is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @5c30a9b0)
at com.mycompany.app.ImmutableVal$Access4JacksonSerializer7db6db1a.intGetter(com/mycompany/app/ImmutableVal$Access4JacksonSerializer.java)
at com.fasterxml.jackson.module.afterburner.ser.IntMethodPropertyWriter.serializeAsField(IntMethodPropertyWriter.java:55)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4487)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3742)
at com.mycompany.app.AppTest.shouldAnswerWithThisTrueToo(AppTest.java:46)
to replicate run mvn clean test
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
jackson AfterburnerModule gives a warning in the log
IllegalAccessError, message=tried to access method com.test.test2.Parent. ... ObjectMapper; import com.fasterxml.jackson.module.afterburner.
Read more >Afterburner heartburn? - Google Groups
IllegalAccessError, message=null). java.lang.IllegalAccessError ... at com.fasterxml.jackson.module.afterburner.deser.BeanPropertyMutator.
Read more >[#DRILL-6595] IllegalAccessError: tried to access field org ...
IllegalAccessError reported in drillbit.out file Apache Drill 1.14.0 ... 2018 1:33:39 PM com.fasterxml.jackson.module.afterburner.deser.
Read more >Developers - IllegalAccessError with Jackson Afterburner -
Coming soon: A brand new website interface for an even better experience!
Read more >Afterburner 0.7.0 - dropwizard-user@googlegroups.com
IllegalAccessError, message=tried to access field com.mega.config. ... not sure about the specifics of jackson and afterburner, but mvn exclusion
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cemo looks like they released version of azure sdk removing this for JDK16+… so is your issue “solved”
Yes that will go down in flames I’m pretty sure in Java 17 now that all such access is restricted without add-opens. We ourselves experiences weird issues as early as Java 10, hence we removed it and paid the performance price (sigh).