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

Problems with Fasterxml 2.10.0 and Springboot 2.2.1 #20

Closed
ksinkar opened this issue Dec 15, 2019 · 11 comments
Closed

Problems with Fasterxml 2.10.0 and Springboot 2.2.1 #20

ksinkar opened this issue Dec 15, 2019 · 11 comments

Comments

@ksinkar
Copy link

ksinkar commented Dec 15, 2019

I cannot use Faker with my latest Springboot project (2.2.1.RELEASE)

java.lang.NoSuchMethodError: com.fasterxml.jackson.module.kotlin.KotlinModule.<init>(IZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V

	at io.github.serpro69.kfaker.Mapper.<clinit>(Mapper.kt:12)
	at io.github.serpro69.kfaker.FakerService.readCategory(FakerService.kt:121)
	at io.github.serpro69.kfaker.FakerService.load(FakerService.kt:65)
	at io.github.serpro69.kfaker.FakerService.<init>(FakerService.kt:30)
	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:13)
	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:12)

I fixed it by upgrading fasterxml to 2.10.1.

@ksinkar ksinkar changed the title Problems with Fasterxml 2.10.x and Springboot 2.2.1 Problems with Fasterxml 2.10.0 and Springboot 2.2.1 Dec 15, 2019
@serpro69
Copy link
Owner

This could be caused by differences in 2.10.0 and 2.10.1

I've had the "need to fix dependencies" thought in the back of my head for awhile now (probably using the shadow plugin), but didn't have time as of late to add this. Feel free to submit a PR if you want.

For now upgrading your dependency seems like the best workaround. Else you can also try to exclude jackson-module-kotlin from faker's dependencies.

@serpro69 serpro69 mentioned this issue Feb 6, 2020
@rpmoore
Copy link

rpmoore commented Apr 29, 2020

I'm also encountering the same issue but with Jackson 2.11. Exact same stack trace.

@serpro69
Copy link
Owner

serpro69 commented Apr 30, 2020

What springboot version are you using @rpmoore ? Will try to reproduce it.

@rpmoore
Copy link

rpmoore commented Apr 30, 2020

We're not using spring. I also tried down reving Jackson to 2.10.1 and that didn't resolve the issue. I can play with some of the other dependencies to see what it is.

@rpmoore
Copy link

rpmoore commented May 1, 2020

Doing a little digging I found this issue FasterXML/jackson-module-kotlin#279

Seems like if you update to 2.10.2 that should resolve some of the issues going forward.

@serpro69
Copy link
Owner

serpro69 commented May 1, 2020

Thanks for digging that up @rpmoore Will update all of the dependencies and push the change on the weekend. Hopefully that will help.
I've also tried shading the dependencies, but there's no documentation on using gradle shade plugin with kotlin-dsl syntax, so that's still in progress.

@serpro69
Copy link
Owner

serpro69 commented May 1, 2020

@rpmoore please check if faker version 1.1.2 fixes it. I've bumped jackson dependencies to 2.11.0

@rpmoore
Copy link

rpmoore commented May 4, 2020

I'll give it a try today and let you know.

@rpmoore
Copy link

rpmoore commented May 6, 2020

That seemed to do the trick for me! I can run my tests without issue now.

@serpro69
Copy link
Owner

serpro69 commented May 7, 2020

Great, thanks for confirming @rpmoore
Closing this for now. @ksinkar feel free to reopen if this is not fixed for you.

@serpro69 serpro69 closed this as completed May 7, 2020
@rpmoore
Copy link

rpmoore commented May 8, 2020

Yeah, it's working like a champ now. This has been super helpful!

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

3 participants