-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
FIX: TypeManager initialization fails, if Jackson is not on class path #3149
Conversation
if (mapper.markerAnnotation() != null) { | ||
return mapper; | ||
} else { | ||
log.log(System.Logger.Level.WARNING, "Not using {0}, because markerAnnotation is null", mapper.getClass().getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better message would be to simply say that Jackson is missing on class path. Nobody knows what "markerAnnotation is null" actually means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnehlmeier thanks for feedback. Do you think this message is OK now? While there isn't an alternative to jackson at the moment, I didn't want to refer to it too directly. See #2564
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would keep it specific as long as only a single implementation is supported. Alternative would be a link to documentation but I think there is no page that describes json configuration for ebean.
… is not on class path
The better fix is to include Jackson on the class path as a dependency of |
@rbygrave yes, adding jackson to ebean-jackson-mapper would also be an acceptable solution for me. |
This PR - #3250 ... includes Jackson-core and Jackson-databind as transitive dependencies. |
I think that means we should close this issue. I'll close it, re-open if needed. |
If
ebean-jackson-mapper
but no jackson is on classpath, it can happen, that the service-loader finds theScalarJsonJacksonMapper
class, and ebean thinks, there is a jsonMapper, but when trying to calljsonMapper.markerAnnotation()
you'll get aNoClassDefFoundError
This PR checks on initialization, if the markerAnnotation is accessible.