1 Reply Latest reply on Aug 4, 2015 9:59 AM by mjobanek

    How to get Spring + JSF container working with Arquillian

    sacky

      I face following error trying to run my basic test case with spring + JPA  + JSF + Primefaces project

       

      Could you please help?

       

          16:52:51,394 INFO  [org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension] (MSC service thread 1-11) Activating CDI extension for Spring Data JPA repositories.

              ERROR [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.deployment.unit."787b2f47-cedc-492a-bb96-e58a02b72772.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."787b2f47-cedc-492a-bb96-e58a02b72772.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "787b2f47-cedc-492a-bb96-e58a02b72772.war"

                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]

              Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found

                  at java.util.ServiceLoader.fail(ServiceLoader.java:239) [rt.jar:1.8.0_45]

                  at java.util.ServiceLoader.access$300(ServiceLoader.java:185) [rt.jar:1.8.0_45]

                  at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372) [rt.jar:1.8.0_45]

                  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) [rt.jar:1.8.0_45]

                  at java.util.ServiceLoader$1.next(ServiceLoader.java:480) [rt.jar:1.8.0_45]

                  at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:112)

                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]

                  ... 5 more

       

              ERROR [org.jboss.as.controller.management-operation] JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "787b2f47-cedc-492a-bb96-e58a02b72772.war")]) - failure description: {

                  "JBAS014671: Failed services" => {"jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"787b2f47-cedc-492a-bb96-e58a02b72772.war\"

                  Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found"},

                  "JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".beanmanager]"]

              }

              ERROR [org.jboss.as.server] JBAS015870: Deploy of deployment "787b2f47-cedc-492a-bb96-e58a02b72772.war" was rolled back with the following failure message:

              {

                  "JBAS014671: Failed services" => {"jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"787b2f47-cedc-492a-bb96-e58a02b72772.war\"

                  Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found"},

                  "JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"787b2f47-cedc-492a-bb96-e58a02b72772.war\".beanmanager]"]

              }

              INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010409: Unbound data source [java:/jdbc/cdis-db]

              INFO  [org.jboss.as.server.deployment] JBAS015877: Stopped deployment 787b2f47-cedc-492a-bb96-e58a02b72772.war (runtime-name: 787b2f47-cedc-492a-bb96-e58a02b72772.war) in 370ms

              INFO  [org.jboss.as.controller] JBAS014774: Service status report

              JBAS014775:    New missing/unsatisfied dependencies:

                    service jboss.deployment.unit."787b2f47-cedc-492a-bb96-e58a02b72772.war".beanmanager (missing) dependents: [service jboss.deployment.unit."787b2f47-cedc-492a-bb96-e58a02b72772.war".weld.weldClassIntrospector]

              JBAS014777:   Services which failed to start:      service jboss.deployment.unit."787b2f47-cedc-492a-bb96-e58a02b72772.war".INSTALL

       

       

      My deployment is as follows and datasource is defined well. pom-test.xml contains the dependencies required for my project including sprint-test, spring-core and sprint-data-jpa etc.

       

          @Deployment

          public static Archive<?> createTestArchive() {

              Archive jar = ShrinkWrap.create(WebArchive.class)

                      .addClasses(Greeter.class, PhraseBuilder.class)

                      .addAsLibraries(

                              Maven.resolver().loadPomFromClassLoaderResource("META-INF/pom-test.xml")

                                      .importRuntimeDependencies().resolve().withTransitivity().asFile())

                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

                      .addAsWebInfResource("META-INF/jboss-ds.xml")

                      ;

              System.out.println(jar.toString(true));

              return jar;

       

          }