2016-06-16 6 views
0

興味深い問題があり、どこでも解決策を見つけることができませんでした。私は春のクラウドコンサルを私の既存のスプリングブートサービスアプリケーションに統合しようとしています。これまで私が行ってきたのは、春の雲の領事の依存関係を私のPOMに追加することでした。 ゼロ私のサービスアプリケーションの任意のクラスに変更しました。Spring Cloud PulにSpring Cloud Consul依存関係を追加すると、コンパイル後に実行時に例外が発生します

私はもともとクラスを変更しましたが、このエラーが発生し続けました。私はコードで変更された何かがそれを引き起こしたかもしれないと思ったが、それはそうではなかった。それはPOMに追加するだけで私にこのエラーを与えています。明確にするために、私はmvn cleanパッケージを正常にコンパイルすることができますが、エラーは春の起動アプリケーションを実行しようとするときだけです。

私は正確にこのガイドに従っています:http://cloud.spring.io/spring-cloud-consul/私のPOMに依存関係を追加する。ここで

は誤りです:問題になることができるもので

java -jar ./target/app.jar --endpoints.restart.enabled=true --endpoints.shutdown.enabled=true --logging.config=file:./config/logback.xml 
java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.IllegalStateException: Failed to introspect annotations: class org.springframework.cloud.consul.config.ConsulConfigBootstrapConfiguration 
    at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:166) 
    at org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated(AnnotatedElementUtils.java:73) 
    at org.springframework.core.type.StandardAnnotationMetadata.isAnnotated(StandardAnnotationMetadata.java:102) 
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:74) 
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:64) 
    at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:140) 
    at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:127) 
    at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:122) 
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:159) 
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:135) 
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127) 
    at org.springframework.boot.SpringApplication.load(SpringApplication.java:615) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) 
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:125) 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:75) 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:1) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) 
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100) 
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:285) 
    at com.idanalytics.service.ServiceApplication.main(ServiceApplication.java:41) 
    ... 6 more 
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy 
    at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) 
    at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) 
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) 
    at java.lang.Class.createAnnotationData(Class.java:3521) 
    at java.lang.Class.annotationData(Class.java:3510) 
    at java.lang.Class.getAnnotations(Class.java:3446) 
    at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:192) 
    at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:209) 
    at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:162) 
    ... 28 more 

任意のアイデア?私は新しい注釈を追加していません。私のPOMファイルから領事の依存関係を削除すると、アプリケーションは正常に動作します。

編集:ここでは依存関係ツリーが

[INFO] com.internal:test-service:jar:1.0.0-SNAPSHOT 
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.3.RELEASE:compile 
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:1.7.11:compile 
[INFO] | | | \- org.slf4j:slf4j-api:jar:1.7.11:compile 
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.11:compile 
[INFO] | | +- org.slf4j:log4j-over-slf4j:jar:1.7.11:compile 
[INFO] | | \- ch.qos.logback:logback-classic:jar:1.1.3:compile 
[INFO] | |  \- ch.qos.logback:logback-core:jar:1.1.3:compile 
[INFO] | +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile 
[INFO] | \- org.yaml:snakeyaml:jar:1.14:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.3.RELEASE:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.20:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.20:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.20:compile 
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.20:compile 
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.5:compile 
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.5:compile 
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.5:compile 
[INFO] | +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile 
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile 
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile 
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile 
[INFO] | +- org.springframework:spring-web:jar:4.1.6.RELEASE:compile 
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.6.RELEASE:compile 
[INFO] |  \- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.2.3.RELEASE:compile 
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.2.3.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.2.3.RELEASE:compile 
[INFO] | | +- org.aspectj:aspectjrt:jar:1.8.5:compile 
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.5:compile 
[INFO] | +- org.springframework:spring-messaging:jar:4.1.6.RELEASE:compile 
[INFO] | +- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile 
[INFO] | +- org.springframework.integration:spring-integration-core:jar:4.1.2.RELEASE:compile 
[INFO] | | +- org.projectreactor:reactor-core:jar:1.1.6.RELEASE:compile 
[INFO] | | | +- com.goldmansachs:gs-collections:jar:5.1.0:compile 
[INFO] | | | | \- com.goldmansachs:gs-collections-api:jar:5.1.0:compile 
[INFO] | | | +- com.lmax:disruptor:jar:3.2.1:compile 
[INFO] | | | \- io.gatling:jsr166e:jar:1.0:compile 
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.1.1.RELEASE:compile 
[INFO] | +- org.springframework.integration:spring-integration-file:jar:4.1.2.RELEASE:compile 
[INFO] | | \- commons-io:commons-io:jar:2.4:compile 
[INFO] | +- org.springframework.integration:spring-integration-http:jar:4.1.2.RELEASE:compile 
[INFO] | +- org.springframework.integration:spring-integration-ip:jar:4.1.2.RELEASE:compile 
[INFO] | \- org.springframework.integration:spring-integration-stream:jar:4.1.2.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.3.RELEASE:compile 
[INFO] | +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile 
[INFO] | \- org.apache.tomcat:tomcat-jdbc:jar:8.0.20:compile 
[INFO] |  \- org.apache.tomcat:tomcat-juli:jar:8.0.20:compile 
[INFO] +- org.springframework.cloud:spring-cloud-starter-consul-all:jar:1.0.1.RELEASE:compile 
[INFO] | +- org.springframework.cloud:spring-cloud-starter-consul-config:jar:1.0.1.RELEASE:compile 
[INFO] | | +- org.springframework.cloud:spring-cloud-starter-consul:jar:1.0.1.RELEASE:compile 
[INFO] | | | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.RELEASE:compile 
[INFO] | | | +- org.springframework.cloud:spring-cloud-consul-core:jar:1.0.1.RELEASE:compile 
[INFO] | | | +- com.ecwid.consul:consul-api:jar:1.1.10:compile 
[INFO] | | | \- com.google.code.gson:gson:jar:2.3.1:compile 
[INFO] | | +- org.springframework.cloud:spring-cloud-consul-config:jar:1.0.1.RELEASE:compile 
[INFO] | | \- org.springframework.cloud:spring-cloud-context:jar:1.1.0.RELEASE:compile 
[INFO] | \- org.springframework.cloud:spring-cloud-starter-consul-discovery:jar:1.0.1.RELEASE:compile 
[INFO] |  +- org.springframework.cloud:spring-cloud-consul-discovery:jar:1.0.1.RELEASE:compile 
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.1.RELEASE:compile 
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.1.RELEASE:compile 
[INFO] |  | +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile 
[INFO] |  | | \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile 
[INFO] |  | |  \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile 
[INFO] |  | |  \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile 
[INFO] |  | +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.1.RELEASE:compile 
[INFO] |  | | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile 
[INFO] |  | | | \- com.google.code.findbugs:jsr305:jar:3.0.1:runtime 
[INFO] |  | | +- commons-configuration:commons-configuration:jar:1.8:compile 
[INFO] |  | | | \- commons-logging:commons-logging:jar:1.1.1:compile 
[INFO] |  | | \- com.google.guava:guava:jar:18.0:compile 
[INFO] |  | +- com.netflix.ribbon:ribbon:jar:2.2.0:compile 
[INFO] |  | | +- com.netflix.ribbon:ribbon-transport:jar:2.2.0:runtime 
[INFO] |  | | | +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime 
[INFO] |  | | | \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime 
[INFO] |  | | +- com.netflix.hystrix:hystrix-core:jar:1.5.3:runtime 
[INFO] |  | | | \- org.hdrhistogram:HdrHistogram:jar:2.1.7:runtime 
[INFO] |  | | +- javax.inject:javax.inject:jar:1:runtime 
[INFO] |  | | \- io.reactivex:rxnetty:jar:0.4.9:runtime 
[INFO] |  | |  +- io.netty:netty-codec-http:jar:4.0.27.Final:runtime 
[INFO] |  | |  | +- io.netty:netty-codec:jar:4.0.27.Final:runtime 
[INFO] |  | |  | \- io.netty:netty-handler:jar:4.0.27.Final:runtime 
[INFO] |  | |  \- io.netty:netty-transport-native-epoll:jar:4.0.27.Final:runtime 
[INFO] |  | |  +- io.netty:netty-common:jar:4.0.27.Final:runtime 
[INFO] |  | |  +- io.netty:netty-buffer:jar:4.0.27.Final:runtime 
[INFO] |  | |  \- io.netty:netty-transport:jar:4.0.27.Final:runtime 
[INFO] |  | +- com.netflix.ribbon:ribbon-core:jar:2.2.0:compile 
[INFO] |  | | \- commons-lang:commons-lang:jar:2.6:compile 
[INFO] |  | +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.0:compile 
[INFO] |  | | +- commons-collections:commons-collections:jar:3.2.1:runtime 
[INFO] |  | | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime 
[INFO] |  | | +- com.netflix.servo:servo-core:jar:0.10.1:runtime 
[INFO] |  | | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime 
[INFO] |  | | \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime 
[INFO] |  | +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.0:compile 
[INFO] |  | | \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime 
[INFO] |  | \- io.reactivex:rxjava:jar:1.1.5:compile 
[INFO] |  \- joda-time:joda-time:jar:2.5:compile 
[INFO] +- mysql:mysql-connector-java:jar:5.1.6:compile 
[INFO] +- org.springframework.cloud:spring-cloud-config-client:jar:1.0.0.RELEASE:compile 
[INFO] | \- org.springframework.security:spring-security-crypto:jar:3.2.7.RELEASE:compile 
[INFO] +- com.internal:rest-utility:jar:1.0.3:compile 
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.3.2:compile 
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.1:compile 
[INFO] | \- commons-codec:commons-codec:jar:1.6:compile 
[INFO] +- org.springframework:spring-jms:jar:4.1.6.RELEASE:compile 
[INFO] | +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile 
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile 
[INFO] | +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile 
[INFO] | \- org.springframework:spring-context:jar:4.1.6.RELEASE:compile 
[INFO] +- org.springframework.integration:spring-integration-jms:jar:4.1.2.RELEASE:compile 
[INFO] +- com.swiftmq:springsupport:jar:9.0.0:compile 
[INFO] +- javax.jms:jms-api:jar:1.1-rev-1:compile 
[INFO] +- com.swiftmq:swiftmq:jar:9.0.0:compile 
[INFO] +- org.apache.commons:commons-lang3:jar:3.4:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.2.3.RELEASE:test 
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test 
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test 
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test 
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test 
[INFO] | \- org.springframework:spring-test:jar:4.1.6.RELEASE:test 
[INFO] +- com.internal:keystore-client:jar:2.46.0:compile 
[INFO] | +- com.sun.jersey:jersey-client:jar:1.19.1:compile 
[INFO] | | \- com.sun.jersey:jersey-core:jar:1.19.1:compile 
[INFO] | |  \- javax.ws.rs:jsr311-api:jar:1.1.1:compile 
[INFO] | +- com.sun.jersey:jersey-json:jar:1.7:compile 
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.1:compile 
[INFO] | | | \- stax:stax-api:jar:1.0.1:compile 
[INFO] | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile 
[INFO] | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile 
[INFO] | | |  +- javax.xml.stream:stax-api:jar:1.0-2:compile 
[INFO] | | |  \- javax.activation:activation:jar:1.1:compile 
[INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.7.1:compile 
[INFO] | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.7.1:compile 
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.7.1:compile 
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.7.1:compile 
[INFO] | +- net.iharder:base64:jar:2.3.8:compile 
[INFO] | +- commons-pool:commons-pool:jar:1.6:compile 
[INFO] | \- log4j:log4j:jar:1.2.17:compile 
[INFO] +- junit:junit:jar:4.12:test 
[INFO] \- org.mockito:mockito-all:jar:1.10.19:test 

EDITです:私は1.3.5に私のMavenプラグインで指定されたバージョンを変更し、現在は別のエラーを取得しています。ここに私のPOMは、次のとおりです。

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <groupId>com.internal</groupId> 
     <artifactId>service-parent</artifactId> 
     <version>1.0.4</version> 
    </parent> 
    <artifactId>testSVC</artifactId> 
    <groupId>com.internal</groupId> 
    <version>1.0.0-SNAPSHOT</version> 
    <name>Test Service</name> 
    <description>My first service</description> 
    <properties> 
     <main.basedir>${basedir}/../..</main.basedir> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-actuator</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-integration</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-jdbc</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-consul-all</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <version>5.1.6</version> 
      <!-- <scope>runtime</scope> --> 
     </dependency>   
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-config-client</artifactId> 
      <version>${spring-cloud-config-ga}</version> 
     </dependency> 

     <dependency> 
      <groupId>com.internal</groupId> 
      <artifactId>rest-utility</artifactId> 
      <version>[1.0.0,1.0.99)</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
      <version>4.3.2</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-jms</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.integration</groupId> 
      <artifactId>spring-integration-jms</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.swiftmq</groupId> 
      <artifactId>springsupport</artifactId> 
      <version>${swiftmq-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.jms</groupId> 
      <artifactId>jms-api</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.swiftmq</groupId> 
      <artifactId>swiftmq</artifactId> 
      <version>${swiftmq-version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.commons</groupId> 
      <artifactId>commons-lang3</artifactId> 
      <version>3.4</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 

    </dependencies> 

    <build> 
      <plugins> 
       <plugin> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-maven-plugin</artifactId> 
        <version>1.3.5.RELEASE</version> 
       </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <configuration> 
        <descriptor>src/assembly/bin.xml</descriptor> 
        <finalName>testSVC</finalName> 
       </configuration> 
       <executions> 
        <execution> 
         <phase>package</phase> 
         <goals> 
          <goal>single</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      </plugins> 
    </build> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.springframework.cloud</groupId> 
       <artifactId>spring-cloud-consul-dependencies</artifactId> 
       <version>1.0.1.RELEASE</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

</project> 

新しいエラー:

Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54) 
    ... 1 more 
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/Banner$Mode 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:121) 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:84) 
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:1) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) 
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100) 
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:285) 
    at com.idanalytics.service.ServiceApplication.main(ServiceApplication.java:38) 
    ... 6 more 
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Banner$Mode 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
    at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178) 
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 

答えて

0

あなたは春の2つの異なるバージョンを混合していますか? mvn dependency:treeの出力をここに含めることはできますか?

mvn dependency:treeの出力に基づいて更新が

、私は依存関係org.springframework.cloud:spring-cloud-starter-consul-all:1.0.1.RELEASEを追加すると、通常春ブーツ1.3.5.RELEASEに依存していることがわかりますが、あなたは古い春ブーツ1.2を含むされています。あなたのPOMのバージョンバージョン。

一貫性のある1.3.5.RELEASEバージョンのSpring Bootを使用するようPOMを更新できますか?可能であれば、POM内のSpring BootおよびSpring Frameworkの明示的な依存関係宣言を削除してみて、spring-cloud-starter-consul-allにそれらを含めるようにしてください。

+0

okを追加しました – Seephor

+0

POMと新しいエラーで自分の投稿を更新しました – Seephor

関連する問題