SpringBoot2.x整合SpringCloud@EnableEurekaServer报错sun.reflect.annotation.TypeNotPresentExceptionProxy

报错信息:

Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
	at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) ~[na:1.8.0_144]
	at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) ~[na:1.8.0_144]
	at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) ~[na:1.8.0_144]
	at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) ~[na:1.8.0_144]
	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_144]
	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_144]
	at java.lang.Class.createAnnotationData(Class.java:3521) ~[na:1.8.0_144]
	at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_144]
	at java.lang.Class.getDeclaredAnnotations(Class.java:3477) ~[na:1.8.0_144]

在使用springBoot2.x整合SpringCloud的Eureka时,使用注解@EnableEurekaServer的服务总是启动报错:sun.reflect.annotation.TypeNotPresentExceptionProxy,解决方法很简单,在pom里面添加依赖就可以了。

 <dependency>
     <groupId>org.springframework.cloudgroupId>
     <artifactId>spring-cloud-contextartifactId>
 dependency>

你可能感兴趣的:(Spring,Cloud,eureka,spring,cloud,spring,boot)