logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

fastjson:default constructor not found. class(JSON反序列化需要构造函数)

先说原因:JSON反序列化需要public构造函数。注意:一般来说:private,默认,protect,这些访问控制类型的构造函数创建对象比较苛刻,要么在源代码的同包路径,要么是其子类才可以创建,通常JSON反序列化的时候并不能满足这种条件。说明如下:2019.10.11更新纠正如下:json的反序列化需要无参构造(private,public都可以)正...

@ConditionalOnProperty注解

简单来讲,总结一下,在类上添加此注解基本配置为app.name = tom配置类为@ConditionalOnProperty(prefix = "app",name="name",matchIfMissing =false)@Configurationpublic class ConfigureOne {public ConfigureOne() {System.out.println("---

Correct the classpath of your application so that it contains compatible versions of the classes org

解决办法一般这种错误都是重复引入包了,看具体报错的是哪个类,把这个依赖注释掉比如我的完整报错是:Correct the classpath of your application so that it contains compatible versions of the classes org.hibernate.validator.internal.xml.config.ValidationB

#java#intellij-idea#spring
@NotNull注解不生效

进行参数校验的时候,加了@NotNull注解,@Validated注解和@Valid注解,但是参数校验的时候不生效。最后发现是因为我的Spring-boot版本较高,后面不需要引入validation-api,hibernate-validator这种依赖,直接引入spring-boot-starter-validation即可,其他的依赖都可以去掉了<dependency><g

#java#spring#spring boot
@ConditionalOnProperty注解

简单来讲,总结一下,在类上添加此注解基本配置为app.name = tom配置类为@ConditionalOnProperty(prefix = "app",name="name",matchIfMissing =false)@Configurationpublic class ConfigureOne {public ConfigureOne() {System.out.println("---

暂无文章信息