You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
When upgrading our component to Java 11 we started seeing an illegal access warning show up for Jackson-databind.
Version information
Which Jackson version(s) was this for?
jackson-databind-2.15.0-rc2 was the latest but we were on version jackson-databind-2.13.4.2 with the same issue.
To Reproduce
If you have a way to reproduce this with:
WARNING: Illegal reflective access by com.fasterxml.jackson.databind.util.ClassUtil (file:/Users/****/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.15.0-rc2/jackson-databind-2.15.0-rc2.jar) to field java.util.logging.Handler.errorManager
at com.fasterxml.jackson.databind.util.ClassUtil.checkAndFixAccess(ClassUtil.java:995)
at com.fasterxml.jackson.databind.introspect.AnnotatedMember.fixAccess(AnnotatedMember.java:139)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.fixAccess(BeanPropertyWriter.java:439)
at com.fasterxml.jackson.databind.ser.BeanSerializerBuilder.build(BeanSerializerBuilder.java:211)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanOrAddOnSerializer(BeanSerializerFactory.java:473)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanOrAddOnSerializer(BeanSerializerFactory.java:295)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:240)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:174)
at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1507)
at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1455)
at com.fasterxml.jackson.databind.SerializerProvider.findContentValueSerializer(SerializerProvider.java:789)
at com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap.findAndAddSecondarySerializer(PropertySerializerMap.java:90)
at com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer._findAndAddDynamic(ObjectArraySerializer.java:340)
at com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer.serializeContents(ObjectArraySerializer.java:250)
at com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer.serialize(ObjectArraySerializer.java:214)
at com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer.serialize(ObjectArraySerializer.java:23)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer.serializeContents(ObjectArraySerializer.java:253)
We found that our ObjectMapper was using mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);(Which is Deprecated). We upgraded the Deprecated code and still ran into the same issue. The only way to stop the warning was to add: spring: jackson: mapper: SORT_PROPERTIES_ALPHABETICALLY: true Globally to our Application.yml file.
Expected behavior
If reproduction itself needs further explanation, you may also add more details here.
No illegal reflective access warning
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@DylanTheDeveloper problem here is that this does not indicate which Java class is being the problem -- ClassUtil will try to force access, and that's what is designed to do. But some target class is not opening access: if it's a JDK class there may be need for Jackson change; if it's app POJO then it's up to developers to give more access (or use annotations or so on).
So more information would be needed; discussion @pjfanning referenced may be of help.
Describe the bug
A clear and concise description of what the bug is.
When upgrading our component to Java 11 we started seeing an illegal access warning show up for Jackson-databind.
Version information
Which Jackson version(s) was this for?
jackson-databind-2.15.0-rc2 was the latest but we were on version jackson-databind-2.13.4.2 with the same issue.
To Reproduce
If you have a way to reproduce this with:
We found that our ObjectMapper was using mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);(Which is Deprecated). We upgraded the Deprecated code and still ran into the same issue. The only way to stop the warning was to add:
spring: jackson: mapper: SORT_PROPERTIES_ALPHABETICALLY: true
Globally to our Application.yml file.Expected behavior
If reproduction itself needs further explanation, you may also add more details here.
No illegal reflective access warning
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: