错误提示:
Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.renren.modules.sys.dao.excelDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
解决办法:应为dao层缺少注解@Mapper导致的
错误提示:
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table 'renren_security.excel_entity' doesn't exist
### The error may exist in io/renren/modules/sys/dao/excelDao.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT name,sex,birthday FROM excel_entity
### Cause: java.sql.SQLSyntaxErrorException: Table 'renren_security.excel_entity' doesn't exist
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table 'renren_security.excel_entity' doesn't exist
解决办法:在没有给entity 注入table_name(),注解时。是不是默认去找实体名_entity.
错误提示:
Cause: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
原因分析:数组越界导致。
Error querying database. Cause: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
原因分析:idex:3 表示的是第三个构造函数参数出现问题。我的是多写了一个参数,
在百度中也会有应为没有提供构造函数出现的同样的问题(@data 注解没不会添加构造函数)。如果项目中使用了mybatisplus和lombok ,
**解决:**在实体类中添加注解:@AllArgsConstructor //全参构造函数
@NoArgsConstructor //无参构造函数
No validator could be found for constraint 'javax.validation.constraints.NotBlank'
validating type '
**原因分析:**项目中使用的校验注解所支持的数据类型与实体中字段的类型不符合。
例如:
在Integer类型的字段上使用@NotEmpty,@NotEmpty支持的是字符串类型字段,这样子使用肯定是会报错的。
错误提示:
**原因分析:**在RequstMapping中存在两个同名的value
错误信息:
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.context.ApplicationContextException: Unable to
start web server; nested exception is
org.springframework.boot.web.server.WebServerException: Unable to
start embedded Tomcat
**原因分析:**包冲突,可能是poml文件有问题