You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (JIRA)" <ji...@apache.org> on 2017/10/29 17:58:00 UTC

[jira] [Created] (CXF-7544) Support @Context-based injection into proxied CDI beans

Andriy Redko created CXF-7544:
---------------------------------

             Summary: Support @Context-based injection into proxied CDI beans
                 Key: CXF-7544
                 URL: https://issues.apache.org/jira/browse/CXF-7544
             Project: CXF
          Issue Type: Bug
    Affects Versions: 3.2.0, 3.1.13
            Reporter: Andriy Redko
            Assignee: Andriy Redko


The issue pop up as part of https://github.com/apache/cxf/pull/330 discussion. In case when provider / feature / resource is a proxied CDI bean, the contextual class members (annotated with @Context) are not injected.

Test case to reproduce:

{code}
@ApplicationScoped
public class BookStoreRequestFilter implements ContainerRequestFilter {
    @Context private ResourceInfo resourceInfo;
    
    @Override
    public void filter(ContainerRequestContext requestContext) throws IOException {
        // Contextual instances should be injected independently
        if (resourceInfo == null || resourceInfo.getResourceMethod() == null) {
            requestContext.abortWith(Response.serverError().build());
        }
    }
}
{code}





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)