80端口controller
@PostMapping("/consumer/payment")
public CommonResult creatPayment(@RequestBody Payment payment){
log.info(payment.toString());
log.info("客户端请求8001 插入数据");
return restTemplate.postForObject(PAYMENT_URL + "/payment", payment, CommonResult.class);
}
只导入了依赖mybatis-plus-annotation而没有导入完整的mp
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-annotation</artifactId>
<version>3.5.0</version>
</dependency>
实体类
修改前:
@TableName("payment")
public class Payment implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
Long id;
@TableField(value = "serial")
String serial;
}
问题
调用80端口的creatPayment会导致异常
8001和8002端口导入了完整的mybatis-plus 所以没有出现异常
nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/type/JdbcType] with root cause
java.lang.ClassNotFoundException: org.apache.ibatis.type.JdbcType
解决方法
去掉实体类的@TableField注解
@TableName("payment")
public class Payment implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
Long id;
String serial;
}
参考资料
https://blog.csdn.net/liu346487291/article/details/1262633