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.

IllegalAccessError with Jackson Afterburner

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mikebell90commented, Nov 18, 2021

@cemo looks like they released version of azure sdk removing this for JDK16+… so is your issue “solved”

0reactions
mikebell90commented, Jul 15, 2021

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).

Read more comments on GitHub >

github_iconTop 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 >

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