Closed guanyou-git closed 1 year ago
Hello, @guanyou-git. Thanks for reaching us!
Could you provide your debugging logs or minimal reproducer(with git repository will be great)?
Since I couldn't reproduce this issue with minimal setup. (https://github.com/jchrys/r2dbc-mysql-issue131 please check MySqlConnectionFactoriesTest
)
I have used your repo and added more info here to replicate the issue, appreciate the help, couldn't push into your repo
and the long line is
2023-07-14 17:17:07.326 WARN 65005 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'r2dbcEntityTemplate' defined in class path resource [com/example/issue131reproducer/MySqlConnectionFactories.class]: Unsatisfied dependency expressed through method 'r2dbcEntityTemplate' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.r2dbc.core.DatabaseClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
I know there's a mixed of new and old depedencies which other components of the application require, would appreciate if you have any suggestion on this
Hi, @guanyou-git. Thank you for sharing the reproducer.
It appears that there is an issue with the programmatic R2DBC configuration when using R2dbcDataAutoConfiguration
and R2dbcAutoConfiguration
. In my environment, I was able to resolve it by disabling both configurations.
I suggest you also report this issue to the springframework community, as it is related to Spring. (I suspect that it might be related to the issue reported at https://github.com/spring-projects/spring-boot/issues/21586)
below is my patch to your reproducer.
@SpringBootApplication(exclude = {
R2dbcDataAutoConfiguration.class,
R2dbcAutoConfiguration.class,
AzureServiceBusQueueAutoConfiguration.class, // I disabled below bc I didn't configure it.
AzureServiceBusAutoConfiguration.class,
AzureServiceBusTopicAutoConfiguration.class,
EmbeddedMongoAutoConfiguration.class,
})
public class Issue131reproducerApplication {
public static void main(String[] args) {
SpringApplication.run(Issue131reproducerApplication.class, args);
}
}
hi @jchrys , thanks and appreciate the inputs, will feedback accordingly. sorry I missed out on replying last friday.
Summary
Am unable to run tests and get the following error, more information here: https://stackoverflow.com/questions/76684680/upgraded-from-miku-to-asyncer-r2dbc-facing-autoconfigure-error-when-compiling
Detailed description
In my test, I have @SpringBootTest @AutoConfigureTestDatabase, and am getting the following error
I updated my maven pom.xml, and updated my ConnectionFactory to the asyncer programmatic implementation
Old
New
Relevant context
Checklist