-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
MissingKotlinParameterException getting lost in ErrorHandler #2306
Comments
That's a bug in Kotlin; all exceptions (subclasses of public class Throwable implements Serializable { This means that a class with non- * When traversing a graph, an object may be encountered that does not
* support the Serializable interface. In this case the
* NotSerializableException will be thrown and will identify the class
* of the non-serializable object. <p>
*
* Classes that require special handling during the serialization and
* deserialization process must implement special methods with these exact
* signatures:
*
* <PRE>
* private void writeObject(java.io.ObjectOutputStream out)
* throws IOException
* private void readObject(java.io.ObjectInputStream in)
* throws IOException, ClassNotFoundException;
* private void readObjectNoData()
* throws ObjectStreamException;
* </PRE>
*
... See the full javadoc for As a work around, you could write your own version of But, the best track is to get Kotlin to fix its bug. |
However, I think we can improve the error message to include the original error message. |
Resolves spring-projects#2306 Include the original exception message in the `DeserializationException.cause` when the original exception could not be serialized. **cherry-pick to 2.9.x, 2.8.x**
Resolves spring-projects#2306 Include the original exception message in the `DeserializationException.cause` when the original exception could not be serialized. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2306 Include the original exception message in the `DeserializationException.cause` when the original exception could not be serialized. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2306 Include the original exception message in the `DeserializationException.cause` when the original exception could not be serialized. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2306 Include the original exception message in the `DeserializationException.cause` when the original exception could not be serialized. **cherry-pick to 2.9.x, 2.8.x**
In what version(s) of Spring for Apache Kafka are you seeing this issue?
2.8.6
Describe the bug
When handling deserialization errors jackson+kotlin is giving this very helpful Exception
which tells me exactly what JSON is tried and which property in which class did not work/is missing. Debugging has never been easier.
This is the exception that is catched in org.springframework.kafka.support.serializer.JsonDeserializer#deserialize and wrapped into a org.apache.kafka.common.errors.SerializationException
Later this exception is handled in org.springframework.kafka.support.serializer.SerializationUtils#deserializationException where it is tried to be serialized into an ObjectOutputStream
Unfortunately MissingKotlinParameterException contains an object of kotlin.reflect.jvm.internal.KParameterImpl which is not Serializable.
So in the end all I get in my error queue added as headers kafka_dlt-exception-message and kafka_dlt-exception-stacktrace is that the error handler failed to serialize that error:
which is not in any way helpful for debugging the faulty JSON.
To Reproduce
Expected behavior
Helpful information from the exception should not be lost.
Sample
KafkaConfguration:
Consume:
application.yml
The text was updated successfully, but these errors were encountered: