首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Spring :实现

Spring :实现
EN

Stack Overflow用户
提问于 2017-09-28 15:30:36
回答 2查看 2.6K关注 0票数 0

它似乎是非常简单的实现,只有两个特定于云流项目的库,但我得到了

java.lang.ClassNotFoundException: org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter

项目中的所有依赖项都是:

代码语言:javascript
复制
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"
    )

云流配置:

代码语言:javascript
复制
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.gradle:

代码语言:javascript
复制
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'
    }
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-09-28 16:18:59

您的版本似乎不匹配,ConfigurableCompositeMessageConverter是SpringIntegration5.0中的一个新类。

您使用的是什么引导版本?什么春云流版本?

目前与SpringBoot2.0快照不兼容(如果使用的话)。

票数 0
EN

Stack Overflow用户

发布于 2017-09-28 16:18:41

org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter来自Spring 5.0

代码语言:javascript
复制
/**
 * 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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46473045

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档