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

WrongMethodTypeException with blackbird #142

Closed
naveg opened this issue Jun 27, 2021 · 5 comments
Closed

WrongMethodTypeException with blackbird #142

naveg opened this issue Jun 27, 2021 · 5 comments
Labels
blackbird Issue related to Blackbird module

Comments

@naveg
Copy link

naveg commented Jun 27, 2021

After upgrading to Java 16 and Jackson 2.12 with Blackbird replacing Afterburner, we are seeing WrongMethodTypeException occur frequently. The strange thing is that this affects only 25-40% of requests. An identical request made repeatedly will fail at that rate.

Example stack trace:

java.lang.invoke.WrongMethodTypeException: expected ()ToIntFunction but found ()ToIntFunction
	at java.base/java.lang.invoke.Invokers.newWrongMethodTypeException(Invokers.java:506)
	at java.base/java.lang.invoke.Invokers.checkExactType(Invokers.java:515)
	at com.fasterxml.jackson.module.blackbird.ser.BBSerializerModifier.createProperty(BBSerializerModifier.java:116)
	at com.fasterxml.jackson.module.blackbird.ser.BBSerializerModifier.lambda$findProperties$0(BBSerializerModifier.java:64)
	at com.fasterxml.jackson.module.blackbird.util.Unchecked.lambda$runnable$0(Unchecked.java:31)
	at com.fasterxml.jackson.module.blackbird.ser.BBSerializerModifier.findProperties(BBSerializerModifier.java:65)
	at com.fasterxml.jackson.module.blackbird.ser.BBSerializerModifier.changeProperties(BBSerializerModifier.java:49)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanOrAddOnSerializer(BeanSerializerFactory.java:407)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanOrAddOnSerializer(BeanSerializerFactory.java:290)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:235)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:169)
	at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1473)
	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1421)
	at com.fasterxml.jackson.databind.SerializerProvider.findContentValueSerializer(SerializerProvider.java:753)
	at com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap.findAndAddSecondarySerializer(PropertySerializerMap.java:90)
	at com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase._findAndAddDynamic(AsArraySerializerBase.java:311)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:115)
	... 74 common frames omitted

This is occuring in a Dropwizard application.

Happy to provide more information as needed, and will continue to dig and update this issue with what I find.

@cowtowncoder cowtowncoder added the blackbird Issue related to Blackbird module label Jun 27, 2021
@cowtowncoder cowtowncoder changed the title WrongMethodTypeException with blackbird WrongMethodTypeException with blackbird Jun 27, 2021
@cowtowncoder
Copy link
Member

cc @stevenschlansker

@stevenschlansker
Copy link
Contributor

This is a strange exception message. ToIntFunction is part of java.base so there should never be more than one...
Do you have a reproducible test case you can share? What does the definition of the type you serialize look like?

@stevenschlansker
Copy link
Contributor

@naveg , a couple more questions: do you use any custom or non-default classloaders, or set the thread context class loader ever?

@stevenschlansker
Copy link
Contributor

@naveg , I would love to help fix this issue, but we will need some more information (some questions above) or ideally a self contained test case showing the issue to dig in - I have never seen an exception like this myself.

@cowtowncoder
Copy link
Member

Cannot reproduce, no more info added, closing. May be reopened/refiled with necessary info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blackbird Issue related to Blackbird module
Projects
None yet
Development

No branches or pull requests

3 participants