default constructor not found 异常解决方法

简介: default constructor not found 异常解决方法
Exception in thread "Thread-13" com.alibaba.fastjson.JSONException: default constructor not found. class com.nowcoder.async.EventModel
  at com.alibaba.fastjson.util.JavaBeanInfo.build(JavaBeanInfo.java:212)
  at com.alibaba.fastjson.parser.ParserConfig.createJavaBeanDeserializer(ParserConfig.java:504)
  at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:451)
  at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:306)
  at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:611)
  at com.alibaba.fastjson.JSON.parseObject(JSON.java:327)
  at com.alibaba.fastjson.JSON.parseObject(JSON.java:231)
  at com.alibaba.fastjson.JSON.parseObject(JSON.java:444)
  at com.nowcoder.async.EventConsumer.lambda$afterPropertiesSet$0(EventConsumer.java:72)
  at java.lang.Thread.run(Thread.java:745)

在指定类添加默认构造函数即可

这是因为spring底层都是通过反射机制,必须有默认构造器来创建对象,设置好属性

目录
相关文章
|
6月前
|
前端开发
Error in created hook: “TypeError: _test.default is not a function
Error in created hook: “TypeError: _test.default is not a function
|
7月前
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
‘;‘ expected,Missing semicolon.Syntax Missing semicolon multi (web,若依定义方法,修改method,之后在mounted()用this
‘;‘ expected,Missing semicolon.Syntax Missing semicolon multi (web,若依定义方法,修改method,之后在mounted()用this
|
Java 数据库连接 Redis
Bean method ‘redisConnectionFactory‘ not loaded because @ConditionalOnClass did not find required c
Bean method ‘redisConnectionFactory‘ not loaded because @ConditionalOnClass did not find required c
122 0
|
Java 编译器 Spring
报错:No fallback instance of type class**解决办法
报错:No fallback instance of type class**解决办法
1149 0
报错:No fallback instance of type class**解决办法
|
Java API Spring
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found
|
JavaScript 前端开发 开发者
Component name “xxx“ should always be multi-word
Component name “xxx“ should always be multi-word
Component name “xxx“ should always be multi-word
解决办法:ImportError: 'module' object has no attribute 'check_specifier'
解决办法:ImportError: 'module' object has no attribute 'check_specifier'
151 0
Unknown run configuration type AndroidRunConfigurationType的解决办法
Unknown run configuration type AndroidRunConfigurationType的解决办法
115 0
【Junit 报错】Test class should have exactly one public zero-argument constructor和Test class can only have one constructor
错误1: 1 java.lang.Exception: Test class should have exactly one public zero-argument constructor 2 at org.
6172 0