Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 若SpringCloudStream位于类路径上,SpringBootAuto配置将寻找默认绑定器_Spring Boot_Spring Cloud_Spring Cloud Stream - Fatal编程技术网

Spring boot 若SpringCloudStream位于类路径上,SpringBootAuto配置将寻找默认绑定器

Spring boot 若SpringCloudStream位于类路径上,SpringBootAuto配置将寻找默认绑定器,spring-boot,spring-cloud,spring-cloud-stream,Spring Boot,Spring Cloud,Spring Cloud Stream,我正在开发一个SpringBoot多模块应用程序,我们正在创建一个定制的胖jar来绑定所有第三方依赖项。springcloudstream也是这个肥罐子的一部分。我们的应用程序运行在springcloudstream版本2.1.3.RELEASE(springboot2.1.6.RELEASE)上,我们正在将其升级到3.0.2.RELEASE(springboot2.2.4.RELEASE)。 我们在这里遇到了一个问题。如果某个特定模块没有使用spring云数据流,但spring云数据流在类路径

我正在开发一个SpringBoot多模块应用程序,我们正在创建一个定制的胖jar来绑定所有第三方依赖项。
springcloudstream
也是这个肥罐子的一部分。我们的应用程序运行在
springcloudstream
版本
2.1.3.RELEASE
springboot2.1.6.RELEASE
)上,我们正在将其升级到
3.0.2.RELEASE
springboot2.2.4.RELEASE
)。 我们在这里遇到了一个问题。如果某个特定模块没有使用
spring云数据流
,但
spring云数据流
在类路径上,因此spring boot
自动配置
正在寻找一个
默认活页夹

{"mdc":{},"timestamp":"2020-03-20 12:53:04.150","level":"ERROR","logger":"org.springframework.boot.SpringApplication",
"message":"Application run failed", "exception":"\r\norg.springframework.context.ApplicationContextException: 
Failed to start bean 'outputBindingLifecycle'; 
nested exception is java.lang.IllegalArgumentException: <b>A default binder has been requested, but there is no binder available</b>\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)\r\n\
 org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:894)\r\n\
 org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)\r\n\
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)\r\n\
 org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)\r\n\
 org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)\r\n\
 org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)\r\n\
 org.springframework.boot.SpringApplication.run(SpringApplication.java:315)\r\n\
 org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:126)\r\n\
 org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal
 (DefaultCacheAwareContextLoaderDelegate.java:99)\r\n\
 org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)\r\n\
 org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)\r\n\
 org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.outputConditionEvaluationReport
 (SpringBootDependencyInjectionTestExecutionListener.java:53)\r\n\
 org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance
 (SpringBootDependencyInjectionTestExecutionListener.java:46)\r\n\
 org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)\r\n\
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)\r\n\
 org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\
 org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\
 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\
 org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\
 org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\
 org.springframework.test.context.junit4.s
ements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)\r\n\
 org.springframework.test.context.junit4.s
ements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)\r\n\
 org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)\r\n\
 org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\
 org.junit.runner.JUnitCore.run(JUnitCore.java:115)\r\n\
 org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)\r\n\
 java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)\r\n\
 java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)\r\n\
 java.util.Iterator.forEachRemaining(Unknown Source)\r\n\
 java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)\r\n\
 java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n\
 java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n\
 java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\r\n\
 java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)\r\n\
 java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n\
 java.util.stream.ReferencePipeline.forEach(Unknown Source)\r\n\
 org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)\r\n\
 org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)\r\n\
 org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)\r\n\
 org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)\r\n\
 org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)\r\n\
 org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)\r\n\
 org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)\r\n\
 org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)\r\n\
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)\r\n\
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)\r\n\
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)\r\n\
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)\r\n\
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)\r\nCaused by: 
 java.lang.IllegalArgumentException: A default binder has been requested, but there is no binder 
 available\r\n\
 org.springframework.util.Assert.notEmpty(Assert.java:549)\r\n\
 org.springframework.cloud.stream.binder.DefaultBinderFactory.doGetBinder(DefaultBinderFactory.java:144)\r\n\
 org.springframework.cloud.stream.binder.DefaultBinderFactory.getBinder(DefaultBinderFactory.java:134)\r\n\
 org.springframework.cloud.stream.binding.BindingService.getBinder(BindingService.java:362)\r\n\
 org.springframework.cloud.stream.binding.BindingService.bindProducer(BindingService.java:257)\r\n\
 org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.createAndBindOutputs(AbstractBindableProxyFactory.java:136)\r\n\
 org.springframework.cloud.stream.binding.OutputBindingLifecycle.doStartWithBindable(OutputBindingLifecycle.java:58)\r\n\
 java.util.LinkedHashMap$LinkedValues.forEach(Unknown Source)\r\n\
 org.springframework.cloud.stream.binding.AbstractBindingLifecycle.start(AbstractBindingLifecycle.java:57)\r\n\
 org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:34)\r\n\
 org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)\r\n\t... 59 common frames omitted\r\n\r\n"}

我想知道是否有任何其他方法或可配置属性可以在应用程序中使用,这样我就可以停止寻找默认绑定器。

我认为这种方法违反了spring引导原则,因此创建了非常大的e jar,其中包含从未使用过的依赖项。 确实可以使用
@springbootplication
exclude
属性并排除某些自动配置类。但我实际上是在问为什么类路径上有一些永远不用的东西,不管这些东西是自动配置JAR还是库JAR? 此外,还有暂时的依赖关系,因此使用s-c-stream时,您会带来许多其他jar,这些jar实际上可能会与您打算使用的东西产生冲突

<dependency>
       <groupId>org.springframework.cloud</groupId>
       <artifactId>spring-cloud-stream-test-support</artifactId>
       <version>3.0.2.RELEASE</version>
       <scope>test</scope>
   </dependency>