4 Replies Latest reply on Jun 26, 2011 7:03 AM by Vivian Steller

    Seam Cron and Arquillian (weld-se-embedded)

    Vivian Steller Newbie

      Hello,
      I'm trying to test my module which is based on Weld-1.1.1.Final and (beyond others) Seam Cron 1.0.0.Alpha1 with Arquillian (1.0.0.Alpha5, weld-se-embedded-1.1).


      Unfortunately, I'm not getting the simplest TemperatureConverterTest running if - and only if - Seam Cron is on the Maven module's classpath. That is, removing the Cron dependency and TemperatureCT works fine.


      The following exception is thrown during test execution (with both Maven 3 and Eclipse):


      org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
      Exception 0 :
      org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null
           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:744)
           at org.jboss.weld.injection.ParameterInjectionPoint.getValueToInject(ParameterInjectionPoint.java:139)
           at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:288)
           at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
           at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
           at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
           at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:52)
           at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:34)
           at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:399)
           at org.jboss.arquillian.container.weld.se.embedded_1.WeldSEContainer.deploy(WeldSEContainer.java:131)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:141)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:226)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:100)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:78)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:51)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:217)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
           at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:69)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:70)
           at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:170)
           at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303)
           at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)
           at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:187)
           at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
           at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)
           at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
           at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      
           at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:55)
           at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:34)
           at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:399)
           at org.jboss.arquillian.container.weld.se.embedded_1.WeldSEContainer.deploy(WeldSEContainer.java:131)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:141)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:226)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:100)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:78)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:51)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:217)
           at org.jboss.arquillian.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
           at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:69)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
           at org.jboss.arquillian.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
           at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
           at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
           at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:70)
           at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:170)
           at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303)
           at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)
           at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:187)
           at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
           at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)
           at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
           at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



      When stepping with the debugger into org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:744) it seems that the BeanManager fails to resolve beans for the following injection point:


      [parameter 3] of [method] public org.jboss.seam.cron.spi.SeamCronExtension.initProviders(AfterDeploymentValidation, BeanManager, CronSchedulingInstaller)



      Did anyone face the same problem? Has anyone been able to test a module that has a dependency to Seam Cron?


      Thanks very much for any insights.
      Cheers,
      vivian



        • 1. Re: Seam Cron and Arquillian (weld-se-embedded)
          Peter Royle Newbie

          Hi Vivian,


          Sorry for the late reply, This one seems to have escaped my Google Alert. Are you still getting this error or did you find a solution? It might be worth trying to add the following package to your Arquillian deployment archive definition:


          .addPackages(true,QuartzScheduleProvider.class.getPackage())



          Let me know if you're still having problems and I'll take a closer look at it.


          Cheers,


          Pete.

          • 2. Re: Seam Cron and Arquillian (weld-se-embedded)
            Vivian Steller Newbie

            no, unfortunately this did not solve the problem...


            But well, I think was not clear enough in my previous post: I'm not even trying to actually test something using Cron. Have a look at my simple test case:


            @RunWith(Arquillian.class)
            public class SampleTestArquillian
            {
                 @Inject
                 private SampleBean sampleBean;
                 
                 @Deployment
                 public static JavaArchive createTestArchive()
                 {
                      return ShrinkWrap.create(JavaArchive.class, "test.jar")
                                .addClasses(SampleBean.class, SampleDependentBean.class, SessionScopedBean.class, ConversationScopedBean.class)
                                .addAsManifestResource(
                                          EmptyAsset.INSTANCE,
                                          ArchivePaths.create("beans.xml"));
                 }
                 
                 @Test
                 public void testSample() throws Exception
                 {
                      Assert.assertNotNull(sampleBean);
                      Assert.assertNotNull(sampleBean.getDependentBean());
                      Assert.assertEquals(sampleBean.getDependentBean().sayHello(), "Say Hello!");
                      
                      Assert.assertNotNull(sampleBean.getConversationBean());
                      Assert.assertEquals(sampleBean.getConversationBean().sayHello(), "Say Hello!");
                      
                      Assert.assertNotNull(sampleBean.getSessionBean());
                      Assert.assertEquals(sampleBean.getSessionBean().sayHello(), "Say Hello!");
                 }
                 
            }
            



            None of the SampleBeans has an import to a class from Seam Cron, so it's not acually used at all!


            However, this is my pom.xml:


            ...
                <dependencies>
                    <dependency>
                        <groupId>javax.enterprise</groupId>
                        <artifactId>cdi-api</artifactId>
                        <version>1.0-SP4</version>
                    </dependency>
                    <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.8.1</version>
                        <scope>test</scope>
                    </dependency>
                    <dependency>
                        <groupId>org.jboss.seam.cron</groupId>
                        <artifactId>seam-cron</artifactId>
                        <version>3.0.0.Alpha1</version>
                    </dependency>
                </dependencies>
            
                <profiles>
                    <profile>
                        <id>arquillian</id>
                        <activation>
                            <activeByDefault>true</activeByDefault>
                        </activation>
                        <dependencies>
                            <dependency>
                                <groupId>org.jboss.arquillian</groupId>
                                <artifactId>arquillian-junit</artifactId>
                                <version>1.0.0.Alpha5</version>
                                <scope>test</scope>
                            </dependency>
                        </dependencies>
                    </profile>
                    <profile>
                        <id>weld-ee-embedded-1.1</id>
                        <activation>
                            <activeByDefault>true</activeByDefault>
                        </activation>
                        <dependencies>
                            <dependency>
                                <groupId>org.jboss.arquillian.container</groupId>
                                <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
                                <version>1.0.0.Alpha5</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>org.jboss.weld</groupId>
                                <artifactId>weld-core</artifactId>
                            </dependency>
                            <dependency>
                                <groupId>org.jboss.weld</groupId>
                                <artifactId>weld-api</artifactId>
                            </dependency>
                            <dependency>
                                <groupId>org.slf4j</groupId>
                                <artifactId>slf4j-simple</artifactId>
                            </dependency>
                            <dependency>
                                <groupId>javax.el</groupId>
                                <artifactId>el-api</artifactId>
                                <version>2.2</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>org.glassfish.web</groupId>
                                <artifactId>el-impl</artifactId>
                                <version>2.1.2-b04</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>org.jboss.spec.javax.servlet</groupId>
                                <artifactId>jboss-servlet-api_3.0_spec</artifactId>
                                <version>1.0.0.Beta2</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>javax.validation</groupId>
                                <artifactId>validation-api</artifactId>
                                <version>1.0.0.GA</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>javax.transaction</groupId>
                                <artifactId>jta</artifactId>
                                <version>1.1</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>javax.persistence</groupId>
                                <artifactId>persistence-api</artifactId>
                                <version>1.0</version>
                                <scope>test</scope>
                            </dependency>
                            <dependency>
                                <groupId>org.jboss.ejb3</groupId>
                                <artifactId>jboss-ejb3-api</artifactId>
                                <version>3.1.0</version>
                                <scope>test</scope>
                            </dependency>
                        </dependencies>
                        <dependencyManagement>
                            <dependencies>
                                <dependency>
                                    <groupId>org.jboss.weld</groupId>
                                    <artifactId>weld-core-bom</artifactId>
                                    <version>1.1.1.Final</version>
                                    <type>pom</type>
                                    <scope>import</scope>
                                </dependency>
                            </dependencies>
                        </dependencyManagement>
                    </profile>
                </profiles>
            ...
            



            So it's just about Seam Cron having on the Maven classpath or not. Again, removing the Cron dependency and the test runs through. ...and this is what makes me really surprised. Should Arquillian somehow isolate my test and should not be affected by Maven's classpath at all (while executing the test)?


            What do you think?

            • 3. Re: Seam Cron and Arquillian (weld-se-embedded)
              Peter Royle Newbie

              Vivian Steller wrote on Jun 24, 2011 10:08:

              None of the SampleBeans has an import to a class from Seam Cron, so it's not acually used at all!

              So it's just about Seam Cron having on the Maven classpath or not. Again, removing the Cron dependency and the test runs through. ...and this is what makes me really surprised. Should Arquillian somehow isolate my test and should not be affected by Maven's classpath at all (while executing the test)?

              What do you think?


              Thanks for all the configs it was very helpful.


              I'm certainly no Arquillian expert, but my experience is that Arquillian automatically puts 3rd party libraries on the test classpath. It's only the classes in the current project that you have to be specific about I think.


              Also Cron, like most extensions is designed to be discovered and initialised automatically by CDI simply by being on the classpath, and the error you're getting is happening during that automatic initialisation. That's why it doesn't matter that you're not even using any Cron functionality in your test, you'll still get the error if Cron can't initialise properly.


              Having said that, the reason Cron couldn't initialise is twofold, and seems to contradict what I just said about 3rd party libraries.


              Firstly, I've been told there is some kind of limitation with the way Arquillian handles 3rd party producer methods. Long story short, if the bean you need is supplied by a producer method in a 3rd party library, you need to add the class containing the producer method to your Arquillian deployment archive. Cron relies on a producer method in Seam Solder, somewhere in the org.jboss.seam.solder.resourceLoader package.


              Secondly, and this one I don't understand I'm afraid, it seems you need to explicitly add the CronSchedulingInstaller class to your Arquillian classpath. I can't think why that might be, but it did fix the problem for me.


              So the end result is, if you add these lines to your Arquillian deployment archive definition you should be right:


              .addPackage(ResourceLoader.class.getPackage()) // arquillian needs explicit knowledge of third-party producers
              .addClass(CronSchedulingInstaller.class)



              Let me know if that works. Obviously I'd love to get to the bottom of the second problem so if anyone out there has any ideas what might be going on, please chime in!


              Cheers,


              Pete.

              • 4. Re: Seam Cron and Arquillian (weld-se-embedded)
                Vivian Steller Newbie

                Great, Pete, it works! Thanks very much!


                The issue tackled me a lot the past days, now I'll consider Arquillian (Alpha5) for testing again, very nice.


                I do not exactly know, but maybe this Arquillian issue is related to our problems here: https://issues.jboss.org/browse/ARQ-405


                Let's see whether CR1 fixes one of them - I'll check it out once CR1 is fully released.


                Thanks again, Pete :)