一、该问题的重现步骤是什么?
1. 启动blade-xxljob-admin项目报错
二、你期待的结果是什么?实际看到的又是什么?
期望的结果: 启动blade-xxljob-admin成功
实际看到的: 启动blade-xxljob-admin报错
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
BladeX、BladeX-Tool V2.7.0 windows 2016
四、请提供详细的错误堆栈信息,这很重要。
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-25 11:03:10.916 ERROR 3044 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is java.lang.IllegalArgumentException: A default binder has been requested, but there is no binder available
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50)
at com.xxl.job.admin.JobAdminApplication.main(JobAdminApplication.java:14)
Caused by: java.lang.IllegalArgumentException: A default binder has been requested, but there is no binder available
at org.springframework.util.Assert.notEmpty(Assert.java:555)
at org.springframework.cloud.stream.binder.DefaultBinderFactory.doGetBinder(DefaultBinderFactory.java:157)
at org.springframework.cloud.stream.binder.DefaultBinderFactory.getBinder(DefaultBinderFactory.java:140)
at org.springframework.cloud.stream.binding.BindingService.getBinder(BindingService.java:379)
at org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:268)
at org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:291)
at org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.createAndBindOutputs(AbstractBindableProxyFactory.java:136)
at org.springframework.cloud.stream.binding.OutputBindingLifecycle.doStartWithBindable(OutputBindingLifecycle.java:58)
at java.util.LinkedHashMap$LinkedValues.forEach(Unknown Source)
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.start(AbstractBindingLifecycle.java:57)
at org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:34)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
... 14 common frames omitted
五、若有更多详细信息,请在下面提供。
根据之前提出的问题及网上搜索的答案,试了下面几种方式还未解决
1、对比了下blade-core-tool代码是更新的2.7.0版本
package org.springblade.core.tool.support;
import java.util.function.Supplier;
/**
* 解决 no binder available 问题
*
* @author Chill
*/
public class BinderSupplier implements Supplier<Object> {
@Override
public Object get() {
return null;
}
}
package org.springblade.core.tool.config;
import org.springblade.core.tool.support.BinderSupplier;
import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.function.Supplier;
/**
* 工具配置类
*
* @author Chill
*/
@Configuration
public class ToolConfiguration {
/**
* Spring上下文缓存
*/
@Bean
public SpringUtil springUtil() {
return new SpringUtil();
}
/**
* Binder支持类
*/
@Bean
@ConditionalOnMissingBean
public Supplier<Object> binderSupplier() {
return new BinderSupplier();
}
}
2、排除包BUS Kafka相关包
在blade-xxljob-admin.pom.xml
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-cloud</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-kafka</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</exclusion>
</exclusions>
</dependency>
3、排除config-monitor包
在blade-xxljob-admin.pom.xml
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-cloud</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</exclusion>
</exclusions>
</dependency>
扫一扫访问 Blade技术社区 移动端