Skip to content

Commit 66e56f6

Browse files
authored
FMWPLAT was removed from WLS 14+ (#291)
1 parent c49935f commit 66e56f6

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruUtil.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
101101
Document aruRecommendations = getRecommendedPatchesMetadata(product, releaseNumber, userId, password);
102102
logger.exiting();
103103
return AruPatch.getPatches(aruRecommendations, "[./psu_bundle]");
104-
} catch (NoPatchesFoundException npe) {
104+
} catch (NoPatchesFoundException | ReleaseNotFoundException ex) {
105105
logger.exiting();
106106
return Collections.emptyList();
107107
} catch (IOException | XPathExpressionException e) {
@@ -164,7 +164,9 @@ List<AruPatch> getRecommendedPatches(AruProduct product, String version, String
164164
patches.forEach(p -> logger.info("IMG-0068", product.description(), p.patchId(), p.description()));
165165
logger.exiting(patches);
166166
return patches;
167-
} catch (NoPatchesFoundException npe) {
167+
} catch (ReleaseNotFoundException nf) {
168+
return Collections.emptyList();
169+
} catch (NoPatchesFoundException npf) {
168170
logger.info("IMG-0069", product.description(), version);
169171
return Collections.emptyList();
170172
} catch (IOException | XPathExpressionException e) {
@@ -305,6 +307,7 @@ Document getRecommendedPatchesMetadata(AruProduct product, String releaseNumber,
305307
* @param password OTN credential password
306308
* @return release number for the product and version provided
307309
* @throws AruException if the call to ARU fails, or the response from ARU had an error
310+
* @throws ReleaseNotFoundException if the specified version for the requested product was not found
308311
*/
309312
private String getReleaseNumber(AruProduct product, String version, String userId, String password)
310313
throws AruException {
@@ -322,7 +325,9 @@ private String getReleaseNumber(AruProduct product, String version, String userI
322325
throw new AruException("Could not extract release number with XPath", xpe);
323326
}
324327
if (Utils.isEmptyString(result)) {
325-
throw new AruException(Utils.getMessage("IMG-0082", product, version));
328+
String msg = Utils.getMessage("IMG-0082", version, product);
329+
logger.info(msg);
330+
throw new ReleaseNotFoundException(msg);
326331
}
327332
logger.exiting(result);
328333
return result;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2021, Oracle and/or its affiliates.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
package com.oracle.weblogic.imagetool.aru;
5+
6+
/**
7+
* For a given list of patches returned from ARU, the version requested was not found.
8+
*/
9+
public class ReleaseNotFoundException extends AruException {
10+
/**
11+
* The product/version combination was not found in the release table on ARU.
12+
*/
13+
public ReleaseNotFoundException(String message) {
14+
super(message);
15+
}
16+
}

imagetool/src/main/resources/ImageTool.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ IMG-0078=Starting build: {0}
8080
IMG-0079=OS Package Manager override, changed from {0} to {1}
8181
IMG-0080=Argument {0} does not match any FmwInstallerType names
8282
IMG-0081=Unable to retrieve list of Oracle releases from Oracle Updates (ARU). Try again later.
83-
IMG-0082=Failed to determine release number for product {0}, version {1}
83+
IMG-0082=Version {0} did not contain {1}, skipping {1}
8484
IMG-0083=Version {0} for patch ID {1} was not found in the available versions: {2}
8585
IMG-0084=No recommended patches found for {0}
8686
IMG-0085=The recommended ADR patch was skipped for the WLS installer, use --patch {0} to apply this patch

imagetool/src/test/java/com/oracle/weblogic/imagetool/aru/AruUtilTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,16 @@ void testGetLatestPsu() throws Exception {
123123
List<String> bugs = latestPsu.stream().map(AruPatch::patchId).collect(Collectors.toList());
124124
assertTrue(bugs.contains("31535411"));
125125
}
126+
127+
@Test
128+
void testReleaseNotFound() throws Exception {
129+
// should not throw an exception, and return no patches when release does not exist
130+
List<AruPatch> latestPsu =
131+
AruUtil.rest().getLatestPsu(AruProduct.WLS, "3.0.0.0.0", "x", "x");
132+
assertEquals(0, latestPsu.size());
133+
134+
List<AruPatch> recommendedPatches =
135+
AruUtil.rest().getRecommendedPatches(AruProduct.WLS, "3.0.0.0.0", "x", "x");
136+
assertEquals(0, recommendedPatches.size());
137+
}
126138
}

0 commit comments

Comments
 (0)