yesamer opened a new issue, #2263:
URL: https://github.com/apache/incubator-kie-issues/issues/2263
During the I'm testing Gradle testing phase. When launching the project in
dev mode, this error is thrown:
```
Caused by:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error
creating bean with name 'unitOfWorkManagerProducer': Requested bean is
currently in creation: Is there an unresolvable circular reference or an
asynchronous initialization dependency?
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:544)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:312)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1770)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1653)
~[spring-beans-6.2.15.jar:6.2.15]
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:784)
~[spring-beans-6.2.15.jar:6.2.15]
... 70 common frames omitted
```
After a quick investigation, I discovered that issue is because of this
dependency:
`org.kie:kogito-addons-springboot-embedded-jobs`
Namely, launching Spring Boot dev without that dependency and just with
`org.kie:kogito-addons-springboot-embedded-jobs-jpa`
seems working.
It looks like that adding the @ Lazy annotation here:
```
public class SpringbootJobServiceConfiguration {
@Autowired(required = false)
Processes processes;
@Autowired
@Lazy <----
UnitOfWorkManager unitOfWorkManager;
```
Fixes the circular dependencies issue.
_NOTE: I’m not fully sure why this happens with Gradle but not with Maven.
The two build systems resolve dependencies and manage classpaths differently,
and on top of that, Spring Boot and Quarkus implement distinct dev‑mode and
class‑reloading mechanisms for each tool. These differences can easily surface
bean‑initialization or class‑loading issues in one environment but not the
other. (edited)_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]