java - Can I use CDI to inject a resource into a JAX-RS Application/ResourceConfig? -


i'd resourceconfig have access database configuration. i've tried this:

@applicationpath("/api") public class applicationconfig extends resourceconfig {      @persistencecontext(unitname = "mypu")     private entitymanager em;      @inject     private myejb myejb;      @postconstruct     public void init() {       // em , myejb both null       ...     } 

but neither entitymanager, not ejb, injected (both null)

is there special way in jax-rs?

note: i'm able inject resources path-annotated class fine. i'm having trouble doing in actual applicationpath-annotated class.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -