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

Jackson 2.8+ conflict #80

Closed
kaplanke opened this issue Oct 13, 2019 · 3 comments · Fixed by #82
Closed

Jackson 2.8+ conflict #80

kaplanke opened this issue Oct 13, 2019 · 3 comments · Fixed by #82

Comments

@kaplanke
Copy link

Description:
Embedded Jackson classes causes problems if the target project has jackson core 2.8 or above. The error message is;

java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonGenerator.writeStartObject(Ljava/lang/Object;)V
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:151) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2655) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:355) ~[siddhi-map-json-5.0.4.jar:na]
	at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1442) ~[siddhi-map-json-5.0.4.jar:na]
	at com.netflix.discovery.converters.EurekaJacksonCodec$InstanceInfoSerializer.serialize(EurekaJacksonCodec.java:371) ~[eureka-client-1.9.8.jar:1.9.8]
	at com.netflix.discovery.converters.EurekaJacksonCodec$InstanceInfoSerializer.serialize(EurekaJacksonCodec.java:327) ~[eureka-client-1.9.8.jar:1.9.8]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:468) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:397) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1392) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1120) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:950) ~[jackson-databind-2.9.8.jar:2.9.8]
	at com.netflix.discovery.converters.EurekaJacksonCodec.writeTo(EurekaJacksonCodec.java:221) ~[eureka-client-1.9.8.jar:1.9.8]
	... truncated

Suggested Labels:
jackson conflict

Affected Product Version:
Tested in 5.0.0 and 5.0.4

OS, DB, other environment details and versions:
Windows, Linux

Steps to reproduce:
A spring boot application with @EnableDiscoveryClient annotation which tries to register an Eureka Dİscovery server

Workaround
If there is no standalone packaging for this library, add two java classes and annotation definitons to the target project. (Btw, The same issue also exists in avro mapper).

@suhothayan
Copy link
Contributor

@kaplanke can you help us by proving a test code to reproduce this issue, then we will be able to do the modifications quite fast and release a version for you.

@kaplanke
Copy link
Author

kaplanke commented Nov 3, 2019

Hi,

You can find a sample project at the following repo;
https://github.com/kaplanke/siddhidiscoverytest

The thing is, if your siddhi json mapping dependency comes before the eureka client or any other jackson containing dependency, the conflict occurs.

To run the example please first run the eureka server, (ignore the initial discovery errors, it will connect to itself soon) then run the test.

Regards,
Kemal

@mohanvive
Copy link
Contributor

We have released the siddhi-map-json version 5.0.5, please use it.

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