不满意依赖关系异常 Bean 名称错误 通过字段表示的不满意依赖关系



我是使用微服务架构的新手,想从另一个使用 camunda(只读业务流程工具(库((的模块访问 bean。错误不满足的依赖项来自camunda接口,但我在当前模块中不需要camunda的任何bean,所以我尝试使用以下代码将其排除:

@Configuration
@ComponentScan(basePackages = {"com.example"}, excludeFilters={
@ComponentScan.Filter(type=FilterType.ASSIGNABLE_TYPE, value=SpringProcessEngineServicesConfiguration.class)}) 

当前模块不会开始提供以下堆栈跟踪:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration': Unsatisfied dependency expressed through field 'processEngine': Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.exception.NotValidException: Filter name must not be null or empty: name is null; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.exception.NotValidException: Filter name must not be null or empty: name is null

我的解决方案很简单,尽管需要很长时间才能解决。我设法用下面的代码解决了它:

<exclusions>
<exclusion>
<groupId>org.camunda.blablabla</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>

所有需要做的就是在模块依赖部分排除所有 camunda 依赖项。傻我!

相关内容

最新更新