骆驼示例找不到org.apache.camel.impl.DefaultComponent [英] Camel example can't find org.apache.camel.impl.DefaultComponent
问题描述
我创建了一个小的Apache Camel示例,但找不到类org.apache.camel.impl.DefaultComponent
. 此处完整的错误日志.
I've created a small Apache Camel example, but it can't find the class org.apache.camel.impl.DefaultComponent
. Here the full error log.
我在搜索中查找了该类.maven.org ,该文件应包含在org.apache.camel:camel-core
中.添加它不能解决我的问题.
此示例出了什么问题?
I've looked the class up on search.maven.org, which says it should be contained in org.apache.camel:camel-core
. Adding it does not solve my problem.
What's wrong in this example?
这是应用程序
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Application.class);
app.setWebApplicationType(WebApplicationType.NONE);
app.run(args);
}
}
和这里的路线.
@Component
public class ZmqRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
//from("stream:in").to("stream:out");
String host = "zmq.devnet.iota.org";
from("zeromq:tcp://" + host + ":5556?socketType=SUBSCRIBE&topics=tx")
.to("stream:out")
.log("${body}");
}
}
最后,这里是build.gradle.kts
plugins {
java
application
id("org.springframework.boot") version "2.1.2.RELEASE"
id("io.spring.dependency-management") version "1.0.6.RELEASE"
}
repositories {
jcenter()
}
application {
mainClassName = "org.example.camel.Application"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(arrayOf("-Xlint:all"))
options.encoding = "UTF-8"
}
dependencies {
val camelVersion = "3.0.0-M1"
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.apache.camel:camel-spring-boot-starter:$camelVersion")
implementation("org.apache.camel:camel-stream-starter:$camelVersion")
//implementation("org.apache.camel:camel-core:$camelVersion")
implementation("org.apache-extras.camel-extra:camel-zeromq:2.22.0") {
exclude(module = "zeromq-scala-binding_2.10")
}
implementation("org.zeromq:jeromq:0.5.0")
testImplementation("junit:junit:4.12")
}
推荐答案
因此,基本上,在查看Camel Core 3.0.0.M1
之后,我发现了
So basically, after looking at Camel Core 3.0.0.M1
, I discovered the .class
file for
org.apache.camel.impl.DefaultComponent
不再存在!
camel-core-3.0.0-M1.jar\org\apache\camel\impl
老实说,这对我来说似乎是个错误,或者与core-zeromq
不兼容.
Honestly it seems like a bug to me, or incompatibility with core-zeromq
.
这篇关于骆驼示例找不到org.apache.camel.impl.DefaultComponent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!