grails-core icon indicating copy to clipboard operation
grails-core copied to clipboard

Multiple datasources can't inject

Open pshotton opened this issue 1 year ago • 2 comments

Expected Behavior

Following the documentation on configuring a second datasource, then trying to use within a service. In application.yml have a datasource block, followed by a datasources block with one datasource defined. Trying to use the second datasource in a service, again following the docs.: DataSource dataSource_lookup

Actual Behaviour

Datasource doesn't get injected, always comes back as null.

Steps To Reproduce

Create a grails app with bare config with two datasources as per documentation. Attempt to use second datasource.

Environment Information

Linux JDK 17

Example Application

No response

Version

5.3.2

pshotton avatar Jun 10 '23 20:06 pshotton

It will easier and faster for anyone to help you if you could you please try to use Java 11, and also share a sample application?

puneetbehl avatar Jun 15 '23 12:06 puneetbehl

Any problem with Java 17? Even with J11 I get the same problem. I will share a sample...

pshotton avatar Jun 15 '23 14:06 pshotton