问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
at java.lang.reflect.Method.getDefaultValue(Method.java:612) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_171]
at java.lang.Class.createAnnotationData(Class.java:3521) ~[na:1.8.0_171]
at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_171]
at java.lang.Class.getDeclaredAnnotations(Class.java:3477) ~[na:1.8.0_171]
at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:454) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.isKnownEmpty(AnnotationsScanner.java:492) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.annotation.TypeMappedAnnotations.from(TypeMappedAnnotations.java:251) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.annotation.MergedAnnotations.from(MergedAnnotations.java:351) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.annotation.MergedAnnotations.from(MergedAnnotations.java:330) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:86) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.type.StandardAnnotationMetadata.from(StandardAnnotationMetadata.java:175) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.core.type.AnnotationMetadata.introspect(AnnotationMetadata.java:127) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition.<init>(AnnotatedGenericBeanDefinition.java:58) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.doRegisterBean(AnnotatedBeanDefinitionReader.java:253) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:147) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:137) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:157) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:136) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:128) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.load(SpringApplication.java:691) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:392) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at com.example.ProviderTicketApplication_8001.main(ProviderTicketApplication_8001.java:15) [classes/:na]
我的解答思路和尝试过的方法
网上说是缺mybatis-spring-boot-starter依赖,删除重下也没用