2017-08-09 50 views
0

我是一位使用微服务体系结构的新手,想从另一个使用camunda(只读业务流程工具(库))的模块访问bean。错误不满意依赖从camunda接口来还,所以我试着用下面的代码中排除我不需要从camunda任何豆我目前的模块中:UnsatisfiedDependencyException 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 
+0

太少细节准确地说。问题在于创建bean'processEngineFactoryBean'。这个bean和spring配置相关代码的代码将会有帮助 –

+0

processEngineFactoryBean属于camunda。我现在的模块中不需要这个camunda库。它被作为依赖项添加的模块使用。现在它使我当前的模块无法启动 – Etch

+0

我可以很好地访问其他模块接受带有此processEngineFactoryBean的模块。我使用代码@Configuration @ComponentScan(basePackages = {“com.example”} – Etch

回答

1

我的解决方案很简单,但需要很长时间才能解决。我设法用下面的代码来解决这个问题:

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

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

相关问题