Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 43739a8

Browse files
authoredDec 14, 2018
Update JpaConfig.java
Spring needs a bean with exact name "dataSource". If to use @Profile("prod") then an exception occurred: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource' available
1 parent 95748d1 commit 43739a8

File tree

1 file changed

+1
-1
lines changed
  • profiles-and-properties/src/main/java/com/bobocode/config

1 file changed

+1
-1
lines changed
 

‎profiles-and-properties/src/main/java/com/bobocode/config/JpaConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public DataSource pooledDataSource(HikariConfig config) {
4848
return new HikariDataSource(config);
4949
}
5050

51-
@Bean
51+
@Bean("dataSource")
5252
@Profile("prod")
5353
public HikariConfig hikariConfig() {
5454
HikariConfig hikariConfig = new HikariConfig();

0 commit comments

Comments
 (0)