3 Replies Latest reply on Jan 19, 2011 8:28 PM by Michael Schuetz

    Facing troubles with Arquillian + Seam2 + JBossAS5.1 Managed

    Michael Schuetz Novice

      Hi to all,


      I am hunting strange error:


      I would like to execute multiple tests running against JBoss AS5.1 Managed (following does _not_ occur while running against AS5.1 Remote) at once.


      Executing single tests does work.


      What I do get:


      WARN  [org.jboss.seam.integration.jbossas.vfs.VFSScanner] Error handling item 'com.acme/MyServiceItTest.class': java.lang.IllegalStateException: Cannot load com/acme/MyServiceItTest.class from org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@6e69df65 (using getResourceAsStream() returned null)




      That's the testcase from the previously deplpoyed archive.


      Is this an Arquillian issue?


      As dirty workaround we did provide own EJB for test purpose and configured Binding by hand:

      @LocalBinding(jndiBinding = "test/XATransactionTestServiceBean/local")



      Just to provide context of test: http://community.jboss.org/thread/161408?tstart=0


      Thanks for any help.





        • 1. Facing troubles with Arquillian + Seam2 + JBossAS5.1 Managed
          Aslak Knutsen Master

          Can you provide the test cases that shows the issue so I can reproduce?

          • 2. Re: Facing troubles with Arquillian + Seam2 + JBossAS5.1 Managed
            Michael Schuetz Novice

            Sure, Thanks Aslak.


            public class XATransactionTest extends AbstractItTest {


                private static final String EAR_NAME = "xaTransactionTest";



                public static Archive<?> getDeployment() {

                    return getTestArchive(EAR_NAME, new String[]{"com.acme.common:commons-jsonservice:0.1",


                            new String[]{"net.sf.json-lib:json-lib:2.3:jdk15"},

                            XATransactionTest.class, MyService.class, MyServiceBean.class,

                            MyDao.class, MyDaoBean.class, My.class,

                            MessageFilterRegistrationSender.class, MessageFilterRegistrationSenderBean.class, MessageFilter.class,

                            RegistrationMessageCreator.class, XATransactionTestService.class, XATransactionTestServiceBean.class);




                private XATransactionTestService xaTransactionTestService;



                public void testHeuristicMixedException() {

                    Exception caughtException = null;

                    try {


                    } catch (Exception e) {

                        caughtException = e;



                    StringWriter writer = new StringWriter();

                    PrintWriter printWriter = new PrintWriter(writer);




                    assertTrue(caughtException.getCause() instanceof HeuristicMixedException);







            @LocalBinding(jndiBinding = "test/XATransactionTestServiceBean/local")

            public class XATransactionTestServiceBean implements XATransactionTestService {


                private MyService myService;



                private MessageFilterRegistrationSender messageFilterRegistrationSender;



                public void accessXAResources() {





            • 3. Re: Facing troubles with Arquillian + Seam2 + JBossAS5.1 Managed
              Michael Schuetz Novice

              BTW, "EAR_NAME" will be replaced in components.xml. See method in AbstractItTest:


                private static Asset getComponentsXML(final String earName) {

                      return new Asset() {


                          public InputStream openStream() {

                              try {

                                  final InputStream inputStream = AbstractItTest.class.getResourceAsStream("/war/components.xml");

                                  final InputStreamReader streamReader = new InputStreamReader(inputStream, "UTF-8");

                                  final ReplacingReader replacingReader =

                                          new ReplacingReader(streamReader, Collections.singletonMap("earName", earName));

                                  return new ReaderInputStream(replacingReader, "UTF-8");

                              } catch (UnsupportedEncodingException e) {

                                  throw new RuntimeException(e);







              The other stuff is basic Arquillian Seam2 glue code.