i would like to know if anyone have success injecting a JDBC
datasource inside a JAX-RS resource.
Do i need to make the resources EJB's? or plain old java objects have
the benefit too?
thanks in advance
Did you find the right answer?
No i didn't.
For now i gave up to use only webprofile and added @Stateless annotation on JAX-RS along with @Path.
After that, the classes that i already mapped in my javax.ws.rs.core.Application class got the right to use @Resource and @EJB to inject what i need just as if they where servlets... with the plus of being a EJB.
Zero xml configuration untill now, and thanks to JEE6 EJB's have no need to ejb-jar.xml or even an full featured EAR, they just live inside web project.
Of course, it will not run on ordinary and simpler tomcat, but it theory anything JEE6-compliant will run this .war
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.