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

Issue Found with Spring Auto Reconfiguration with Jackson 2.7.0-RELEASE #69

Closed
Agraham21 opened this issue Mar 22, 2019 · 1 comment
Closed
Assignees

Comments

@Agraham21
Copy link

Hi, I am currently engaged with a customer that has encountered many issues when using Spring Auto Reconfiguration with Jackson. They recently deployed a new release of their application and after the deployment some of their applications throw a incompatible JAR files on the classpath error.

They understand that the class expects a ReferenceTypeSerializer to have a withResolved() method with 5 parameters, which the last parameter is of type JsonInclude.Include but since the release of Jackson 2.9 there is only a withResolved() method with only 4 parameters. Their applications have been using Jackson 2.9.7 for a while without a problem. The customer thought, that maybe the build-pack puts an older version of Jackson on the class path that is incompatible with their Jackson version of 2.9.7. They had then found a new version of Spring Auto Reconfiguration, 2.7.0. This version contains Jackson classes like the ObjectMapper. They also found that these Jackson classes within the 2.7.0 are incompatible with the 2.9.7 release of Jackson, that their applications dependencies uses.

They ended up configuring their own build-pack and changed the spring_auto_reconfiguaration.yml to use version 2.5+ instead of the default 2.+.

@harmenweber
Copy link

Here is the original error message and stacktrace:

2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT java.lang.AbstractMethodError: com.fasterxml.jackson.databind.ser.std.ReferenceTypeSerializer.withResolved(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;Lcom/fasterxml/jackson/databind/util/NameTransformer;Lcom/fasterxml/jackson/annotation/JsonInclude$Include;)Lcom/fasterxml/jackson/databind/ser/std/ReferenceTypeSerializer;
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.std.ReferenceTypeSerializer.createContextual(ReferenceTypeSerializer.java:167)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider.handleSecondaryContextualization(SerializerProvider.java:966)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:546)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.resolve(BeanSerializerBase.java:332)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.SerializerCache.addAndResolveNonTypedSerializer(SerializerCache.java:174)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1290)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:536)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.resolve(BeanSerializerBase.java:332)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.SerializerCache.addAndResolveNonTypedSerializer(SerializerCache.java:197)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1269)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:500)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:698)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:270)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3697)
2019-03-20T09:06:04.47+0100 [APP/PROC/WEB/0] OUT 	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3073)

The exception indicates that there are incompatible Jackson JAR files on the classpath. Further, the line numbers in the stacktrace did not match the Jackson 2.9.7 code we're using. That all indicated that there is another version of Jackson on the classpath.

Then, we noticed that auto-reconfiguration-2.7.0-RELEASE.jar contains Jackson classes. These Jackson classes seem to mess up our classpath.

vtintillier added a commit to vtintillier/java-buildpack-auto-reconfiguration that referenced this issue Jun 4, 2019
To avoid conflicts with Jackson shipped as part of the actual
Cloud Foundry applications.

Fixes cloudfoundry#69.
@nebhale nebhale self-assigned this Jul 17, 2019
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

Successfully merging a pull request may close this issue.

3 participants