Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ELY-2656] Migrate ws-client-integration example to Jakarta EE 10 #186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ws-client-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
We have added new user jane to the security domain and set HTTP BASIC authentication for application security domain.
Please see content of configure.cli for more information.

* Configure mutual SSL on your running wildfly instance like here: [two-way SSL in Wildfly](https://docs.jboss.org/author/display/WFLY/Using+the+Elytron+Subsystem#UsingtheElytronSubsystem-EnableTwowaySSL%252FTLSinWildFlyforApplications)
* Configure mutual SSL on your running wildfly instance like here: [two-way SSL in Wildfly](https://docs.wildfly.org/29/WildFly_Elytron_Security.html#enable-two-way-ssltls-in-wildfly-for-applications)

* Configure path to client's keystore and truststore in this project's wildfly-config.xml accordingly

Expand Down
Binary file added ws-client-integration/client-wf29-jks/client.cer
Binary file not shown.
Binary file not shown.
Binary file not shown.
58 changes: 54 additions & 4 deletions ws-client-integration/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,80 @@
<version>1.0-SNAPSHOT</version>
<artifactId>client</artifactId>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.jakarta-client-webservices>3.0.3.Final</version.jakarta-client-webservices>
<version.wildfly-jaxws-client-bom>29.0.1.Final</version.wildfly-jaxws-client-bom>
<version.junit>4.13.2</version.junit>
</properties>

<!-- Workaround https://groups.google.com/g/ehcache-users/c/U1bO6QArswQ -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.6</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.wildfly.security.jakarta</groupId>
<artifactId>jakarta-client-webservices</artifactId>
<version>${version.jakarta-client-webservices}</version>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jaxws-client-bom</artifactId>
<version>19.0.0.Beta1</version>
<version>${version.wildfly-jaxws-client-bom}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>elytron-quickstart</groupId>
<artifactId>server</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
<classifier>classes</classifier>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>${version.junit}</version>
<scope>compile</scope>
</dependency>
<!-- https://groups.google.com/g/ehcache-users/c/U1bO6QArswQ -->
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.0</version>
</dependency>
<!-- https://groups.google.com/g/ehcache-users/c/U1bO6QArswQ -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://groups.google.com/g/ehcache-users/c/U1bO6QArswQ -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>3.0.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<!-- https://github.com/spring-projects/spring-security/issues/11966 -->
<repositories>
<repository>
<id>shibboleth</id>
<url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
</repository>
</repositories>

</project>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<configuration>
<authentication-client xmlns="urn:elytron:client:1.5">
<authentication-client xmlns="urn:elytron:client:1.7">
<authentication-rules>
<rule use-configuration="auth-config" />
</authentication-rules>
<key-stores>
<key-store name="truststore" type="JKS">
<file name="/path/to/client.truststore.jks"/>
<key-store name="truststore" type="PKCS12">
<file name="../client-wf29-jks/client.truststore.pkcs12"/>
<key-store-clear-password password="secret"/>
</key-store>
<key-store name="keystore" type="JKS">
<file name="/path/to/client.keystore.jks"/>
<key-store name="keystore" type="PKCS12">
<file name="../client-wf29-jks/client.keystore.pkcs12"/>
<key-store-clear-password password="secret"/>
</key-store>
</key-stores>
Expand Down
4 changes: 2 additions & 2 deletions ws-client-integration/client/src/test/java/Client.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import jakarta.xml.ws.BindingProvider;
import jakarta.xml.ws.Service;

import org.wildfly.elytron.ws.client.example.HelloService;
import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
Expand Down
48 changes: 35 additions & 13 deletions ws-client-integration/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,64 @@
<packaging>war</packaging>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.wildfly-elytron>2.2.2.Final</version.wildfly-elytron>
<version.wildfly-ee-with-tools>29.0.1.Final</version.wildfly-ee-with-tools>
<version.jakarta.jws-api>3.0.0</version.jakarta.jws-api>
<version.maven-war-plugin>3.1.0</version.maven-war-plugin>
<version.wildfly-maven-plugin>4.2.0.Final</version.wildfly-maven-plugin>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-ee-with-tools</artifactId>
<version>${version.wildfly-ee-with-tools}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron</artifactId>
<version>1.11.0.Final</version>
<version>${version.wildfly-elytron}</version>
</dependency>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>javax.jws-api</artifactId>
<version>1.1</version>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>${version.jakarta.jws-api}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.1_spec</artifactId>
<version>1.0.2.Final</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<finalName>ws-client-integration</finalName>
<plugins>
<!-- WildFly plug-in to deploy the WAR. This allows to use mvn wildfly:deploy -->
<!-- WildFly plug-in to deploy the WAR. This allows us to use mvn wildfly:deploy -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.0.0.Final</version>
<version>${version.wildfly-maven-plugin}</version>
</plugin>

<!-- This ataches compiled classes so they can be used in client -->
<!-- This attaches compiled classes so they can be used in the client -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<version>${version.maven-war-plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wildfly.elytron.ws.client.example;

import javax.jws.WebMethod;
import javax.jws.WebService;
import jakarta.jws.WebMethod;
import jakarta.jws.WebService;
import java.io.IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.wildfly.security.auth.server.SecurityDomain;


import javax.jws.WebService;
import jakarta.jws.WebService;

/**
* The implementation of the HelloService JAX-WS Web Service.
Expand Down
26 changes: 26 additions & 0 deletions ws-client-integration/server/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
JBoss, Home of Professional Open Source
Copyright 2020, Red Hat, Inc. and/or its affiliates, and individual
contributors by the @authors tag. See the copyright.txt in the
distribution for a full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app>
<security-constraint>
<web-resource-collection>
<url-pattern>/HelloService/*</url-pattern>
</web-resource-collection>
</security-constraint>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Properties declaration of users roles for the realm 'ApplicationRealm' which is the default realm
# for application services on a new installation.
#
# This includes the following protocols: remote ejb, remote jndi, web, remote jms
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# The format of this file is as follows: -
# username=role1,role2,role3
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
# The following illustrates how an admin user could be defined.
#
#admin=PowerUser,BillingAdmin,
#guest=guest
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Properties declaration of users for the realm 'ApplicationRealm' which is the default realm
# for application services on a new installation.
#
# This includes the following protocols: remote ejb, remote jndi, web, remote jms
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# The format of this realm is as follows: -
# username=HEX( MD5( username ':' realm ':' password))
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
#$REALM_NAME=ApplicationRealm$ This line is used by the add-user utility to identify the realm name already used in this file.
#
# The following illustrates how an admin user could be defined, this
# is for illustration only and does not correspond to a usable password.
#
#admin=2a0923285184943425d1f53ddd58ec7a
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Note this file has been generated and will be overwritten if a
# logging subsystem has been defined in the XML configuration.


# Additional loggers to configure (the root logger is always configured)
loggers=sun.rmi,io.jaegertracing.Configuration,org.jboss.as.config,com.arjuna

logger.level=INFO
logger.handlers=FILE,CONSOLE

logger.sun.rmi.level=WARN
logger.sun.rmi.useParentHandlers=true

logger.io.jaegertracing.Configuration.level=WARN
logger.io.jaegertracing.Configuration.useParentHandlers=true

logger.org.jboss.as.config.level=DEBUG
logger.org.jboss.as.config.useParentHandlers=true

logger.com.arjuna.level=WARN
logger.com.arjuna.useParentHandlers=true

handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.level=INFO
handler.CONSOLE.formatter=COLOR-PATTERN
handler.CONSOLE.properties=enabled,autoFlush,target
handler.CONSOLE.enabled=true
handler.CONSOLE.autoFlush=true
handler.CONSOLE.target=SYSTEM_OUT

handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.FILE.level=ALL
handler.FILE.formatter=PATTERN
handler.FILE.properties=enabled,autoFlush,append,suffix,fileName
handler.FILE.constructorProperties=fileName,append
handler.FILE.enabled=true
handler.FILE.autoFlush=true
handler.FILE.append=true
handler.FILE.suffix=.yyyy-MM-dd
handler.FILE.fileName=/home/vagrant/elytron-examples/ws-client-integration/./standalone-wf29-jks/log/server.log

formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d{yyyy-MM-dd HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%e%n

formatter.COLOR-PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.COLOR-PATTERN.properties=pattern
formatter.COLOR-PATTERN.pattern=%K{level}%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%e%n
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Properties declaration of users groups for the realm 'ManagementRealm'.
#
# This is used for domain management, users groups membership information is used to assign the user
# specific management roles.
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# The format of this file is as follows: -
# username=role1,role2,role3
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
# The following illustrates how an admin user could be defined.
#
#admin=PowerUser,BillingAdmin,
Loading