Resolved by referring to:
- https://www.baeldung.com/circular-dependencies-in-spring#2-use-lazy
- https://blog.51cto.com/u_13478207/3336383
has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
structure to tell the story...
@Service
@Service
public class MainService{
@Autowired
private ServiceParent
}
@Service
@Service
then will hit the exception while maven run the application locally/at server.
@Service
public class ServiceParent{
@Autowired
private ServiceChild
}
@Service
public class ServiceChild{
@Autowired
private ServiceParent}
then will hit the exception while maven run the application locally/at server.
@Service
public class ServiceChild{
@Autowired
@Lazy
private ServiceParent}