jakartaee / nosql

The specification in Jakarta EE to help Jakarta EE developers create enterprise-grade applications using Java® and NoSQL technologies.
https://projects.eclipse.org/projects/ee4j.nosql
Eclipse Public License 2.0
92 stars 28 forks source link

Repository injection doesn't work #65

Closed amoscatelli closed 3 years ago

amoscatelli commented 3 years ago

I am using Wildfly 21.0.0 (so I have CDI/Weld as required)

Any combination of

@Produces
@Database(DatabaseType.KEY_VALUE)
protected BucketManager produce() {
    return manager;
}

or

@Produces
protected BucketManager produce() {
    return manager;
}

Isn't enough to inject

@Inject
@Database(DatabaseType.KEY_VALUE)
private StringValueRepository repository;

or

@Inject
private StringValueRepository repository;

org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type StringValueRepository with qualifiers @Database

or

org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type StringValueRepository with qualifiers @Default

Of course if the Produces method returns a StringValueRepository directly, then it works.

Since this kind of "indirect" injection is mentioned in different parts of jnosql spec/documentation I wonder what I am doing wrong :

http://www.jnosql.org/spec/ http://www.jnosql.org/docs/key-value.html

Little help please ?

Thank you in advance

keilw commented 3 years ago

@amoscatelli Does it work now?

amoscatelli commented 3 years ago

@keilw no sorry, I closed this since I believe this is the spec repository. I opened another one in the implementation repo: https://github.com/eclipse/jnosql/issues/251