0

I have a configuration running succesfully on WildFly Swarm 2018.4.1. When I try to upgrade to Wildfly Swarm 2018.5.0, I run into two problems:

  1. NPE, which can be solved by following the workaround in this JIRA item:

    https://issues.jboss.org/browse/THORN-2015

After that changes the server started succesfully. However

  1. The HTTPS listener is not started. I guess it has something to do with the breaking changes in Wildfly Swarm 2018.5.0, as announced in this post:

    http://wildfly-swarm.io/posts/announcing-wildfly-swarm-2018-5-0/

    Especially the sentence:

    Default configuration of the Elytron subsystem is now much closer to WildFly’s. Elytron is the new security subsystem in WildFly, but it hasn’t received much attention in WildFly Swarm yet.

    However, I could not find what I have to change from my current configuration to support the new configuration.

What do I need to change to my configuration to get this running under WildFly Swarm 2018.5.0?

Here's is my pom (with changes to support workaround (1)):

<?xml version="1.0" encoding="UTF-8"?>
<!--
Private Module Warnings addressed in https://issues.jboss.org/browse/SWARM-1110
-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.foo</groupId>
    <artifactId>api</artifactId>
    <name>Foo Web API</name>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <version.wildfly.swarm>2018.5.0</version.wildfly.swarm>
        <version.arquillian>1.2.0.Final</version.arquillian>
        <version.postgres>42.1.4</version.postgres>
        <version.resteasy>3.1.4.Final</version.resteasy>
        <version.slf4j>1.7.25</version.slf4j>
        <version.swagger>1.5.17</version.swagger>
        <version.itext>5.5.13</version.itext>
        <version.itext.pdfhtml>2.0.1</version.itext.pdfhtml>
        <version.apache.commons>1.2</version.apache.commons>
        <version.projectlombok>1.16.18</version.projectlombok>
        <version.hibernate>5.2.12.Final</version.hibernate>
        <version.freemarker>2.3.28</version.freemarker>
        <version.junit>4.12</version.junit>
        <version.hamcrest>1.3</version.hamcrest>
        <version.jersey>2.26</version.jersey>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly.swarm</groupId>
                <artifactId>bom-all</artifactId>
                <version>${version.wildfly.swarm}</version>
                <scope>import</scope>
                <type>pom</type>
                <!-- Workaround for issue: https://issues.jboss.org/browse/THORN-2015 -->
                <exclusions>
                    <exclusion>
                        <groupId>org.wildlfy.swarm</groupId>
                        <artifactId>config-api-runtime</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.arquillian}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <finalName>webapi</finalName>
       <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.wildfly.swarm</groupId>
                <artifactId>wildfly-swarm-plugin</artifactId>
                <version>${version.wildfly.swarm}</version>       
                <executions>
                    <execution>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <additionalFractions>management</additionalFractions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <!-- here the phase you need -->
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target</outputDirectory>
                            <resources>          
                                <resource>
                                    <directory>src/non-packaged-resources</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>              
                        </configuration>            
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Add artifact for workaround in proper version -->
        <dependency> 
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>config-api-runtime</artifactId>
            <version>1.3.1</version>
        </dependency>
        <!-- Java EE 7 dependency -->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <type>jar</type>
        </dependency>
        <!-- WildFly Swarm Fractions -->
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>undertow</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>jaxrs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>cdi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>swagger</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>keycloak</artifactId>
            <!-- Workaround for issue: https://issues.jboss.org/browse/THORN-2015 -->
            <exclusions>
                <exclusion>
                    <groupId>org.wildlfy.swarm</groupId>
                    <artifactId>config-api-runtime</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>mail</artifactId>
        </dependency>
        <!-- Database dependencies -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${version.postgres}</version>
        </dependency>
        <!-- iText Dependencies -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>${version.itext}</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-pdfa</artifactId>
            <version>${version.itext}</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-xtra</artifactId>
            <version>${version.itext}</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf.tool</groupId>
            <artifactId>xmlworker</artifactId>
            <version>${version.itext}</version>
        </dependency>
        <!-- Other dependencies -->
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>${version.freemarker}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${version.hibernate}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${version.apache.commons}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${version.projectlombok}</version>
            <scope>compile</scope>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${version.slf4j}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${version.hamcrest}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>${version.jersey}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

And my project-defaults.yml:

swarm:
  mail:
    mail-sessions:
      mail-socket:
        jndi-name: java:/mail/Foo
        smtp-server:
          username: foo@bar.com
          password: xxx
          tls: true
          outbound-socket-binding-ref: mail-smtp
        debug: false
        from: for@bar.com
  network:
    socket-binding-groups:
      standard-sockets:
        outbound-socket-bindings:
          mail-smtp:
            remote-host: smtp.office365.com
            remote-port: 587
  http:
    keystore: 
      path: star_foo_com.jks
      password: xxx
    certificate:
      alias: server
  deployment:
    webapi.war:
      swagger:
        packages:
          - com.foo.api
        root: /rest/v1/
  logging:
    root-logger:
      level: INFO
    loggers:
      com.foo:
        level: DEBUG
  datasources:
    jdbc-drivers:
      org.postgresql:
        driver-class-name: org.postgresql.Driver
        xa-datasource-class-name: org.postgresql.xa.PGXADataSource
        driver-module-name: org.postgresql
    data-sources:
      FooDS:
        driver-name: org.postgresql
        connection-url: jdbc:postgresql://xxx.eu-west-1.rds.amazonaws.com:5432/postgres
        user-name: db_admin
        password: xxx
        allow-multiple-users: true
        allocation-retry-wait-millis: 100
        allocation-retry: 10
        check-valid-connection-sql: SELECT 1
        jta: true
Martijn Burger
  • 7,315
  • 8
  • 54
  • 94
  • I don't think you're affected by the Elytron fraction default configuration changes, since you don't have a dependency on the fraction. Do you have any error messages or something? – Ladicek Jun 25 '18 at 13:17
  • No error messages. Startup is clean. Just no 8443 available anymore. – Martijn Burger Jun 25 '18 at 13:28
  • Hmmm. I know the configuration keys for HTTPS were changed, new ones are under `swarm.https.keystore` and `swarm.https.key` (see http://docs.wildfly-swarm.io/2018.5.0/#_undertow), but the ones you're using (`swarm.http.keystore` and `swarm.http.certificate`) should still work. Could you try moving to the new configuration keys to see if it helps? It's a shot in the dark, but at least it should be easy to do. – Ladicek Jun 25 '18 at 19:58
  • Replaced the code with: ` https: keystore: path: star_foo_com.jks password: xxx key: alias: server` Still no 8443 available. – Martijn Burger Jun 26 '18 at 12:04
  • OK, that's what I thought, thanks for trying. At the moment, I have no idea what causes your issue. I know HTTPS works with 2018.5.0, because I have a test for it here: https://github.com/rhoar-qe/thorntail-test-suite (in `protocols/https`) -- but that's obviously a much simpler scenario than yours. I'd recommend filing a JIRA at http://issues.jboss.org/browse/THORN with a more complete reproducer if possible. – Ladicek Jun 26 '18 at 12:49
  • I'll try to create some this friday and will reference the jira item here. – Martijn Burger Jun 26 '18 at 15:22
  • I solved it, by using the workaround for this #closed# bug report: https://issues.jboss.org/browse/THORN-751 – Martijn Burger Jun 27 '18 at 15:33
  • 1
    Aaaaah I didn't notice you don't have a dependency on the `management` fraction. Yea, that's absolutely required for being able to use HTTPS. – Ladicek Jun 28 '18 at 09:32
  • Guys, it seems the problem is solved. Can you create an answer from your comments? – Michał Szynkiewicz Jul 05 '18 at 07:42

0 Answers0