From 82f92ac373a55dcf327ca3770b1902955c8c2273 Mon Sep 17 00:00:00 2001 From: Frederic Bregier Date: Wed, 22 Apr 2020 18:55:36 +0200 Subject: [PATCH] First fix for Issue #41 and #42 of Vitam This version of Waarp-Vitam is compatible with Vitam 2.15.3 and 3.0.2. This is a short fix for Change Behavior from Vitam client side. It should not get any issue for Waarp-Vitam users but we follow this issue with Vitam Team. See https://github.com/ProgrammeVitam/vitam/issues/41 and https://github.com/ProgrammeVitam/vitam/issues/42 Note that this module is compiled against Java 8, thus allowing anyone to use it with Java 8, 9, 10, 11 and follow, so with Vitam 2.15 and Vitam 3.0. Vitam jar are not include in the all dependencies jar anymore to counter-act the Java 11 issue from Vitam side, letting final users to choose between Java 8 and above and V2 of Vitam OR Java 11 and above and V3 of Vitam. However we work with Vitam team to get a Waarp version available for both versions 2 and 3. Note that the "all jar" versions does not include any more the Vitam jar, in order to allow you to use either v2.15.3 or v3.0.1 and following versions. You therefore need to ass the following jars with the Waarp-Vitam library: **Common Jar for both V2 and V3 versions of Vitam** *Vitam jars:* * fr.gouv.vitam:ingest-external-client * fr.gouv.vitam:common-public-client * fr.gouv.vitam:ingest-external-api * fr.gouv.vitam:access-external-client * fr.gouv.vitam:common-public * fr.gouv.vitam:common-http-interface * fr.gouv.vitam:access-external-api * fr.gouv.vitam:common-database-public **Specific to V2 version of Vitam** *Vitam jars:* * fr.gouv.vitam:access-external-common:jar:2.15.3 * fr.gouv.vitam:logbook-common-client:jar:2.15.3 * fr.gouv.vitam:logbook-common:jar:2.15.3 *Other jars: Those jars are included by default, even if Vitam V3 does not need them (no issue).* * com.github.fge:json-schema-validator:jar:2.2.6 * com.googlecode.libphonenumber:libphonenumber:jar:6.2 * com.github.fge:json-schema-core:jar:1.2.5 * com.github.fge:uri-template:jar:0.9 * org.mozilla:rhino:jar:1.7R4 * javax.mail:mailapi:jar:1.4.3 * net.sf.jopt-simple:jopt-simple:jar:4.6 --- README.md | 32 +++++++++++- pom.xml | 52 ++++++++++++++++--- .../java/org/waarp/vitam/dip/DipManager.java | 4 +- .../org/waarp/vitam/ingest/IngestManager.java | 1 + 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bb89d5e..826976d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,37 @@ Vitam introduces a version V3 that has the following issues: * Java 11 is now mandatory, despite the large usage of Java 8 out of there. This prevents a lot if final users or co-project as this one to follow easily the path taken by Vitam team. Java 11 is not yet quite a success, considering a huge number of Java projects still using Java 8 as the minimal requirement. * Several issues were encountered in using Version 3 compares to Version 2.X (last being 2.15.3): while Java API are the same, the behaviors are not, those preventing an clean upgrade from V2 to V3. -Therefore, except if V3 evolves in Java 8 and fixing those functional issues, or except if clients command to have a compatible version with V3 of Vitam, Waarp-Vitam will stay on V2 versions. +However we work with Vitam team to get a Waarp version available for both versions 2 and 3. Note that the "all jar" versions does not include any more the Vitam jar, in order to allow you to use either v2.15.3 or v3.0.1 and following versions. + +You therefore need to ass the following jars with the Waarp-Vitam library: + +**Common Jar for both V2 and V3 versions of Vitam** + +*Vitam jars:* + * fr.gouv.vitam:ingest-external-client + * fr.gouv.vitam:common-public-client + * fr.gouv.vitam:ingest-external-api + * fr.gouv.vitam:access-external-client + * fr.gouv.vitam:common-public + * fr.gouv.vitam:common-http-interface + * fr.gouv.vitam:access-external-api + * fr.gouv.vitam:common-database-public + +**Specific to V2 version of Vitam** + +*Vitam jars:* + * fr.gouv.vitam:access-external-common:jar:2.15.3 + * fr.gouv.vitam:logbook-common-client:jar:2.15.3 + * fr.gouv.vitam:logbook-common:jar:2.15.3 + +*Other jars:* + * com.github.fge:json-schema-validator:jar:2.2.6 + * com.googlecode.libphonenumber:libphonenumber:jar:6.2 + * com.github.fge:json-schema-core:jar:1.2.5 + * com.github.fge:uri-template:jar:0.9 + * org.mozilla:rhino:jar:1.7R4 + * javax.mail:mailapi:jar:1.4.3 + * net.sf.jopt-simple:jopt-simple:jar:4.6 diff --git a/pom.xml b/pom.xml index d54e971..4c0445b 100644 --- a/pom.xml +++ b/pom.xml @@ -221,18 +221,18 @@ test test 3.3.2 - 1.0.2 + 1.0.3 ${waarp-vitam.version} - 3.0.1 + 3.0.2 - 2.15.3 - 4.1.48.Final + 2.15.3 + 4.1.49.Final 2.0.30.Final 1.0.1 1.3.1 @@ -676,6 +676,7 @@ org.apache.ant Oracle com.oracle.jdbc + fr.gouv.vitam @@ -1016,7 +1017,7 @@ ${java.version} 1.8 1.8 - + 11 true true true @@ -1034,9 +1035,10 @@ 2048m - + maven-source-plugin ${maven.source.version} @@ -2364,6 +2366,42 @@ org.slf4j slf4j-api + + + com.github.fge + json-schema-validator + 2.2.6 + + + com.github.fge + json-schema-core + 1.2.5 + + + com.github.fge + uri-template + 0.9 + + + com.googlecode.libphonenumber + libphonenumber + 6.2 + + + org.mozilla + rhino + 1.7R4 + + + javax.mail + mailapi + 1.4.3 + + + net.sf.jopt-simple + jopt-simple + 4.6 + \ No newline at end of file diff --git a/src/main/java/org/waarp/vitam/dip/DipManager.java b/src/main/java/org/waarp/vitam/dip/DipManager.java index 1770374..7deb45b 100644 --- a/src/main/java/org/waarp/vitam/dip/DipManager.java +++ b/src/main/java/org/waarp/vitam/dip/DipManager.java @@ -276,7 +276,9 @@ int select(final DipRequestFactory dipRequestFactory, logger.error(ISSUE_SINCE_SELECT_PRODUCES_AN_ERROR, e); // Should retry select from the beginning try { - dipRequest.setStep(DIPStep.RETRY_SELECT, 0, dipRequestFactory); + dipRequest.setStep(DIPStep.ERROR, 500, dipRequestFactory); + // Will inform back of error which could not be fixed when reloaded + // Ignore: dipRequest.setStep(DIPStep.RETRY_SELECT, 0, dipRequestFactory); } catch (InvalidParseOperationException ex) { // very bad logger.error("FATAL: Very bad since cannot save DipRequest", ex); diff --git a/src/main/java/org/waarp/vitam/ingest/IngestManager.java b/src/main/java/org/waarp/vitam/ingest/IngestManager.java index e605f4f..9e62aad 100644 --- a/src/main/java/org/waarp/vitam/ingest/IngestManager.java +++ b/src/main/java/org/waarp/vitam/ingest/IngestManager.java @@ -540,6 +540,7 @@ boolean getStatusOfATR(final IngestRequestFactory ingestRequestFactory, } } catch (VitamClientException e) { logger.warn("Issue since ingest client produces an error", e); + ingestRequest.setStep(IngestStep.ERROR, 500, ingestRequestFactory); } finally { // Shall read all InputStream StreamUtils.consumeAnyEntityAndClose(response);