Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1170

autodetection on .war archive + undertow not detected = can't create default deployment

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.4.0
    • Component/s: None
    • Labels:
      None

      Description

      Say I have an Arquillian test that creates a ShrinkWrap .war archive. Then, autodetection runs over that archive, but doesn't find anything web-related, so the undertow fraction isn't included. Then, when the uberjar boots, Swarm fails to create a default deployment, because there's no DefaultDeploymentFactory for .war-s, which means that an empty .jar is created, which leads to all kinds of interesting failures. (Actually no, I've only observed a single failure, a NPE in org.wildfly.swarm.arquillian.daemon.TestRunner.executeTest.)

      Should Swarm possibly autodetect the undertow fraction automatically, when the autodetection process runs over a .war?


      I found this issue after a couple of hours of debugging the NPE mentioned above, which appeared when running the Arquillian tests in a couple of EAP quickstarts. Here are complete steps to reproduce:

      1. git clone -b 7.0.x https://github.com/jboss-developer/jboss-eap-quickstarts.git
      2. cd jboss-eap-quickstarts/bean-validation-custom-constraint
      3. change version.jboss.bom.eap in pom.xml to 7.0.0.GA
      4. change pom.xml to include this profile:
        <profile>
            <id>arq-wildfly-swarm</id>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly.swarm</groupId>
                    <artifactId>arquillian</artifactId>
                    <version>2017.3.2</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${version.surefire.plugin}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.xml>arquillian-swarm.xml</arquillian.xml>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
      5. add src/test/resources/arquillian-swarm.xml file with this content:
        <?xml version="1.0" encoding="UTF-8"?>
        <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
            <container qualifier="wildfly-swarm" default="true">
                <configuration>
                    <property name="host">localhost</property>
                    <property name="port">${swarm.arquillian.daemon.port:12345}</property>
                </configuration>
            </container>
        </arquillian>
        
      6. mvn clean test -Parq-wildfly-swarm

      I understand that adding an explicit dependency on the undertow fraction (and on H2, because the test use a database) solves the issue. The question I'm asking is: should I have to do that?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bob.mcwhirter Bob McWhirter
                Reporter:
                lthon Ladislav Thon
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: