0

We failed to start project sometimes, of course launched successfully most of the time. Error reported during failure:

[AbstractApplicationContext.java] refresh : 487 -- Exception encountered during context initialization - cancelling refresh attempt 
org.springframework.beans.factory.BeanCurrentlyInCreationException: 
Error creating bean with name 'ITsysDesktopConfig': 
Requested bean is currently in creation: 
Is there an unresolvable circular reference?

I am sure there is no circular reference.

Spring version 4.1.1.RELEASE is used, and I use Spring XML file, not annotation in project

When I was using computer with higher configuration,there is less chance of error happening.

Adrian Shum
  • 38,812
  • 10
  • 83
  • 131
Damon
  • 1

1 Answers1

-1

The problem could be with

@ComponentScan(basePackages = "com.my.app")

Try to change

@ComponentScan(basePackages = "com.my.app")

to

@ComponentScan(basePackages = {"com.my.app.service", "com.my.app.config", "com.my.app"})

I think this is a Spring issue with beans loader...

Reference:

  1. https://github.com/spring-projects/spring-boot/issues/6045
  2. https://jira.spring.io/browse/SPR-14307
  3. Why does Spring get circular dependency issues on one machine and not another?
  4. https://www.logicbig.com/tutorials/spring-framework/spring-core/circular-dependencies.html
mw509
  • 1,957
  • 1
  • 19
  • 25