1 Reply Latest reply on Mar 7, 2018 8:15 AM by ctomc

    Integration Test with Arquillian cause Duplicate layer 'base' on Wildfly10

    robyp7

      I have a problem running integration-test with maven failsafe-plugin.

      Details:

       

      Wildfly 10.1.0.Final running as embedded container (with cargo-maven2-plugin) .

      JDK 1.8

      JEE API 8.0

      Arquillian wildfly version 2.1.0.Final

      (see details in pom xml uploaded here)

       

      The embedded container is composed and running by Cargo maven plugin.

      These plugin downloads wildfly server, installs it, and start and stop the wildfly server before and then after integration test phase.

      Durign this phase i get that Exception:

      20:50:26,147 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.patching.manager: org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'
        at org
      .jboss.as.patching.installation.InstallationManagerService.start(InstallationManagerService.java:86)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java
      .lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalStateException: Duplicate layer 'base'
        at org
      .jboss.as.patching.installation.LayersFactory$ProcessedLayers.addLayer(LayersFactory.java:305)
        at org
      .jboss.as.patching.installation.LayersFactory.processRoot(LayersFactory.java:182)
        at org
      .jboss.as.patching.installation.LayersFactory.process(LayersFactory.java:127)
        at org
      .jboss.as.patching.installation.LayersFactory.load(LayersFactory.java:86)
        at org
      .jboss.as.patching.installation.InstallationManagerImpl.<init>(InstallationManagerImpl.java:47)
        at org
      .jboss.as.patching.installation.InstallationManager.load(InstallationManager.java:185)
        at org
      .jboss.as.patching.installation.InstallationManagerService.load(InstallationManagerService.java:108)
        at org
      .jboss.as.patching.installation.InstallationManagerService.start(InstallationManagerService.java:62)
        
      ... 5 more

      20:50:27,897 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6)
      20:50:27,897 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("boottime-controller-initializer-step") failed - address: ([]) - failure description: {
        
      "WFLYCTL0080: Failed services" => {"jboss.patching.manager" => "org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'
        
      Caused by: java.lang.IllegalStateException: Duplicate layer 'base'"},
        
      "WFLYCTL0412: Required services that are not installed:" => ["jboss.patching.manager"],
        
      "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      20:50:27,928 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
      WFLYCTL0186
      :   Services which failed to start:  service jboss.patching.manager: org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'

      20:50:28,085 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9050/management
      20:50:28,085 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9050
      20:50:28,085 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 15471ms - Started 339 of 586 services (1 services failed or missing dependencies, 394 services are lazy, passive or on-demand)
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 63.843 s <<< FAILURE! - in id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT
      [ERROR] id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT  Time elapsed: 63.843<<< ERROR!
      org
      .jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
      Caused by: java.util.concurrent.TimeoutException: Managed server was not started within [60] s

      [INFO]
      [INFO] Results:
      [INFO]
      [ERROR] Errors:
      [ERROR]   ArquillianEmptyTestIT.id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT » Lifecycle
      [INFO]
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

       

      What's wrong?

       

      IntelliJ IDEA 2017.2.5 editor.

      The maven pom is composed by 3 profiles:

      - default: compile and package classes into war files (there is wildfly plugin to deploy it remotely) 
      - setup-cargo: download wildfly and install it (this is the only phase for cargo).
        [ it run more than one times the maven resources plugin, that install the dependent resources like modules, standalone.xml (modified with the right driver and datasource jndi reference) and others eventually dependencies need for working. ]
      - runcargo: runs integration test and start and stop the container

       

       

      My steps for build and running IT tests are:
      1)mvn clean install -P default
      2)mvn install -P setup-cargo
      3)mvn failsafe:integration-test -P runcargo

       

      Build:

       

      .....-Didea.version=2017.2.5 failsafe:integration-test -P runcargo

      ...

      [INFO] Scanning for projects...

      [INFO]                                                                        

      [INFO] ------------------------------------------------------------------------

      [INFO] Building javaee-soteria 1.0.0

      [INFO] --- maven-failsafe-plugin:2.20.1:integration-test (default-cli) @ javaee-soteria ---

      [INFO]

      [INFO] -------------------------------------------------------

      [INFO]  T E S T S

      [INFO] -------------------------------------------------------

      [INFO] Running id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT

      log4j:WARN No appenders could be found for logger (org.jboss.logging).

      log4j:WARN Please initialize the log4j system properly.

      Mar 07, 2018 1:44:26 PM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal

      WARNING: Bundles path is deprecated and no longer used.

      Mar 07, 2018 1:44:26 PM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal

      INFO: Starting container with: ["C:\Program Files\Java\jdk1.8.0_65\bin\java", -D[Standalone], -Xms64m, -Xmx512m, -Djava.net.preferIPv4Stack=true, -Djava.awt.headless=true, -Djboss.modules.system.pkgs=org.jboss.byteman, -ea, -Djboss.home.dir=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final, -Dorg.jboss.boot.log.file=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone\log\server.log, -Dlogging.configuration=file:C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone\configuration\logging.properties, -jar, C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\jboss-modules.jar, -mp, C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules;C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules, org.jboss.as.standalone, -Djboss.home.dir=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final, -Djboss.server.base.dir=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone, -Djboss.server.log.dir=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone\log, -Djboss.server.config.dir=C:\Progetti\altri\javaee-soteria-master\cargo\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone\configuration]

      13:44:28,076 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final

      ...

      ..

      13:44:33,104 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:9090

      13:44:33,295 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.patching.manager: org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'

      at org.jboss.as.patching.installation.InstallationManagerService.start(InstallationManagerService.java:86)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.IllegalStateException: Duplicate layer 'base'

      at org.jboss.as.patching.installation.LayersFactory$ProcessedLayers.addLayer(LayersFactory.java:305)

      at org.jboss.as.patching.installation.LayersFactory.processRoot(LayersFactory.java:182)

      at org.jboss.as.patching.installation.LayersFactory.process(LayersFactory.java:127)

      at org.jboss.as.patching.installation.LayersFactory.load(LayersFactory.java:86)

      at org.jboss.as.patching.installation.InstallationManagerImpl.<init>(InstallationManagerImpl.java:47)

      at org.jboss.as.patching.installation.InstallationManager.load(InstallationManager.java:185)

      at org.jboss.as.patching.installation.InstallationManagerService.load(InstallationManagerService.java:108)

      at org.jboss.as.patching.installation.InstallationManagerService.start(InstallationManagerService.java:62)

      ...

      ..

      13:44:34,336 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("boottime-controller-initializer-step") failed - address: ([]) - failure description: {

          "WFLYCTL0080: Failed services" => {"jboss.patching.manager" => "org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'

          Caused by: java.lang.IllegalStateException: Duplicate layer 'base'"},

          "WFLYCTL0412: Required services that are not installed:" => ["jboss.patching.manager"],

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

      }

      13:44:34,421 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report

      WFLYCTL0186:   Services which failed to start:      service jboss.patching.manager: org.jboss.msc.service.StartException in service jboss.patching.manager: java.lang.IllegalStateException: Duplicate layer 'base'

       

       

      13:44:34,692 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9050/management

      13:44:34,693 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9050

      13:44:34,693 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 7322ms - Started 339 of 586 services (1 services failed or missing dependencies, 394 services are lazy, passive or on-demand)

      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 63.459 s <<< FAILURE! - in id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT

      [ERROR] id.swhp.javaee.soteria.business.security.boundary.ArquillianEmptyTestIT  Time elapsed: 63.458 s  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container

      Caused by: java.util.concurrent.TimeoutException: Managed server was not started within [60] s

       

      (see details on log uploaded)

       

      I upload my pom.xml, Arquillian xml files and a detailed server log.

       

      Can you help me, please?

       

      Thank you very much

        • 1. Re: Integration Test with Arquillian cause Duplicate layer 'base' on Wildfly10
          ctomc

          the duplicate layer error you get, doesn't fail your test. it just says that you have some extra duplicate modules root path.

          Which is fine, but patch manager bit complains about it. 

          Even if that service fails, server still works just fine. so you can safely ignore it.

           

          From what it is seen from logs, you have modified default ports of the server, that is why arquillian cannot connect to the server and times out.

           

          try adding

          <property name="managementPort">9050</property>

           

          to your arquillian.xml