title: injecting named service in JAX-RS resource by constructor with OpenEJB
body: <p>I'm using OpenEJB as application server and I want to deploy a Jax-RS resource that requires some named service to be injected in its constructor.</p>
  
  <p>My resource looks like :</p>
  
  <pre><code>@Singleton
  @Path("/")
  public class Resource {
  
      private Service service;
  
      @Inject
      public Resource(@Named("service") Service service) {
          this.service = service;
      }
  }
  </code></pre>
  
  <p>Unfortunately, OpenEJB complains because it doesn't consider my constructor to be valid because of the @Named annotation decorating the Service argument. </p>
  
  <pre><code>java.lang.RuntimeException: Resource class class test.Resource has no valid constructor
  at org.apache.openejb.server.cxf.rs.CdiResourceProvider.validateConstructorExists(CdiResourceProvider.java:138)
  at org.apache.openejb.server.cxf.rs.CdiResourceProvider.&lt;init&gt;(CdiResourceProvider.java:100)
  at org.apache.openejb.server.cxf.rs.OpenEJBPerRequestPojoResourceProvider.&lt;init&gt;(OpenEJBPerRequestPojoResourceProvider.java:28)
  at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:522)
  </code></pre>
  
  <p>The implementation of the OpenEJB CdiResourceProvider clearly doesn't want something else than the Jax-RS @Context annotation for constructor arguments...
  Is it supported by OpenEJB?</p>