Skip to content

Commit

Permalink
Javax to jakarta cleanup plus other stuff (#393)
Browse files Browse the repository at this point in the history
* Move to Kakarta library for mail annotations and REST (JAX-RS)

* Update to Jakarta libraries

* Initial upgrade notes

* Use the latest versions of github actions modules

* Add useful info for the problematic current WebUI implementation

* Use V3 for Java 8 compat

* Downgrade jakarta.ws.rs to V3.x for Java compile version
  • Loading branch information
uhurusurfa authored Oct 1, 2024
1 parent 2570704 commit 35844db
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 160 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
os: [windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
./mvnw clean -e --debug --file pom.xml --log-file maven.log
./mvnw test -e --debug --file pom.xml --log-file maven.log
- name: Archive logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: execution-logs-${{ matrix.java_version }}-${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ $ docker build -t openas2:latest .
```

Run the OpenAS2 server, with its network set to "host", so that the WebUI can access the server.
NOTE: Some users have reported that using --net=host does not work for them and removing it solves the problem..

```console
$ docker run -it --rm --net=host -p 4080:10080 -p 4081:10081 -p 8443:8080 -v ${PWD}/config:/opt/openas2/config -v ${PWD}/data:/opt/openas2/data openas2:latest
Expand Down
21 changes: 12 additions & 9 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# OpenAS2 Server
# Version 3.11.0
# Version 3.12.0
# RELEASE NOTES
-----
The OpenAS2 project is pleased to announce the release of OpenAS2 3.11.0
The OpenAS2 project is pleased to announce the release of OpenAS2 3.12.0

The release download file is: OpenAS2Server-3.11.0.zip
The release download file is: OpenAS2Server-3.12.0.zip

The zip file contains a PDF document (OpenAS2HowTo.pdf) providing information on installing and using the application.
## NOTE: Testing covers Java 8 to 17. See Java Compatibility section of the OpenAS2 documentation for using Java 8.

Version 3.11.0 - 2024-08-22
This is a minor bugfix release:
Version 3.12.0 - 2024-10-15
This is a minor enhancement and bugfix release:
**IMPORTANT NOTE**: Please review upgrade notes below if you are upgrading

1. Enhance the handling of MDN processing and asociated resend handling to provide moer reliable error handling.
2. Enhance the Disposition-Notification-Options handler to properly support the standard.
3. Use the LTS releases of Java for testing
4. Use a SQL-92 compliant SQL format for accessing the database.
1. Change the property name in config.xml from javax.mail.properties to jakarta.mail.properties
2.

##Upgrade Notes
See the openAS2HowTo appendix for the general process on upgrading OpenAS2.

### Upgrading to 3.12 or newer any older version:
1. The property in the config.xml changed:
Change ALL occurrences of javax.mail.properties to jakarta.mail.properties in config.xml and the .properties file if you implemented it.
2. Completely replace all library files in the existing "lib" folder wit hthe ones supplied in the new install package (per recommended standard procedure in the user guide).

### Upgrading to 3.6 or newer from 3.5 (or older) version:
1. Run the following command after the upgrade of the code base is complete and BEFORE you start the OpenAS2 server:
- Open a shell (Command prompt or Powershell in Windows or a Terminal window in NIX systems)
Expand Down
70 changes: 20 additions & 50 deletions Server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,40 +204,6 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs</artifactId>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down Expand Up @@ -274,29 +240,33 @@
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>activation</artifactId>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions Server/src/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
ssl_keystore="%home%/ssl_certs.jks"
ssl_keystore_password="testas2"
partnership_file="%home%/partnerships.xml"
javax.mail.properties.file="%home%/java.mail.properties"
jakarta.mail.properties.file="%home%/java.mail.properties"
email.from="Open AS2 Server&lt;[email protected]&gt;"
email.to="your email address"
email.smtpserver="mail.openas2.org"
Expand Down Expand Up @@ -97,7 +97,7 @@
enabled="$properties.email.logger.enabled$"
only_active_msg_transfer_errors="$properties.email.logger.only_active_msg_transfer_errors$"
log_exception_trace="properties.email.logger.log_exception_trace$"
javax.mail.properties.file="$properties.javax.mail.properties.file$"
jakarta.mail.properties.file="$properties.jakarta.mail.properties.file$"
from="$properties.email.from$"
to="$properties.email.to$"
smtpserver="$properties.email.smtpserver$"
Expand Down
2 changes: 1 addition & 1 deletion Server/src/main/java/org/openas2/app/OpenAS2Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.openas2.XMLSession;
import org.openas2.lib.helper.ICryptoHelper;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import javax.crypto.Cipher;
import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.openas2.cmd.CommandRegistry;
import org.openas2.schedule.HasSchedule;

import javax.annotation.Nullable;
import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.openas2.cmd.CommandResult;
import org.openas2.cmd.processor.RestCommandProcessor;

import javax.annotation.security.RolesAllowed;
import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;

import jakarta.ws.rs.DefaultValue;
Expand Down
24 changes: 0 additions & 24 deletions Server/src/main/java/org/openas2/lib/CryptoException.java

This file was deleted.

24 changes: 0 additions & 24 deletions Server/src/main/java/org/openas2/lib/MDNException.java

This file was deleted.

24 changes: 0 additions & 24 deletions Server/src/main/java/org/openas2/lib/OpenAS2Exception.java

This file was deleted.

2 changes: 1 addition & 1 deletion Server/src/main/java/org/openas2/logging/LogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.openas2.message.Message;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.openas2.params.InvalidParameterException;
import org.openas2.partner.Partnership;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import jakarta.mail.Header;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.InternetHeaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.h2.tools.Server;
import org.openas2.OpenAS2Exception;

import javax.annotation.Nullable;
import jakarta.annotation.Nullable;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openas2.util.Properties;
import org.openas2.util.ResponseWrapper;

import javax.annotation.Nullable;
import jakarta.annotation.Nullable;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocketFactory;
Expand Down
2 changes: 1 addition & 1 deletion Server/src/main/java/org/openas2/support/FileMonitor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openas2.support;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import java.io.File;
import java.util.Date;
import java.util.LinkedList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.PrefixFileFilter;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand Down
5 changes: 5 additions & 0 deletions WebUI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ The OpenAS2 public REST api Endpoint needs to be configured with the VUE_APP_RES
```
VUE_APP_RESTAPI_URL=https://openas2/rest/api
```
### OpenAS2 Configuration
1. Enable the REST command processor config/config.xml:
restapi.command.processor.enabled="true"
1. Set the listening port for the command procesor to something usable on your server if the feault is not usable in config/config.xml:
restapi.command.processor.baseuri="http://0.0.0.0:8080"

### Compiles and hot-reloads for development
```
Expand Down
9 changes: 8 additions & 1 deletion changes.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Version 3.12.0 - 2024-10-15
This is an minor enhancement release:
**IMPORTANT NOTE**: Please review upgrade notes in the RELEASE-NOTES.md if you are upgrading
1. Switch to Jakarta package for mail and REST implementations
2. Remove r3edundant packages from maven build
3.

Version 3.11.0 - 2024-08-22
This is an minor enhancement release:
**IMPORTANT NOTE**: Please review upgrade notes in the RELEASE-NOTES.md if you are upgrading
1. Enhance the handling of MDN processing and asociated resend handling to provide moer reliable error handling.
1. Enhance the handling of MDN processing and asociated resend handling to provide more reliable error handling.
2. Enhance the Disposition-Notification-Options handler to properly support the standard.
3. Use the LTS releases of Java for testing
4. Use a SQL-92 compliant SQL format for accessing the database.
Expand Down
20 changes: 6 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs</artifactId>
<version>3.0.1</version>
<scope>provided</scope> <!--not used in run-time -->
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down Expand Up @@ -150,17 +144,15 @@
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
Expand Down

0 comments on commit 35844db

Please sign in to comment.