-
1. Re: Arquillian + JBoss AS 4.2.3 + Weld
aslak Aug 4, 2011 2:27 PM (in response to htfv)Weld-Servlet on Tomcat works, never even thought of testing it with JBoss AS 4.2.
If you can provide a sample project I can see if i can spot waht's not working..
-
2. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Aug 5, 2011 4:59 AM (in response to aslak)I cannot make it work with Tomcat 6 either. Arquillian logs a message
05.08.2011 10:51:53 org.jboss.arquillian.testenricher.cdi.container.BeanManagerProducer lookup
INFO: BeanManager not found.
So, what's the trick?
-
3. Re: Arquillian + JBoss AS 4.2.3 + Weld
aslak Aug 5, 2011 6:07 AM (in response to htfv)For Tomcat 6:
-
4. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Aug 5, 2011 6:29 AM (in response to aslak)OK, Tomcat 6 works, thanks. Needed only to add beans.xml (always forget it) and context.xml. Attached updated project.
-
5. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Aug 8, 2011 8:35 AM (in response to aslak)Hello Aslak, sorry to ping you, did you have time to check JBoss AS 4.2 with Weld?
-
6. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Sep 6, 2011 11:11 AM (in response to aslak)There are 2 problems in Arquillian + JBoss AS 4.2.3 configuration:
1. arquillian-jbossas-remote-4.2 does not depend on arquillian-testenricher-cdi; it means it does not even try to do CDI injection. This dependency can be added manually.
2. arquillian-testenricher-cdi tries to obtain BeanManager from JNDI using different names. It seems that Weld Servlet does not register BeanManager in JNDI. This is why context.xml is required on Tomcat 6 and this is why BeanManager may not be found on JBoss AS 4.2.3. There is a more portable way to obtain BeanManager, which should work in Tomcat and any CDI container without extra configuration (I tested only in JBoss AS 4.2.3). Check required chages here: https://github.com/htfv/arquillian-core/commit/b176d7c8e095cb5eef2e20c3c6ad5f9e36d23784
I hope it helps.
-
7. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Sep 6, 2011 11:22 AM (in response to htfv)Oops, it does not work on JBoss AS 7.0.1, because CDIExtension.beforeBeanDiscovery is not called for some reson. May be you could use it as a fallback option?
-
8. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Sep 6, 2011 11:25 AM (in response to htfv)Can it be that the problem on AS 7 is that Arquillian classes are deployed in a separate JAR without beans.xml?
-
-
10. Re: Arquillian + JBoss AS 4.2.3 + Weld
aslak Sep 7, 2011 10:56 AM (in response to htfv)Nice!
Arquillian is executed a bit differently on AS7 then the other containers, the enrichers etc is not part of the user deployment, but a separate service executing in the context of the user deployment. So the jndi lookup is needed there when using the default protocol jmx-as7
-
11. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Sep 7, 2011 1:13 PM (in response to aslak)Do you think it is useful? Will it be integrated into main repository? Should/may I do it?
-
12. Re: Arquillian + JBoss AS 4.2.3 + Weld
aslak Sep 7, 2011 4:50 PM (in response to htfv)Yeah, i think this is a nice improvement, espercially since we have the old fall back. Could you create a pull request, i'll get it pushed upstream.
-
13. Re: Arquillian + JBoss AS 4.2.3 + Weld
htfv Sep 8, 2011 9:54 AM (in response to aslak)Created a pull request: https://github.com/arquillian/arquillian-core/pull/19
On to the next problem. I noticed today, that conversation context is not active when test method is executed. Can you tell, who (which class) should start conversation? Is there a workaround for this, or should it be fixed in Arquillian?
-
14. Re: Arquillian + JBoss AS 4.2.3 + Weld
aslak Sep 8, 2011 10:34 AM (in response to htfv)Pr cdi spec only jsf request has conversation scope active. arquillian piggy back on a http request