-
1. Re: Arquillian add Resources Help
aslak Apr 3, 2012 8:32 AM (in response to mano_seba)1 of 1 people found this helpfulNot quite sure what you're trying to do here.. but..
@Resource is a Common Annotation from JSR-250, and is used to lookup resources bound to JNDI
WebArchive.addAsResource is used to place 'something' into the Resource location in a WebArchive /WEB-INF/classes
-
2. Re: Arquillian add Resources Help
mano_seba Apr 3, 2012 8:47 AM (in response to aslak)Well I try to make an injection with @ EJB service but unfortunately that EJB is null and is my opinion that I must add resource in arquillian
@EJB
private GisService gis;
@Resource(lookup = "java:/jca/jcrJCA") private Repository repository; @Resource private SessionContext ctx; @EJB private FileService fileService; @Deployment public static WebArchive createTestArchive() { return ShrinkWrap.create( WebArchive.class,"test.war")..addClasses(gisService.class);} because the GisService is null i thought that the problem is from @Resource SessionContext and Repository... can add thouse Resources to WebArchive or I was wrong about the problem?
Thanks for the reply
-
3. Re: Arquillian add Resources Help
aslak Apr 3, 2012 10:18 AM (in response to mano_seba)1 of 1 people found this helpfulSessionContext can only be injected within a EJB to my knowlegde..
Your Repository Resource injection should work as long as there is something bound to that lookup JNDI name of type Respository.
if the @EJB is null, try adding a @EJB.mappedName with the JNDI name where the ejb is bound
-
4. Re: Arquillian add Resources Help
mano_seba Apr 3, 2012 10:59 AM (in response to aslak)Thanks for the reply. I was going on a wrong track. I thought that the @Resource must be put in the WebArchive Thanks again for clarification.