-
2019-05-09
请查收
-
2019-05-09
@Mark 文档的多数据源配置不够详细 配置报错
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
-
2019-05-09
@jlw925950 把你的配置贴出来了
-
2019-05-09
@Mark img[//cdn.renren.io/a7e26201905091745037709.png]
-
2019-05-09
[pre]
dynamic:
datasource:
slave1:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://123456:1433;DatabaseName=security_enterprise
username: sa
password: 123456
slave2:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://123456:5432/security_enterprise
username: postgres
password: 123456
[/pre]
没有spring之类的东西
-
2019-05-09
@Mark ....依然报错是因为server层没有注释吗?
-
2019-05-09
@jlw925950 你按我的这个配置,应该是没问题了,多一个空格、少一个空格都不行啊,yml就是这样的
-
2019-05-09
@jlw925950 你不会把默认的数据源干掉了吧,那个是不能干掉的啊
-
2019-05-09
@Mark 那要怎么写- -
-
2019-05-10
@jlw925950 配置文件不要动,在最下面增加
[pre]
dynamic:
datasource:
slave1:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://123456:1433;DatabaseName=security_enterprise
username: sa
password: 123456
slave2:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://123456:5432/security_enterprise
username: postgres
password: 123456
[/pre]
-
2019-05-10
@Mark sql监控需要怎么打开啊? 以及service层注解后并不会使用我注解的数据源查找数据是为何?
-
2019-05-10
@jlw925950 sql监控默认是打开的,你访问路径错了吧 数据源不支持父类方法,需要@Override
-
2019-05-10
@Mark img[//cdn.renren.io/ebd78201905101116403241.png] 没有哦,在最新版本的sql监控中,这里面没有数据呢。
-
2019-05-10
@Mark 在 sql监控 jar 版本为1.1.10 可以监控到数据呢。是因为新版本 文件配置有误吗?