I have a web application running on a Servlet 3.0 container (Jetty 9.0.4) using JSF 2.2 (Mojorra 2.1.3) & CDI 1.1 (Weld 2.0.3). No full-fledged application server is use
I solved my problem.
The problem is, that Jersey JAX-RS implementation uses the HK2 dependency injection framework and this framework is simply not aware of the CDI beans. And by following the idea of the accepted answer in this post, I make the CDI beans available for the HK2 injection bindings and the injection of my application scoped beans works fine now.
But I really wonder why it is so cumbersome to bring together two constituent parts of Java EE.
Update: As G. Demecki mentioned in a comment, this is solution is no longer needed! But it helped me out at the time of asking this question.
You can just include this dependency to enable Jersey-CDI integration
<dependency>
<groupId>org.glassfish.jersey.containers.glassfish</groupId>
<artifactId>jersey-gf-cdi</artifactId>
<version>2.2</version>
</dependency>
It works for me using Jersey 2.8, Jetty 9.1 and Weld 2.2.0.SP1.
I have created a sample project with Embedded Jetty, Jersey 2 and CDI https://drive.google.com/file/d/0B9j0dIS5bS0wSEg0NTk2eGpPSGs/view?usp=sharing
Kindly let me know if you find any issues