不满意的依赖异常bean名称错误通过字段

时间:2017-08-09 20:40:31

标签: java maven spring-boot

我是一个使用微服务架构的新手,想要从另一个使用camunda的模块(一个只读的业务流程工具(库))访问一个bean。错误不满意的依赖是来自一个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

1 个答案:

答案 0 :(得分:2)

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

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

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