Open awisniew90 opened 5 years ago
Not really sure how the CDI introspection intersects the web/ejb container introspection for something like this. It could very well be the latter here not CDI which is relevant... but, if so, I assume the CDI team can reassign. Thanks.
This is with feature set:
<featureManager>
<feature>jdbc-4.1</feature>
<feature>jaxrs-2.1</feature>
</featureManager>
with code snippet:
@Path("/hello")
public class HelloResource {
@Resource
DataSource ds1;
Adding JAX-RS label in case it helps get attention.
Is this still an issue? We have made changes in the resource injection space for JAX-RS components, so I think it's possible that this may already be resolved.
Injecting a datasource using the
@Resource
annotation does not work with a plain JAX-RS resource (with@PATH
annotation). A NPE is thrown on the datasource object.This works when the
@ApplicationScoped
annotation is added to the JAX-RS class and the cdi-2.0 feature is enabled on the server.This may be a bug, or this may just be a path that is not supported.
I've attached a sample app demonstrating the failure. Just run
mvn clean install
to build and deploy.