我的代码编译没有问题,但是当我尝试运行我的Jar文件时,在堆栈跟踪中出现了以下错误:
java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.stream.config.codec.kryo.KryoCodecAutoConfiguration
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.stream.config.ChannelBindingAutoConfiguration] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@439f5b3d]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/endpoint/AbstractEndpoint
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.AbstractEndpoint
我已经在我的pom.xml中添加了actuator作为一个依赖项。以下是所有的依赖项:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
我错过了什么吗?这可能是因为我正在使用的Spring Boot版本导致的吗?
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
我也想了解这个执行器是从哪里出现在画面中的,因为我在这个虚拟项目中只有两个类。
package demo.example.jobIDProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.integration.annotation.Transformer;
@EnableBinding(Processor.class)
@SpringBootApplication
public class JobIDProcessorApplication {
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
public String fetchJD(String jobID) {
return "ye raha JD of "+jobID;
}
public static void main(String[] args) {
SpringApplication.run(JobIDProcessorApplication.class, args);
}
}
并且以下内容
package demo.example.jobIDProcessor;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.integration.annotation.Transformer;
@EnableBinding(Processor.class)
public class JobIDProcessorConfig {
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
public String fetchJD(String jobID) {
return "ye raha JD of "+jobID;
}
}
这个 "org/springframework/boot/actuate/endpoint/AbstractEndpoint" 是从哪里调用的?
spring-boot-starter-web
,以便通过HTTP访问Actuator端点。 - Sabby AnandanKryoCodecAutoConfiguration
在Spring Cloud Stream 2.0中已经不存在了;它曾经在1.3.x版本中出现 - 不确定为什么您的堆栈跟踪中出现了它。 2)您似乎正在使用Rabbit binder,但您还有KStreams库 - 为什么您不能直接使用KStream binder呢? - Sabby Anandanjava -jar ...
单独运行成功,它也将在SCDF中正常工作。 - Sabby Anandan