Skip to content

Commit

Permalink
Merge pull request #1635 from /issues/1634-wildfly-conf-and-doc
Browse files Browse the repository at this point in the history
Fix #1634: Improve WildFly documentation and configuration
  • Loading branch information
banterCZ authored May 2, 2024
2 parents 6b35a97 + 70bc450 commit 12f7fa0
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 59 deletions.
30 changes: 11 additions & 19 deletions docs/Deploying-Wildfly.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Web Flow contains the following configuration in `jboss-deployment-structure.xml

```
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand All @@ -23,11 +23,6 @@ Web Flow contains the following configuration in `jboss-deployment-structure.xml
<module name="com.wultra.powerauth.webflow.conf" />
</dependencies>
<resources>
<!-- use WAR provided Bouncy Castle -->
<resource-root path="WEB-INF/lib/bcprov-jdk18on-${BC_VERSION}.jar" use-physical-code-source="true"/>
</resources>
<local-last value="true" />
</deployment>
</jboss-deployment-structure>
Expand All @@ -36,7 +31,7 @@ Web Flow contains the following configuration in `jboss-deployment-structure.xml
Similarly, Next Step contains the following configuration in `jboss-deployment-structure.xml` file for JBoss / Wildfly:
```
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand All @@ -47,11 +42,6 @@ Similarly, Next Step contains the following configuration in `jboss-deployment-s
<module name="com.wultra.powerauth.nextstep.conf" />
</dependencies>
<resources>
<!-- use WAR provided Bouncy Castle -->
<resource-root path="WEB-INF/lib/bcprov-jdk18on-${BC_VERSION}.jar" use-physical-code-source="true"/>
</resources>
<local-last value="true" />
</deployment>
</jboss-deployment-structure>
Expand All @@ -60,7 +50,7 @@ Similarly, Next Step contains the following configuration in `jboss-deployment-s
Optionally, TPP engine contains the following configuration in `jboss-deployment-structure.xml` file for JBoss / Wildfly:
```
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand All @@ -79,7 +69,7 @@ Optionally, Web Flow Client contains the following configuration in `jboss-deplo

```
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the resource-adapters subsystem to prevent the application's HSQLDB driver
Expand Down Expand Up @@ -180,15 +170,17 @@ For Next Step you can use the same configuration, just change the variable `LOG_

The `application-ext.properties` file is used to override default configuration properties, for example:
```
# Database Configuration
spring.datasource.jndi-name=java:/jdbc/powerauth
# PowerAuth Client configuration
powerauth.service.url=http://[host]:[port]/powerauth-java-server/rest
```

Mind that you should specify `spring.datasource.jndi-name` to use the application server datasource (its declaration is out of the scope of this guideline).
When configure `spring.datasource.url`, the hikari connection pool is used.
Spring Boot running on WildFly or JBoos initializes [JtaTransactionManager](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/jta/JtaTransactionManager.html).

Web Flow Spring application uses the `ext` Spring profile which activates overriding of default properties by `application-ext.properties`.

You need to configure separate `application-ext.properties` files for Web Flow and Next Step in each module.

### Bouncy Castle Installation

The Bouncy Castle library for JBoss / Wildfly is included in the Web Flow and Next Step war files. The library is configured
using the `jboss-deployment-structure.xml` descriptor. Global module configuration of Bouncy Castle is no longer required.
13 changes: 0 additions & 13 deletions powerauth-nextstep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,6 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<webResource>
<directory>src/main/webapp/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
<filtering>true</filtering>
</webResource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
3 changes: 3 additions & 0 deletions powerauth-nextstep/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ spring.security.oauth2.resource-server.jwt.audiences=

# Monitoring
management.tracing.sampling.probability=1.0

spring.autoconfigure.exclude=\
org.springframework.boot.actuate.autoconfigure.metrics.jersey.JerseyServerMetricsAutoConfiguration
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand All @@ -10,11 +10,6 @@
<module name="com.wultra.powerauth.nextstep.conf" />
</dependencies>

<resources>
<!-- use WAR provided Bouncy Castle -->
<resource-root path="WEB-INF/lib/bcprov-jdk18on-${bcprov-jdk18on.version}.jar" use-physical-code-source="true"/>
</resources>

<local-last value="true" />
</deployment>
</jboss-deployment-structure>
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ logging.config=${POWERAUTH_TPP_ENGINE_LOGGING:}

# Monitoring
management.tracing.sampling.probability=1.0

spring.autoconfigure.exclude=\
org.springframework.boot.actuate.autoconfigure.metrics.jersey.JerseyServerMetricsAutoConfiguration
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ logging.config=${POWERAUTH_WEBFLOW_CLIENT_LOGGING:}

# Monitoring
management.tracing.sampling.probability=1.0

spring.autoconfigure.exclude=\
org.springframework.boot.actuate.autoconfigure.metrics.jersey.JerseyServerMetricsAutoConfiguration
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the resource-adapters subsystem to prevent the application's HSQLDB driver
Expand Down
13 changes: 0 additions & 13 deletions powerauth-webflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,19 +238,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<webResource>
<directory>src/main/webapp/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
<filtering>true</filtering>
</webResource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
3 changes: 3 additions & 0 deletions powerauth-webflow/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ logging.config=${POWERAUTH_WEBFLOW_LOGGING:}

# Monitoring
management.tracing.sampling.probability=1.0

spring.autoconfigure.exclude=\
org.springframework.boot.actuate.autoconfigure.metrics.jersey.JerseyServerMetricsAutoConfiguration
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
<deployment>
<exclude-subsystems>
<!-- disable the logging subsystem because the application manages its own logging independently -->
Expand All @@ -10,11 +10,6 @@
<module name="com.wultra.powerauth.webflow.conf" />
</dependencies>

<resources>
<!-- use WAR provided Bouncy Castle -->
<resource-root path="WEB-INF/lib/bcprov-jdk18on-${bcprov-jdk18on.version}.jar" use-physical-code-source="true"/>
</resources>

<local-last value="true" />
</deployment>
</jboss-deployment-structure>

0 comments on commit 12f7fa0

Please sign in to comment.