[英]UnsatisfiedDependencyException Error with bean name Unsatisfied dependency expressed through field
I'm a novice using a microservice architecture and want to access a bean from another module which uses camunda (a read only business process tool (library)). 我是使用微服务架构的新手,并且想要从另一个使用camunda(只读业务流程工具(库))的模块访问Bean。 The error unsatisfied dependency is coming from a camunda interface yet I don't require any bean from camunda in my current module so i tried to exclude it with the code below:
错误未满足的依赖关系来自camunda接口,但是我在当前模块中不需要来自camunda的任何bean,因此我尝试使用以下代码将其排除:
@Configuration
@ComponentScan(basePackages = {"com.example"}, excludeFilters={
@ComponentScan.Filter(type=FilterType.ASSIGNABLE_TYPE, value=SpringProcessEngineServicesConfiguration.class)})
The current module won't start giving the stacktrace below: 当前模块将不会开始提供以下stacktrace:
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
My solution was simple although it took a long time to solve. 我的解决方案很简单,尽管花了很长时间才能解决。 I managed to solve it with the code below:
我设法用下面的代码解决了:
<exclusions>
<exclusion>
<groupId>org.camunda.blablabla</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
All needed to do was to exclude all the camunda dependencies in the module dependency section. 所有需要做的就是在模块依赖项部分中排除所有camunda依赖项。 Silly me!
傻我!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.