2017-09-28 2 views
0

그것은 클라우드 스트림 프로젝트에 특정 단 2 라이브러리와 매우 간단 구현 될 것으로 보인다하지만 프로젝트
java.lang.ClassNotFoundException: org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter봄 부팅 : 봄 클라우드 스트림 카프카 구현

모든 종속성을 얻고 것은 다음과 같습니다

compile(
    "org.springframework.boot:spring-boot-starter-web", 
    "org.springframework.boot:spring-boot-starter-actuator", 
    "org.springframework.boot:spring-boot-starter-data-rest", 
    "org.springframework.boot:spring-boot-starter-data-jpa", 
    "org.springframework.boot:spring-boot-starter-security", 
    "org.springframework.boot:spring-boot-starter-amqp", 
    "org.springframework.cloud:spring-cloud-stream", 
    "org.springframework.cloud:spring-cloud-starter-stream-kafka", 
    "org.postgresql:postgresql:9.4.1212.jre7", 
    "org.projectlombok:lombok:1.16.14", 
    "io.jsonwebtoken:jjwt:0.7.0", 
    "org.flywaydb:flyway-core:4.2.0" 
    ) 

클라우드 스트림 구성 :

spring.application.name=services 
spring.stream.bindings.output.destination=appTopic 
spring.stream.bindings.output.content-type=application/json 
spring.stream.bindings.kafka.binder.zkNodes=${HOST} 
spring.stream.bindings.kafka.binder.brokers=${HOST} 

전체 build.grad 제작 :

buildscript { 
    repositories { 
     mavenCentral() 
     maven { 
      url "https://plugins.gradle.org/m2/" 
     } 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.2.RELEASE") 
     classpath "gradle.plugin.com.boxfuse.client:flyway-release:4.2.0" 
     classpath "io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE" 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'idea' 
apply plugin: 'org.springframework.boot' 
apply plugin: 'org.flywaydb.flyway' 
apply plugin: "io.spring.dependency-management" 

ext { 
    springBootVersion = '1.5.2.RELEASE' 
} 

jar { 
    baseName = 'rest' 
    version = '0.1' 
} 

repositories { 
    mavenCentral() 
} 

dependencyManagement { 
    imports { 
      mavenBom 'org.springframework.cloud:spring-cloud-stream-dependencies:Elmhurst.BUILD-SNAPSHOT' 
    } 
} 

sourceCompatibility = 1.8 
targetCompatibility = 1.8 

dependencies { 
    compile(
    "org.springframework.boot:spring-boot-starter-web", 
    "org.springframework.boot:spring-boot-starter-actuator", 
    "org.springframework.boot:spring-boot-starter-data-rest", 
    "org.springframework.boot:spring-boot-starter-data-jpa", 
    "org.springframework.boot:spring-boot-starter-security", 
    "org.springframework.boot:spring-boot-starter-amqp", 
    "org.springframework.cloud:spring-cloud-stream", 
    "org.springframework.cloud:spring-cloud-starter-stream-kafka", 
    "org.springframework.integration:spring-integration-core", 
    "org.postgresql:postgresql:9.4.1212.jre7", 
    "org.projectlombok:lombok:1.16.14", 
    "io.jsonwebtoken:jjwt:0.7.0", 
    "org.flywaydb:flyway-core:4.2.0" 
    ) 
    testCompile(
    "org.springframework.boot:spring-boot-starter-test", 
    "com.jayway.jsonpath:json-path", 
    "org.flywaydb.flyway-test-extensions:flyway-spring-test:4.2.0", 
    "io.rest-assured:rest-assured:3.0.3" 
    ) 
} 
repositories { 
    maven { 
     url 'https://repo.spring.io/libs-snapshot' 
    } 
} 

답변

0

일치하지 않는 버전이있는 것 ConfigurableCompositeMessageConverter은 Spring Integration 5.0의 새로운 클래스입니다.

어떤 부트 버전을 사용하고 있습니까? 스프링 - 클라우드 스트림 버전은 무엇입니까?

Spring Cloud Stream은 현재 Spring Boot 2.0 스냅 샷과 호환되지 않습니다 (사용중인 경우).

+0

'springBootVersion = '1.5.2.RELEASE'' –

+1

스트림 버전이 너무 새 것처럼 보입니다. 1.2.x 여야합니다. –

0

org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter 봄 통합 5.0에서입니다 :

/** 
* A {@link CompositeMessageConverter} extension with some default {@link MessageConverter}s 
* which can be overridden with the given converters 
* or added in the end of target {@code converters} collection. 
* <p> 
* The default converts are (declared exactly in this order): 
* <ul> 
* <li> {@link MappingJackson2MessageConverter} if Jackson processor is present in classpath; 
* <li> {@link ByteArrayMessageConverter} 
* <li> {@link ObjectStringMessageConverter} 
* <li> {@link GenericMessageConverter} 
* </ul> 
* 
* @author Artem Bilan 
* 
* @since 5.0 
*/ 
public class ConfigurableCompositeMessageConverter extends CompositeMessageConverter { 

당신은 당신이 당신의 응용 프로그램에서 호환 버전을 사용하고 있는지 확인해야한다.

+0

호환되는 버전을 사용하고 있는지 어떻게 확인할 수 있습니까? –

+0

스프링 부트 권장 사항을 따르십시오. 예 : http://start.spring.io/. 'Stream Rabbit' 또는'Stream Kafka'를 선택할 수 있습니다. 그러면 Spring Boot가 적절한 버전을 가져옵니다. 당신은 '1.5.x'를 부팅 할 때 Spring 5 기반 프로젝트를 사용할 수 없습니다. –