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 - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -