使用spring自带的Task,放在服务器上启动时会报错

spring-mvc
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class
Caused by: java.lang.TypeNotPresentException: Type java.lang.annotation.Repeatable not present
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:39)
at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:51)
at java.lang.Class.getDeclaredAnnotations(Class.java:1628)
at java.lang.Class.getAnnotations(Class.java:1589)
at org.springframework.core.type.classreading.AnnotationAttributesReadingVisitor.doVisitEnd(AnnotationAttributesReadingVisitor.java:269)
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:182)
at org.springframework.asm.ClassReader.readAnnotationValues(ClassReader.java:1788)
at org.springframework.asm.ClassReader.readMethod(ClassReader.java:975)
at org.springframework.asm.ClassReader.accept(ClassReader.java:695)
at org.springframework.asm.ClassReader.accept(ClassReader.java:508)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:64)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:82)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:279)
... 37 more
Caused by: java.lang.ClassNotFoundException: java.lang.annotation.Repeatable
at java.lang.Class.forName(Class.java:169)
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:34)
... 50 more

Failed to read candidate component class,这个问题可能是因为你编译后的class出了问题。