org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [H:\IDEAPROJECT\mybatis_plus\target\classes\com\lkyyy\MybatisPlusApplication.class]; nested exception is java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
在我的项目中这个报错判断出是mybatis-plus的问题,原因:导包错误,导的包为
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.4.3</version>
</dependency>
在springboot中应当用
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.3</version>
</dependency>
大意了,,,这种情况可以先检查导包是否正确,然后可能就是jdk版本和框架版本