2017-02-22 16 views
2

У меня есть приложение Spring Boot, которое я обновляю до 1.5.1. Он отлично работает, пока я не добавить Сыщик и Зипкин к пути к классамприложение не запускается при добавлении сыщика и zipkin

<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-sleuth</artifactId> 
    </dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-sleuth-zipkin</artifactId> 
</dependency> 

, когда эти строки присутствуют, я получаю

2017-02-22 22:33:05.331 ERROR [chathub-api,,,] 7581 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean 

Это мой отд. Управление

<dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.springframework.cloud</groupId> 
       <artifactId>spring-cloud-dependencies</artifactId> 
       <version>Camden.SR4</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

Я попытался изменения в Dalston

<dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.springframework.cloud</groupId> 
       <artifactId>spring-cloud-dependencies</artifactId> 
       <version>Dalston.BUILD-SNAPSHOT</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <repositories> 
     <repository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/libs-snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 

но ошибки получить еще страннее

*************************** 
APPLICATION FAILED TO START 
*************************** 

Description: 

Parameter 0 of method envInfoContributor in org.springframework.boot.actuate.autoconfigure.InfoContributorAutoConfiguration required a bean of type 'org.springframework.core.env.ConfigurableEnvironment' that could not be found. 

и

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'traceWebFilter' defined in class path resource [org/springframework/cloud/sleuth/instrument/web/TraceWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'traceWebFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'traceFilter' defined in class path resource [org/springframework/cloud/sleuth/instrument/web/TraceWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'traceFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sleuthTracer' defined in class path resource [org/springframework/cloud/sleuth/autoconfig/TraceAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sleuthTracer' parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zipkinSpanListener' defined in class path resource [org/springframework/cloud/sleuth/zipkin/ZipkinAutoConfiguration.class]: Unsatisfied dependency expressed through method 'zipkinSpanListener' parameter 2; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.env.Environment' available: expected at least 1 bean which qualifies as autowire candidate. Dependenc... 

я упускаю что-то я не заметил все же?

ответ

3

Я не могу объяснить, что вы получили с Dalston.BUILD-SNAPSHOT, но ошибка с Camden.SR4 заключается в том, что она несовместима с Spring Boot 1.5. Я бы рекомендовал перейти на Camden.SR5 which is compatible with Spring Boot 1.5.

+0

извините, такая же ошибка еще: 'Нет квалификационного компонента типа 'org.springframework.core.env.Environment'. Забавно, что в http://projects.spring.io/spring-cloud/ в разделе быстрого запуска, если я выбираю Camdem.SR5, он изменяет версию SB на 1.4.4.RELEASE, что может вызвать некоторую путаницу. Является ли сайт устаревшим? –

1

Даже я получил эту ошибку при настройке моего проекта. Я использовал Spring boot 1.5.8 с выпуском Brixton.SR6. Однако, когда я консультировался с сайтом http://projects.spring.io/spring-cloud/, я узнал об этой проблеме, и я обновил свою зависимость до Dalston.SR4, а затем приложение начало работать.

Смежные вопросы