Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependencies error on Spring Boot's DataSourceInitializer #186

Closed
landys opened this issue Jan 19, 2017 · 5 comments
Closed

Circular dependencies error on Spring Boot's DataSourceInitializer #186

landys opened this issue Jan 19, 2017 · 5 comments
Labels

Comments

@landys
Copy link

landys commented Jan 19, 2017

The problem exists in version 1.2.4 and 1.2.5 but not 1.2.3. The similar problems are reported as issue #58 and #59, and they are considered fixed but I don't think so. Or a regression issue was introduced.

The core error is as follows.

nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; 
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: 
Error creating bean with name 'dataSource': Requested bean is currently in creation: 
Is there an unresolvable circular reference?
@landys landys changed the title Another issue about circular dependencies by Spring Boot's DataSourceInitializer exists Another issue about circular dependencies by Spring Boot's DataSourceInitializer found Jan 19, 2017
@raregne
Copy link

raregne commented Feb 2, 2017

I have the same problem. Tell me how to fix it.

@harawata
Copy link
Member

harawata commented Feb 6, 2017

As #58 existed in 1.2.3 and fixed in 1.2.4, it seems more like a side effect of the fix rather than the same issue.
I am not sure if someone is already working on this, but we might need a demo project that reproduces the exception.
Here are some project templates.

@kazuki43zoo
Copy link
Member

@landys thanks for providing reproduce project.
This behavior can prevent to disable the datasource initialing feature provided by spring boot.

spring.datasource.initialize=false

Probably, this issue belong with Spring Boot. Same error occurred using Spring JDBC(= Not using MyBatis). If you want to resolve this behavior, you can create a new issue on Spring Boot.

Thanks.

@kazuki43zoo kazuki43zoo changed the title Another issue about circular dependencies by Spring Boot's DataSourceInitializer found Circular dependencies error on Spring Boot's DataSourceInitializer Mar 12, 2017
@mrsbaiyang
Copy link

@kazuki43zoo thanks for giving the resolvent,but i still confuse why it is cause cycle dependences.

@JasonLaw1994
Copy link

@landys thanks for providing reproduce project.
This behavior can prevent to disable the datasource initialing feature provided by spring boot.

spring.datasource.initialize=false

Probably, this issue belong with Spring Boot. Same error occurred using Spring JDBC(= Not using MyBatis). If you want to resolve this behavior, you can create a new issue on Spring Boot.

Thanks.

spring.datasource.initialize is deprecated, you can use spring.autoconfigure.exclude = org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants