我使用Spring Boot V 1.4.1作爲新應用程序。 我的應用程序需要兩個JDBC數據源,我在http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-two-datasources如何設置它。 我的Spring bean配置類都被註解@EnableConfigurationProperties
和我的第一個bean定義爲在Spring Boot中使用@ConfigurationProperties應用程序不起作用
@Primary
@Bean
@ConfigurationProperties(prefix = "first.database")
DataSource qivsDB() {
return DataSourceBuilder.create().build();
}
,因此第二個。我application.properties
文件有像
first.database.url=jdbc:[redacted]
first.database.username=[redacted]
first.database.password=[redacted]
定義的原因,我不是透明的我調試這個過程中,屬性是無法初始化:Cannot determine embedded database driver class for database type NONE
- 調試表明我該建築工地沒有任何屬性設置調用build()
時。
我在這裏錯過了什麼?
也許這是關於* public * modifier在你的givsDB bean聲明之前丟失的 –