10 Replies Latest reply on May 27, 2016 4:56 PM by mjobanek

    Running Arquillan with /wildfly-10.0.0.Final

    sharkbite

      Hi

       

      Whne I try and run Arquillan with wildfly-10.0.0.Final

       

      I get error

       

      Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.as.embedded:main

        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:240)

        at org.jboss.as.embedded.EmbeddedServerFactory.create(EmbeddedServerFactory.java:119)

        at org.jboss.as.embedded.EmbeddedServerFactory.create(EmbeddedServerFactory.java:99)

       

       

      This is because org.jboss.as.embedded:main does not exist in modules/system/layers/base/org/jboss/as

       

       

      Am I correct?

       

      If yes, when will this exist?

       

      thanks,

      Daslan

        • 1. Re: Running Arquillan with /wildfly-10.0.0.Final
          mjobanek

          Hi,

          which version of wildfly container adapter do you use? If it is different than 2.0.0.Final then try out this one...

          Matous

          • 2. Re: Running Arquillan with /wildfly-10.0.0.Final
            sharkbite

            Try out which one?

            2.0.0 final?

            • 3. Re: Running Arquillan with /wildfly-10.0.0.Final
              mjobanek

              Yeah - 2.0.0.Final

              • 4. Re: Running Arquillan with /wildfly-10.0.0.Final
                sharkbite

                Hi I am not sure what WildFly container adapter I am using?


                Here are my settings  in pom.xml

                 

                 

                <properties

                  <junit-version>4.11</junit-version>

                  <arquillian-version>1.1.4.Final</arquillian-version>

                  <arquillian-wildfly-version>8.1.0.CR2</arquillian-wildfly-version>

                  <arquillian-transaction-version>1.0.1.Final</arquillian-transaction-version>

                  <wildfly-server-home>/Applications/wildfly-10.0.0.Final</wildfly-server-home>

                        <surefire-plugin-version>2.18.1</surefire-plugin-version>

                        <wildfly-maven-plugin-version>1.0.2.Final</wildfly-maven-plugin-version> 

                        <shrinkwrap.bom-version>2.1.1</shrinkwrap.bom-version>

                </properties>



                 

                            <!-- -JUNIT-->

                            <dependency>

                                <groupId>junit</groupId>

                                <artifactId>junit</artifactId>

                                <version>${junit-version}</version>

                                <scope>test</scope>

                            </dependency>

                            <dependency>

                                <groupId>org.jboss.shrinkwrap.resolver</groupId>

                                <artifactId>shrinkwrap-resolver-bom</artifactId>

                                <version>${shrinkwrap.bom-version}</version>

                                <scope>test</scope>

                                <type>pom</type>

                            </dependency>

                             <dependency>

                                <groupId>org.jboss.shrinkwrap</groupId>

                                <artifactId>shrinkwrap-api</artifactId>

                                <version>1.2.1</version>

                                <scope>test</scope>

                            </dependency>         

                            <dependency>

                                <groupId>org.jboss.shrinkwrap.resolver</groupId>

                                <artifactId>shrinkwrap-resolver-depchain</artifactId>

                                <version>${shrinkwrap.bom-version}</version>

                                <scope>test</scope>

                                <type>pom</type>

                            </dependency>

                            <!-- arquillian itself-->

                            <dependency>

                    <groupId>org.jboss.arquillian.core</groupId>

                     <artifactId>arquillian-core-api</artifactId>

                                <version>${arquillian-version}</version>

                                <scope>test</scope>

                            </dependency>           

                            <dependency>

                                <groupId>org.jboss.arquillian</groupId>

                                <artifactId>arquillian-bom</artifactId>

                                <version>${arquillian-version}</version>

                                <type>pom</type>

                                <scope>test</scope>

                            </dependency>

                            <!-- this is in an extention to arquillian it is optional-->

                            <dependency>

                                <groupId>org.jboss.arquillian.extension</groupId>

                                <artifactId>arquillian-transaction-bom</artifactId>

                                <version>${arquillian-transaction-version}</version>

                                 <type>pom</type>

                                <scope>test</scope>

                            </dependency>

                            <!-- this is container adapter for wildfly-->

                            <dependency>

                                <groupId>org.wildfly</groupId>

                                <artifactId>wildfly-arquillian-container-embedded</artifactId>

                                <version>${arquillian-wildfly-version}</version>

                                <scope>test</scope>

                            </dependency>

                            <!-- this is the wildfly emb.container - BUT eventually it is not a fully blown emb.container-->

                            <dependency>

                                <groupId>org.wildfly</groupId>

                                <artifactId>wildfly-embedded</artifactId>

                                <version>${arquillian-wildfly-version}</version>

                                <scope>test</scope>

                            </dependency>

                            <dependency>

                            <groupId>org.jboss.arquillian.junit</groupId>

                            <artifactId>arquillian-junit-container</artifactId>

                              <version>${arquillian-version}</version>

                            <scope>test</scope>

                        </dependency>



                 

                            <plugin>

                                <groupId>org.apache.maven.plugins</groupId>

                                <artifactId>maven-surefire-plugin</artifactId>

                                <version>${surefire-plugin-version}</version>

                                <configuration>

                                    <!-- Fork every test because it will launch a separate AS instance -->

                                    <forkMode>always</forkMode>

                                    <systemPropertyVariables>

                                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>

                                        <jboss.home>${wildfly-server-home}</jboss.home>

                                        <module.path>${wildfly-server-home}/modules</module.path>

                                    </systemPropertyVariables>

                                    <redirectTestOutputToFile>false</redirectTestOutputToFile>

                                </configuration>

                            </plugin>

                • 5. Re: Running Arquillan with /wildfly-10.0.0.Final
                  mjobanek

                  You use 8.1.0.CR2 which is still tied to WF8.

                  Replace this dependency:


                  <dependency>

                      <groupId>org.wildfly</groupId>

                      <artifactId>wildfly-arquillian-container-embedded</artifactId>   

                      <version>${arquillian-wildfly-version}</version>

                      <scope>test</scope>

                  </dependency>


                  bythis one:

                   

                  <dependency>

                      <groupId>org.wildfly.arquillian</groupId>

                      <artifactId>wildfly-arquillian-container-embedded</artifactId>   

                      <version>2.0.0.Final</version>

                      <scope>test</scope>

                  </dependency>


                  You also probably don't need to have the wildfly-embedded dependency as you are using an external container (not the embedded)

                  • 6. Re: Running Arquillan with /wildfly-10.0.0.Final
                    sharkbite

                    Hi

                     

                    I have made the following chnages:

                     

                     

                      <arquillian-wildfly-version>2.0.0.Final</arquillian-wildfly-version>


                     

                      <dependency>

                      <groupId>org.wildfly.arquillian</groupId>

                      <artifactId>wildfly-arquillian-container-embedded</artifactId>

                      <version>${arquillian-wildfly-version}</version>

                      <scope>test</scope>

                      </dependency>


                     

                                <!-- dependency>

                                    <groupId>org.wildfly</groupId>

                                    <artifactId>wildfly-embedded</artifactId>

                                    <version>${arquillian-wildfly-version}</version>

                                    <scope>test</scope>

                                </dependency -->

                    • 7. Re: Running Arquillan with /wildfly-10.0.0.Final
                      sharkbite

                      i get error

                       

                       

                      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

                        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

                        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

                        at java.lang.ClassLoader.defineClass1(Native Method)

                        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

                        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

                        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)

                        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

                        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)

                        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)

                        at java.security.AccessController.doPrivileged(Native Method)

                        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

                        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

                        at org.jboss.arquillian.core.impl.loadable.JavaSPIExtensionLoader.load(JavaSPIExtensionLoader.java:108)

                        at org.jboss.arquillian.core.impl.loadable.JavaSPIExtensionLoader.all(JavaSPIExtensionLoader.java:65)

                        at org.jboss.arquillian.core.impl.loadable.JavaSPIExtensionLoader.load(JavaSPIExtensionLoader.java:53)

                        at org.jboss.arquillian.core.impl.loadable.LoadableExtensionLoader.load(LoadableExtensionLoader.java:73)

                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                        at java.lang.reflect.Method.invoke(Method.java:498)

                        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

                        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

                        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

                        at org.jboss.arquillian.core.impl.ManagerImpl.fireProcessing(ManagerImpl.java:346)

                        at org.jboss.arquillian.core.impl.ManagerImpl.<init>(ManagerImpl.java:100)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

                        at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:156)

                        at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:111)

                        at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:97)

                        at org.jboss.arquillian.core.spi.ManagerBuilder.create(ManagerBuilder.java:77)

                        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:55)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

                        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)

                        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111)

                        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97)

                        at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)

                        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:95)

                        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)

                        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)

                        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)

                        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)

                      • 8. Re: Running Arquillan with /wildfly-10.0.0.Final
                        mjobanek

                        Could you share your arquillian.xml? Or, do you have the test somewhere available (github)...?

                        • 9. Re: Running Arquillan with /wildfly-10.0.0.Final
                          sharkbite

                          Hi Matous

                           

                          Thnak you for your help.

                           

                          I am not using arquillian.xml.I based my test and config on http://docs.jboss.org/arquillian/reference/1.0.0.Alpha1/en-US/html_single/

                           

                          Where can I find a working example of using arquillian with WildFly 10 and arquillian.xml that you are talking about?

                           

                          I did not have them GitHub. Here is a link to all relevant files:

                           

                          https://drive.google.com/folderview?id=0Bx_7eiy_kFj7akwtWnNKaDRRNG8&usp=sharing

                           

                          Thanks in advance,

                          daslan

                          • 10. Re: Running Arquillan with /wildfly-10.0.0.Final
                            mjobanek

                            Hi,

                             

                            well, that's very old doc.

                            I created three very simple examples - basically they show how to use the three types of WF arquillian container adapters.

                            The examples are here: https://github.com/MatousJobanek/examples/tree/master/wildfly-arquillian

                            For more information about differences between the three container types see here: Containers - Arquillian - Project Documentation Editor

                            Basically about terminology confusion here: terminology confusion (embedded, managed, local, remote, …)

                            If you would like to know where I got the information about embedded containers from, see here: WildFly 8.1.0 - Embedded - Arquillian - Project Documentation Editor or here: [Solved] Wildfly Embedded and Eclipse - support - Arquillian It is for WF8, but for WF10 it's almost same.