Teiid Odata多数据源连接

问题描述

我尝试使用示例代码https://github.com/teiid/teiid-spring-boot/tree/master/odata

将多个数据源公开为odata服务。

我将以下条目添加到application.properties中以连接到postgres,并提供了在DataSources.java中实现以连接到postgres

DataSources.java

@ConfigurationProperties(prefix = "spring.datasource.accounts3")
@Bean
public DataSource accounts3() {
    return DataSourceBuilder.create().build();
}

application.properties

spring.datasource.accounts3.jdbc-url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.accounts3.username=postgres
spring.datasource.accounts3.password=admin
spring.datasource.accounts3.driver-class-name=org.postgresql.Driver
spring.datasource.accounts3.platform=accounts3

还为accounts3平台创建了初始化脚本schema-accounts3.sql和data-accounts3.sql

但是它没有连接到postgres并出现以下错误。

创建名称为'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration'的bean时出错:通过构造函数参数0表示的不满意的依赖关系;嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在类路径资源[org / teiid / spring / example / DataSources.class]中定义的名称为'accounts3'的bean时出错:初始化bean失败;嵌套的异常是java.lang.NullPointerException

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...