java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotat

java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotat

在做Spring项目时会发生这种BUG通常情况下是因为spring-context和spring-core版本不一致导致的,也就是说版本冲突导致jar包冲突


问题描述:

```c Caused by: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(Ljava/lang/annotation/Annotation;)Z at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:209) at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:162) ... 60 more 一月 14, 2019 8:49:59 下午 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet /firstweb threw load() exception java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(Ljava/lang/annotation/Annotation;)Z at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:209) at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:162) at org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes(AnnotatedElementUtils.java:91) at org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes(AnnotatedElementUtils.java:85) at org.springframework.transaction.annotation.SpringTransactionAnnotationParser.parseTransactionAnnotation(SpringTransactionAnnotationParser.java:42) at org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.determineTransactionAttribute(AnnotationTransactionAttributeSource.java:154) at org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.findTransactionAttribute(AnnotationTransactionAttributeSource.java:133) } ```

原因分析:

Spring核心和context版本不一致导致的jar包冲突,也可以理解为未找到该类错误


解决方案:

在pom.xml配置文件中将spring-core和spring-context版本设置成一样的;

你可能感兴趣的:(java)