2 Replies Latest reply on Jun 9, 2017 10:52 AM by Bartosz Majsak

    Arquillian + Wildfly 10 embedded + Omnifaces 2.5 throws ServletContainerInitializer error

    Fabi Yo Newbie

      Hi,

       

      My arquillian test is working together with an embedded wildfly 10.1, embedded h2 and primefaces 6.

       

      When I want to add omnifaces I get following stacktrace:

       

      Running candi.test.ProductTest

      candi.war:

      /WEB-INF/

      /WEB-INF/classes/

      /WEB-INF/classes/candi/

      /WEB-INF/classes/candi/data/

      /WEB-INF/classes/candi/data/operator/

      /WEB-INF/classes/candi/data/operator/MainOperator.class

      /WEB-INF/classes/candi/data/operator/ProductOperator.class

      /WEB-INF/classes/candi/data/schema/

      /WEB-INF/classes/candi/data/schema/Product.class

      /WEB-INF/classes/candi/data/schema/Product_.class

      /WEB-INF/classes/candi/data/schema/Table.class

      /WEB-INF/classes/candi/data/schema/Table_.class

      /WEB-INF/classes/candi/logic/

      /WEB-INF/classes/candi/logic/ProductLogic.class

      /WEB-INF/classes/META-INF/

      /WEB-INF/classes/META-INF/persistence.xml

      /WEB-INF/classes/log4j.properties

      /WEB-INF/beans.xml

      /WEB-INF/wildfly-ds.xml

      /WEB-INF/lib/

      /WEB-INF/lib/primefaces-6.0.jar

      /WEB-INF/lib/omnifaces-2.5.1.jar

      /WEB-INF/web.xml

      /WEB-INF/faces-config.xml

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.892 sec <<< FAILURE! - in candi.test.ProductTest

      candi.test.ProductTest  Time elapsed: 4.891 sec  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.DeploymentException: Cannot deploy: candi.war

        at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:141)

        at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:121)

        at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:83)

        at org.jboss.as.arquillian.container.CommonDeployableContainer.deploy(CommonDeployableContainer.java:236)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

        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.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

        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.proceed(EventContextImpl.java:88)

        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.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

        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.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

        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.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.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.proceed(EventContextImpl.java:88)

        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.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:426)

        at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

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

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

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

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

        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)

        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)

        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

      Caused by: java.lang.Exception: {

          "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"candi.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"candi.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"candi.war\"

         Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.omnifaces.ApplicationInitializer not found"},

          "WFLYCTL0412: Required services that are not installed:" => [

              "jboss.deployment.unit.\"candi.war\".INSTALL",

              "jboss.deployment.unit.\"candi.war\".beanmanager"

          ],

          "WFLYCTL0180: Services with missing/unavailable dependencies" => [

              "jboss.deployment.unit.\"candi.war\".batch.environment is missing [jboss.deployment.unit.\"candi.war\".beanmanager]",

              "jboss.deployment.unit.\"candi.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"candi.war\".beanmanager]"

          ]

      }

        at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getActionResult(ServerDeploymentPlanResultFuture.java:134)

        at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getResultFromNode(ServerDeploymentPlanResultFuture.java:123)

        at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:85)

        at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:42)

        at org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper.deploy(ServerDeploymentHelper.java:55)

        at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:135)

        at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:121)

        at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:83)

        at org.jboss.as.arquillian.container.CommonDeployableContainer.deploy(CommonDeployableContainer.java:236)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

        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.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

        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.proceed(EventContextImpl.java:88)

        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.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

        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.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

        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.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)

        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.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.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.proceed(EventContextImpl.java:88)

        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.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:426)

        at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

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

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

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

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

        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)

        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)

        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

       

       

      My pom.xml looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

        <modelVersion>4.0.0</modelVersion>

       

        <groupId>nuuu.com</groupId>

        <artifactId>candi</artifactId>

        <packaging>war</packaging>

        <version>1.0.0</version>

        <name>${project.artifactId}</name>

       

        <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>

        <maven.compiler.target>1.8</maven.compiler.target>

        <wildfly>10.1.0.Final</wildfly>

        </properties>

       

        <dependencyManagement>

       

        <dependencies>

       

        <dependency>

        <groupId>org.wildfly.bom</groupId>

        <artifactId>wildfly-javaee7-with-tools</artifactId>

        <version>${wildfly}</version>

        <scope>import</scope>

        <type>pom</type>

        </dependency>

       

        </dependencies>

       

        </dependencyManagement>

       

        <dependencies>

       

        <!-- Business components -->

        <dependency>

        <groupId>javax</groupId>

        <artifactId>javaee-api</artifactId>

        <version>7.0</version>

        <scope>provided</scope>

        </dependency>

       

        <!-- Logging -->

        <dependency>

        <groupId>log4j</groupId>

        <artifactId>log4j</artifactId>

        </dependency>

       

       

        <!-- Database metamodel generator -->

        <dependency>

        <groupId>org.hibernate</groupId>

        <artifactId>hibernate-jpamodelgen</artifactId>

        <scope>provided</scope>

        </dependency>

       

        <!-- Extended web component library -->

        <dependency>

        <groupId>org.primefaces</groupId>

        <artifactId>primefaces</artifactId>

        <version>6.0</version>

        </dependency>

       

        <!-- Web utility library -->

        <dependency>

        <groupId>org.omnifaces</groupId>

        <artifactId>omnifaces</artifactId>

        <version>2.5.1</version>

        </dependency>

       

        <!-- Unit testing -->

        <dependency>

        <groupId>junit</groupId>

        <artifactId>junit</artifactId>

        <scope>test</scope>

        </dependency>

       

        <!-- Integration testing -->

        <dependency>

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

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

        <scope>test</scope>

        </dependency>

       

        <!-- Embedded testing -->

        <dependency>

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

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

        <version>2.0.2.Final</version>

        <scope>test</scope>

        </dependency>

       

        <dependency>

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

        <artifactId>shrinkwrap-resolver-impl-maven</artifactId>

        <scope>test</scope>

        </dependency>

       

        </dependencies>

       

        <build>

       

        <finalName>${project.artifactId}</finalName>

       

        <plugins>

       

        <!-- Set up Eclipse project with full facets functionality -->

        <plugin>

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

        <artifactId>maven-eclipse-plugin</artifactId>

        <version>2.10</version>

        <configuration>

        <projectnatures>

        <projectnature>org.eclipse.jdt.core.javanature</projectnature>

        <projectnature>org.eclipse.m2e.core.maven2Nature</projectnature>

        <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature>

        <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>

        <projectnature>org.jboss.tools.jst.web.kb.kbnature</projectnature>

        <projectnature>org.jboss.tools.jsf.jsfnature</projectnature>

        </projectnatures>

        <buildcommands>

        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>

        <buildcommand>org.eclipse.wst.common.project.facet.core.builder</buildcommand>

        <buildcommand>org.jboss.tools.jst.web.kb.kbbuilder</buildcommand>

        <buildcommand>org.eclipse.wst.validation.validationbuilder</buildcommand>

        <buildcommand>org.eclipse.m2e.core.maven2Builder</buildcommand>

        </buildcommands>

        <!-- FIXME: projectFacets? -->

        <additionalProjectFacets>

        <java>1.8</java>

        <jst.jsf>2.2</jst.jsf>

        <jst.web>3.1</jst.web>

        <jst.cdi>2.0</jst.cdi>

        <jpt.jpa>2.1</jpt.jpa>

        </additionalProjectFacets>

        <downloadJavadocs>true</downloadJavadocs>

        <downloadSources>true</downloadSources>

        </configuration>

        </plugin>

       

        <!-- Add Hibernate generated meta-model classes as source classes -->

        <plugin>

        <groupId>org.codehaus.mojo</groupId>

        <artifactId>build-helper-maven-plugin</artifactId>

        <version>1.8</version>

        <executions>

        <execution>

        <id>add-source</id>

        <phase>generate-sources</phase>

        <goals>

        <goal>add-source</goal>

        </goals>

        <configuration>

        <sources>

        <source>

        ${project.build.directory}/generated-sources/annotations/

        </source>

        </sources>

        </configuration>

        </execution>

        </executions>

        </plugin>

       

        <!-- Avoid deleting target directory itself. Needed when marking target directory as derived source. -->

        <plugin>

        <artifactId>maven-clean-plugin</artifactId>

        <version>3.0.0</version>

        <configuration>

        <excludeDefaultDirectories>true</excludeDefaultDirectories>

        <filesets>

        <fileset>

        <directory>target</directory>

        <includes>

        <include>**/*</include>

        </includes>

        </fileset>

        </filesets>

        </configuration>

        </plugin>

       

        <!-- This specific version needed for Arquillian testing -->

        <plugin>

        <artifactId>maven-dependency-plugin</artifactId>

        <executions>

        <execution>

        <id>unpack wildfly</id>

        <phase>process-test-classes</phase>

        <goals>

        <goal>unpack</goal>

        </goals>

        <configuration>

        <artifactItems>

        <artifactItem>

        <groupId>org.wildfly</groupId>

        <artifactId>wildfly-dist</artifactId>

        <version>${wildfly}</version>

        <type>zip</type>

        <overWrite>false</overWrite>

        <outputDirectory>target</outputDirectory>

        </artifactItem>

        </artifactItems>

        </configuration>

        </execution>

        </executions>

        </plugin>

       

        <!-- Logging manager needed for running Arquillian tests -->

        <plugin>

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

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

        <version>2.17</version>

        <configuration>

        <systemPropertyVariables>

        <!-- For JUnit tests in Eclipse use -Djava.util.logging.manager=org.jboss.logmanager.LogManager as VM argument -->

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

        </systemPropertyVariables>

        <redirectTestOutputToFile>false</redirectTestOutputToFile>

        </configuration>

        </plugin>

       

        </plugins>

       

        </build>

       

      </project>

       

      I don't know why this error is thrown. When removing the omnifaces dependency, everything works fine.

       

      I have tried with different bom versions of arquillian and also different containers (8.2 for instance). Also tried different omnifaces versions. No luck...

       

      Here some articles I found on the internet about this issue, apparently I'm not the only one. No solutions is provided...

       

      arquillian + omnifaces issue · Issue #136 · omnifaces/omnifaces · GitHub

       

      classnotfoundexception - java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.om…

       

      It seems it is not an Omnifaces issue.

       

      Also, as you can see, the omnifaces jar is present on the classpath of the war that is deployed to the embedded container.

       

      How can I solve this issue?