尝试构建可执行的 Spring Boot jar 时出错

问题描述 投票:0回答:2

我只是尝试基于 Joel 示例使用 Spring Boot 构建一个可执行 jar https://github.com/joeldudleyr3/spring-observable-stream,但我收到以下错误:

exception is java.lang.NoSuchMethodError: org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration.getDefaultRoutingType()Lorg/apache/activemq/artemis/api/core/RoutingType;

在这行代码中:

CordaRPCClient(rpcAddress).start(username, password)

Obs.:通过 JavaExec 任务调用它完美地工作。

corda activemq-artemis
2个回答
1
投票

这是一个罐子问题。没有这个方法。此方法已移动,查找包名称为:org.apache.activemq.artemis 的 jar。在客户端和公共端。这里不确定,但这就是罪魁祸首,你要么选择 1.X 版,要么选择 2.X 版,只需检查哪个版本有此方法。 在你的 gradle 文件中强制编译到客户端和通用版本 2.X,你就可以开始了。


1
投票

我通过将以下内容添加到我的

build.gradle
文件的
dependencies
块来修复此问题:

dependencies {

    ...

    compile "org.apache.activemq:artemis-commons:2.0.0"
    compile "org.apache.activemq:artemis-core-client:2.0.0"

    ...

}
© www.soinside.com 2019 - 2024. All rights reserved.