错误:
org.springframework.amqp.rabbit.support.ListenerExecutionFailedException: Listener threw exception
Caused by: org.springframework.amqp.support.converter.MessageConversionException: Failed to convert Message content
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of xxx
org.springframework.amqp.AmqpRejectAndDontRequeueException: Error Handler converted exception to fatal
原因:
因为在Bean对象中只有全参构造,没有无参构造
加上无参构造就解决了
public Student() { }
public Student(String name, String age, String gender) {
this.name = name;
this.age = age;
this.gender = gender;
}