Skip to content
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

Jackon Afterburner Module Registration Prevents Package Property Deserialization #1145

Closed
gilbode opened this issue Jun 29, 2015 · 4 comments

Comments

@gilbode
Copy link

gilbode commented Jun 29, 2015

Dropwizard registers the jackson Afterburner module but doesn't give any way to customize its configuration. The Afterburner module provides the property _cfgUseValueClassLoader which can be set so that afterburner can deserialize protected / package visible properties. We've got some classes with package visible properties and when we try to serialize/deserialize them we get all sorts of warnings like below:

WARNING: Disabling Afterburner serialization for type class MyClass, field #1, due to access error (type java.lang.IllegalAccessError, message=mypackage/MyClass)
17:41:19.071 [ERROR] [system.err]
17:41:19.071 [ERROR] [system.err] java.lang.IllegalAccessError: mypackage/MyClass

Seems that dropwizard should either allow end users to control whether the after burner module is loaded or not via configuration and/or allow setting of its configuration properties.

@nickbabcock
Copy link
Contributor

I did some digging and according to the documentation, the property should be on by default. And Dropwizard doesn't change that configuration. I'm curious how this error comes about.

@arteam
Copy link
Member

arteam commented Jun 30, 2015

In the upcoming 0.9.0 there will be support for setting a custom ObjectMapper without the Afterburner module during the bootstrap phase of an application. See #1112.

@gilbode
Copy link
Author

gilbode commented Jun 30, 2015

Thanks for looking into this, I'm wondering if maybe the afterburner module was not the culprit. I was running my app from gradle where the classpath consisted of jar files in the local cache, directories etc. (i.e. different code sources).

When we build our app we create a single JAR file and the warnings go away. I had suspected it was due to the afterburner settings done by dropwizard but wonder if there is some further limitation of having multiple code sources. It isn't immediately obvious to me what is actually causing the issue however. All of my application classes are in a single directory code source on the classpath at the time I was encountering the error.

@carlo-rtr
Copy link
Member

Sounds like we can close this one. Thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants