From fba6c30bbc4d24a5607c4f428d88e2942fa366cb Mon Sep 17 00:00:00 2001 From: crountre Date: Fri, 4 Oct 2019 17:38:50 -0500 Subject: [PATCH 01/19] Add unit test and fixes found by testing --- core/pom.xml | 3 +- .../weblogic/deploy/util/PyOrderedDict.java | 39 +++++++++++++++++-- core/src/main/python/create.py | 4 +- core/src/main/python/deploy.py | 4 +- core/src/main/python/discover.py | 4 +- core/src/main/python/encrypt.py | 4 +- core/src/main/python/update.py | 4 +- core/src/main/python/validate.py | 4 +- core/src/main/python/variable_inject.py | 2 +- .../wlsdeploy/logging/platform_logger.py | 1 + .../wlsdeploy/tool/create/domain_creator.py | 2 +- .../wlsdeploy/tool/create/domain_typedef.py | 2 +- .../tool/deploy/applications_deployer.py | 2 +- .../python/wlsdeploy/tool/deploy/deployer.py | 2 +- .../wlsdeploy/tool/discover/discoverer.py | 2 +- .../tool/discover/domain_info_discoverer.py | 2 +- .../wlsdeploy/tool/util/filter_helper.py | 2 +- .../python/wlsdeploy/util/model_context.py | 2 +- .../main/python/wlsdeploy/util/path_utils.py | 2 +- .../main/python/wlsdeploy/util/variables.py | 2 +- core/src/main/typedefs/JRF.json | 14 ++++++- core/src/main/typedefs/RestrictedJRF.json | 10 ++++- core/src/main/typedefs/WLS.json | 10 ++++- .../test/python/custom_folder_helper_test.py | 1 + core/src/test/python/translator_test.py | 2 +- core/src/test/python/variables_test.py | 1 + pom.xml | 33 +++++++++++++++- 27 files changed, 127 insertions(+), 33 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 7fc01264d..39ebd831a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -31,7 +31,8 @@ org.python - jython + jython-installer + 2.7.1 provided diff --git a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java index 75079ab8a..438eaebe6 100644 --- a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java +++ b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java @@ -6,6 +6,8 @@ import java.io.IOException; import java.io.ObjectInputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Type; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; @@ -280,9 +282,10 @@ public void __setitem__(PyObject key, PyObject value) { synchronized (this.linkedHashMap) { this.linkedHashMap.put(key, value); } - synchronized (super.table) { - super.table.put(key, value); - } + // do not access protected field directly. + // 2.7 version does not have table variable. + // Neither version has synchronization on the table. + super.__setitem__(key, value); } /** @@ -291,7 +294,7 @@ public void __setitem__(PyObject key, PyObject value) { @Override public void clear() { this.linkedHashMap.clear(); - super.table.clear();; + super.clear();; } /** @@ -344,6 +347,10 @@ public PyList items() { for (Map.Entry entry: entries) { l.add(new PyTuple(new PyObject[] { entry.getKey(), entry.getValue() })); } + System.out.println("Class is " + l.getClass().getName()); + for (Class i : l.getClass().getInterfaces()) { + System.out.println("Interface : " + i.getName()); + } return new PyList(l); } @@ -384,9 +391,31 @@ public PyObject iteritems() { */ @Override public PyList keys() { + + Class c = PyList.class; + Constructor[] allConstructors = c.getDeclaredConstructors(); Set keys = this.linkedHashMap.keySet(); java.util.Vector v = new java.util.Vector<>(keys.size()); v.addAll(keys); + System.out.println("########## What is the type of the vector key lists " + v.getClass().getName()); + Class cArg = v.getClass(); + for (Constructor ctor : allConstructors) { + Class[] pType = ctor.getParameterTypes(); + for (int i = 0; i < pType.length; i++) { + if (pType[i].equals(cArg)) { + System.out.format("%s%n", ctor.toGenericString()); + + Type[] gpType = ctor.getGenericParameterTypes(); + for (int j = 0; j < gpType.length; j++) { + char ch = (pType[j].equals(cArg) ? '*' : ' '); + System.out.format("%7c%s[%d]: %s%n", ch, + "GenericParameterType", j, gpType[j]); + } + break; + } + } + } + System.out.println(); return new PyList(v); } @@ -480,9 +509,11 @@ private void doUpdate(PyDictionary od) { for (int i = 0; i < pylist.size(); i++) { PyTuple tuple = (PyTuple) pylist.get(i); + System.out.println("py tuple " + tuple.toString()); this.__setitem__(Py.java2py(tuple.get(0)), Py.java2py(tuple.get(1))); super.__setitem__(Py.java2py(tuple.get(0)), Py.java2py(tuple.get(1))); } + System.out.println("LOOP ENDED"); } private void doUpdate(PyObject d,PyObject keys) { diff --git a/core/src/main/python/create.py b/core/src/main/python/create.py index 1de038d7e..2cfceb187 100644 --- a/core/src/main/python/create.py +++ b/core/src/main/python/create.py @@ -4,7 +4,7 @@ The main module for the WLSDeploy tool to create empty domains. """ -import javaos as os +import os import sys from java.io import IOException from java.lang import IllegalArgumentException @@ -463,6 +463,6 @@ def main(args): return -if __name__ == "main": +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/deploy.py b/core/src/main/python/deploy.py index b28b97e1e..6b90de38c 100644 --- a/core/src/main/python/deploy.py +++ b/core/src/main/python/deploy.py @@ -4,7 +4,7 @@ The entry point for the deployApps tool. """ -import javaos as os +import os import sys from java.io import IOException @@ -431,6 +431,6 @@ def main(args): return -if __name__ == "main": +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/discover.py b/core/src/main/python/discover.py index 9f44390b6..6644f0c7a 100644 --- a/core/src/main/python/discover.py +++ b/core/src/main/python/discover.py @@ -4,7 +4,7 @@ The entry point for the discoverDomain tool. """ -import javaos as os +import os import sys from java.io import File @@ -525,6 +525,6 @@ def main(args): __log_and_exit(model_context, exit_code, _class_name, _method_name) -if __name__ == 'main': +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/encrypt.py b/core/src/main/python/encrypt.py index e6b012de9..1e01bd107 100644 --- a/core/src/main/python/encrypt.py +++ b/core/src/main/python/encrypt.py @@ -4,7 +4,7 @@ The main module for the WLSDeploy tool to encrypt passwords. """ -import javaos as os +import os import sys from java.io import IOException @@ -285,6 +285,6 @@ def main(args): sys.exit(exit_code) -if __name__ == "main": +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/update.py b/core/src/main/python/update.py index 9d8661643..c977d1976 100644 --- a/core/src/main/python/update.py +++ b/core/src/main/python/update.py @@ -4,7 +4,7 @@ The entry point for the updateDomain tool. """ -import javaos as os +import os import sys from java.io import IOException @@ -450,6 +450,6 @@ def main(args): return -if __name__ == "main": +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/validate.py b/core/src/main/python/validate.py index 2146d620f..c7b9c4242 100644 --- a/core/src/main/python/validate.py +++ b/core/src/main/python/validate.py @@ -4,7 +4,7 @@ The WLS Deploy tooling entry point for the validateModel tool. """ -import javaos as os +import os import sys from oracle.weblogic.deploy.util import CLAException @@ -260,6 +260,6 @@ def main(args): return -if __name__ == "main": +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/variable_inject.py b/core/src/main/python/variable_inject.py index eb0c79f79..607538e2b 100644 --- a/core/src/main/python/variable_inject.py +++ b/core/src/main/python/variable_inject.py @@ -310,6 +310,6 @@ def main(args): __logger.exiting(result=exit_code, class_name=_class_name, method_name=_method_name) sys.exit(exit_code) -if __name__ == 'main': +if __name__ == '__main__' or __name__ == 'main': WebLogicDeployToolingVersion.logVersionInfo(_program_name) main(sys.argv) diff --git a/core/src/main/python/wlsdeploy/logging/platform_logger.py b/core/src/main/python/wlsdeploy/logging/platform_logger.py index c270c89b6..e0984cd5c 100644 --- a/core/src/main/python/wlsdeploy/logging/platform_logger.py +++ b/core/src/main/python/wlsdeploy/logging/platform_logger.py @@ -2,6 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ +print 'about to import JAVA.LANG classes' import java.lang.System as JSystem import java.lang.Thread as JThread import java.lang.Throwable as Throwable diff --git a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py index 00913c10e..8c90af3ee 100644 --- a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py +++ b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os import weblogic.security.internal.SerializedSystemIni as SerializedSystemIni import weblogic.security.internal.encryption.ClearOrEncryptedService as ClearOrEncryptedService from java.io import FileOutputStream diff --git a/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py b/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py index 65ce5cdc8..998f25453 100644 --- a/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py +++ b/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os import re from java.lang import IllegalArgumentException diff --git a/core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py b/core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py index 202b92d0b..3544fefc2 100644 --- a/core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py +++ b/core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py @@ -3,7 +3,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ import copy -import javaos as os +import os from java.io import ByteArrayOutputStream from java.io import File from java.io import FileNotFoundException diff --git a/core/src/main/python/wlsdeploy/tool/deploy/deployer.py b/core/src/main/python/wlsdeploy/tool/deploy/deployer.py index caa06081c..351cc0385 100644 --- a/core/src/main/python/wlsdeploy/tool/deploy/deployer.py +++ b/core/src/main/python/wlsdeploy/tool/deploy/deployer.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os from array import array from java.lang import Class diff --git a/core/src/main/python/wlsdeploy/tool/discover/discoverer.py b/core/src/main/python/wlsdeploy/tool/discover/discoverer.py index 8b0115cee..d100a1d02 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/discoverer.py +++ b/core/src/main/python/wlsdeploy/tool/discover/discoverer.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os from oracle.weblogic.deploy.aliases import AliasException from oracle.weblogic.deploy.discover import DiscoverException diff --git a/core/src/main/python/wlsdeploy/tool/discover/domain_info_discoverer.py b/core/src/main/python/wlsdeploy/tool/discover/domain_info_discoverer.py index 661fbcb67..7fa4ea510 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/domain_info_discoverer.py +++ b/core/src/main/python/wlsdeploy/tool/discover/domain_info_discoverer.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os from java.io import File diff --git a/core/src/main/python/wlsdeploy/tool/util/filter_helper.py b/core/src/main/python/wlsdeploy/tool/util/filter_helper.py index dd71747aa..8cbc39c4e 100644 --- a/core/src/main/python/wlsdeploy/tool/util/filter_helper.py +++ b/core/src/main/python/wlsdeploy/tool/util/filter_helper.py @@ -3,7 +3,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ import imp -import javaos as os +import os import sys from wlsdeploy.logging.platform_logger import PlatformLogger diff --git a/core/src/main/python/wlsdeploy/util/model_context.py b/core/src/main/python/wlsdeploy/util/model_context.py index b55a6b904..890edc7f3 100644 --- a/core/src/main/python/wlsdeploy/util/model_context.py +++ b/core/src/main/python/wlsdeploy/util/model_context.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os import tempfile from wlsdeploy.aliases.wlst_modes import WlstModes diff --git a/core/src/main/python/wlsdeploy/util/path_utils.py b/core/src/main/python/wlsdeploy/util/path_utils.py index 40db9e067..e58779ee8 100644 --- a/core/src/main/python/wlsdeploy/util/path_utils.py +++ b/core/src/main/python/wlsdeploy/util/path_utils.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os import re import java.io.File as JFile diff --git a/core/src/main/python/wlsdeploy/util/variables.py b/core/src/main/python/wlsdeploy/util/variables.py index 3128ca949..3ff7b1917 100644 --- a/core/src/main/python/wlsdeploy/util/variables.py +++ b/core/src/main/python/wlsdeploy/util/variables.py @@ -153,7 +153,7 @@ def _process_node(nodes, variables, model_context, validation_result): :param model_context: used to resolve variables in file paths """ # iterate over copy to avoid concurrent change for add/delete - if type(nodes) is OrderedDict: + if isinstance(nodes, OrderedDict): nodes_iterator = OrderedDict(nodes) else: nodes_iterator = dict(nodes) diff --git a/core/src/main/typedefs/JRF.json b/core/src/main/typedefs/JRF.json index 2a3a313cc..883a4824e 100644 --- a/core/src/main/typedefs/JRF.json +++ b/core/src/main/typedefs/JRF.json @@ -9,7 +9,8 @@ "12.1.3": "JRF_1213", "12.2.1": "JRF_12CR2", "12.2.1.3": "JRF_12CR2", - "12.2.1.4": "JRF_12CR2" + "12.2.1.4": "JRF_12CR2", + "14.1.1": "JRF_14" }, "definitions": { "JRF_11G" : { @@ -58,6 +59,17 @@ "customExtensionTemplates": [ ], "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ], "rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ] + }, + "JRF_14": { + "baseTemplate": "Basic WebLogic Server Domain", + "extensionTemplates": [ + "Oracle JRF WebServices Asynchronous services", + "Oracle WSM Policy Manager", + "Oracle Enterprise Manager" + ], + "customExtensionTemplates": [ ], + "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ], + "rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ] } }, "system-elements": { diff --git a/core/src/main/typedefs/RestrictedJRF.json b/core/src/main/typedefs/RestrictedJRF.json index e82bf7991..61b606283 100644 --- a/core/src/main/typedefs/RestrictedJRF.json +++ b/core/src/main/typedefs/RestrictedJRF.json @@ -6,7 +6,8 @@ "versions": { "12.2.1": "RJRF_12CR2", "12.2.1.3": "RJRF_12CR2", - "12.2.1.4": "RJRF_12CR2" + "12.2.1.4": "RJRF_12CR2", + "14.1.1": "RJRF-14" }, "definitions": { "RJRF_12CR2": { @@ -15,6 +16,13 @@ "customExtensionTemplates": [ ], "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR"], "rcuSchemas": [ ] + }, + "RJRF_14": { + "baseTemplate": "Basic WebLogic Server Domain", + "extensionTemplates": [ "Oracle Restricted JRF", "Oracle Enterprise Manager-Restricted JRF" ], + "customExtensionTemplates": [ ], + "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR"], + "rcuSchemas": [ ] } }, "system-elements": { diff --git a/core/src/main/typedefs/WLS.json b/core/src/main/typedefs/WLS.json index e8249d88b..1b46081f7 100644 --- a/core/src/main/typedefs/WLS.json +++ b/core/src/main/typedefs/WLS.json @@ -10,7 +10,8 @@ "12.1.3": "WLS_12CR1", "12.2.1": "WLS_12CR2", "12.2.1.3": "WLS_12CR2", - "12.2.1.4": "WLS_12CR2" + "12.2.1.4": "WLS_12CR2", + "14.1.1": "WLS_14" }, "definitions": { "WLS_11G": { @@ -33,6 +34,13 @@ "customExtensionTemplates": [ ], "serverGroupsToTarget": [ ], "rcuSchemas": [ ] + }, + "WLS_14": { + "baseTemplate": "Basic WebLogic Server Domain", + "extensionTemplates": [ ], + "customExtensionTemplates": [ ], + "serverGroupsToTarget": [ ], + "rcuSchemas": [ ] } } } diff --git a/core/src/test/python/custom_folder_helper_test.py b/core/src/test/python/custom_folder_helper_test.py index 6d843979a..55af55eb9 100644 --- a/core/src/test/python/custom_folder_helper_test.py +++ b/core/src/test/python/custom_folder_helper_test.py @@ -280,6 +280,7 @@ def is_expected_dict(self, expected_dict, converted_dict): def roll_dict(self, dict1, dict2): dict1_keys = dict1.keys() + print '***** The dict2 is of type ', type(dict2) for key in dict2.keys(): if key not in dict1_keys or dict2[key] != dict1[key]: return False diff --git a/core/src/test/python/translator_test.py b/core/src/test/python/translator_test.py index ed98b3ca0..f23933b72 100644 --- a/core/src/test/python/translator_test.py +++ b/core/src/test/python/translator_test.py @@ -2,7 +2,7 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -import javaos as os +import os import unittest from wlsdeploy.util.model_translator import FileToPython, PythonToFile diff --git a/core/src/test/python/variables_test.py b/core/src/test/python/variables_test.py index b3e088ca6..ec5d26d12 100644 --- a/core/src/test/python/variables_test.py +++ b/core/src/test/python/variables_test.py @@ -53,6 +53,7 @@ def testVariableNotFound(self): ${key} substitution is deprecated. """ model = FileToPython(self._resources_dir + '/variables-test.json', self._use_ordering).parse() + print 'type of model after parse is ', type(model) model['topology']['Name'] = '${bad.variable}' variable_map = variables.load_variables(self._variables_file) variables.substitute(model, variable_map, self.model_context) diff --git a/pom.xml b/pom.xml index faa5140a8..6ae56c288 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,9 @@ org.python jython - 2.2.1 + 2.7.1 + system + ${project.build.directory}/dependency junit @@ -79,6 +81,7 @@ + org.apache.maven.plugins maven-assembly-plugin @@ -189,6 +192,34 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + unpack-dependencies + compile + + unpack + + + + + org.python + jython-installer + 2.7.1 + jar + false + + + jython.jar,Lib/** + false + true + + + + org.apache.maven.plugins maven-compiler-plugin From 1dbf12a2f521b026fd0f0bb4b58ac51848129f96 Mon Sep 17 00:00:00 2001 From: crountre Date: Wed, 9 Oct 2019 16:46:28 -0500 Subject: [PATCH 02/19] validation support for unicode --- .../main/python/wlsdeploy/tool/validate/validation_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py index 7e7bbb98a..40292e5b7 100644 --- a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py +++ b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py @@ -131,13 +131,13 @@ def is_compatible_data_type(expected_data_type, actual_data_type): """ retval = False if expected_data_type == 'string': - retval = (actual_data_type in ["", ""]) + retval = (actual_data_type in ["", "", ""]) elif expected_data_type == 'integer': retval = (actual_data_type in ["", "", ""]) elif expected_data_type == 'long': retval = (actual_data_type in ["", "", ""]) elif expected_data_type in ['boolean', 'java.lang.Boolean']: - retval = (actual_data_type in ["", "", ""]) + retval = (actual_data_type in ["", "", "", ""]) elif expected_data_type in ['float', 'double']: retval = (actual_data_type in ["", ""]) elif expected_data_type == 'properties' or expected_data_type == 'dict': From b5abc97e919d26b062b4664c37293a33a8ff66e6 Mon Sep 17 00:00:00 2001 From: crountre Date: Thu, 17 Oct 2019 14:20:26 -0500 Subject: [PATCH 03/19] Between fixes of 2.2.1 and 2.7.1 --- core/pom.xml | 4 +- .../python/wlsdeploy/aliases/alias_utils.py | 12 +++--- .../python/wlsdeploy/json/json_translator.py | 11 +++-- .../tool/discover/custom_folder_helper.py | 24 +++++++---- .../wlsdeploy/tool/discover/discoverer.py | 2 +- .../python/wlsdeploy/tool/util/mbean_utils.py | 43 ++++++++++--------- .../wlsdeploy/tool/util/variable_injector.py | 2 +- .../tool/validate/validation_utils.py | 26 ++++++++--- .../wlsdeploy/tool/validate/validator.py | 11 +++-- core/src/main/typedefs/RestrictedJRF.json | 2 +- pom.xml | 35 ++------------- 11 files changed, 85 insertions(+), 87 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 39ebd831a..a0bd38c6d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -31,8 +31,8 @@ org.python - jython-installer - 2.7.1 + ${jython.package} + ${jython.version} provided diff --git a/core/src/main/python/wlsdeploy/aliases/alias_utils.py b/core/src/main/python/wlsdeploy/aliases/alias_utils.py index d0c12aaca..a31371933 100644 --- a/core/src/main/python/wlsdeploy/aliases/alias_utils.py +++ b/core/src/main/python/wlsdeploy/aliases/alias_utils.py @@ -74,10 +74,10 @@ def merge_model_and_existing_lists(model_list, existing_list, string_list_separa result = model_list elif model_list is None or len(model_list) == 0: result = existing_list - if type(model_list) is str and type(existing_list) is not str: + if isinstance(model_list, basestring) and not isinstance(existing_list, basestring): result = string_list_separator_char.join(existing_list) else: - model_list_is_string = type(model_list) is str + model_list_is_string = isinstance(model_list, basestring) model_set = _create_set(model_list, string_list_separator_char, 'WLSDPLY-08000') existing_set = _create_set(existing_list, string_list_separator_char, 'WLSDPLY-08001') @@ -107,7 +107,7 @@ def merge_model_and_existing_properties(model_props, existing_props, string_prop result = model_props elif model_props is None or len(model_props) == 0: result = existing_props - if type(model_props) is str and type(existing_props) is not str: + if isinstance(model_props, basestring) and isinstance(existing_props, basestring): result = _properties_to_string(existing_props, string_props_separator_char) else: model_props_is_string = False @@ -517,7 +517,7 @@ def convert_boolean(value): result = True elif value == 0: result = False - elif type(value) is str: + elif isinstance(value, basestring): if value.lower() == 'true': result = True elif value.lower() == 'false': @@ -844,7 +844,7 @@ def _get_path_separator(value): _logger.entering(value, class_name=_class_name, method_name=_method_name) result = File.pathSeparator - if type(value) is str and len(value) > 0: + if isinstance(value, basestring) and len(value) > 0: # If the value has a windows separator or a single directory that starts with a drive letter if ';' in value or _windows_path_regex.match(value): result = ';' @@ -972,7 +972,7 @@ def _properties_to_string(props, string_props_separator_char): _logger.entering(props, string_props_separator_char, class_name=_class_name, method_name=_method_name) if props is None: result = '' - elif type(props) is str: + elif isinstance(props, basestring): result = props else: result = '' diff --git a/core/src/main/python/wlsdeploy/json/json_translator.py b/core/src/main/python/wlsdeploy/json/json_translator.py index f74ee4423..53f088a6a 100644 --- a/core/src/main/python/wlsdeploy/json/json_translator.py +++ b/core/src/main/python/wlsdeploy/json/json_translator.py @@ -4,6 +4,8 @@ This model provider translation classes that convert between JSON and Python Dictionaries. """ +import types + import java.io.FileNotFoundException as JFileNotFoundException import java.io.FileOutputStream as JFileOutputStream import java.io.IOException as JIOException @@ -202,14 +204,15 @@ def _format_json_value(value): """ import java.lang.StringBuilder as StringBuilder builder = StringBuilder() - if type(value) == bool or (type(value) == str and (value == 'true' or value == 'false')): + if type(value) == bool or (isinstance(value, types.StringTypes) and (value == 'true' or value == 'false')): builder.append(JBoolean.toString(value)) - elif type(value) == str: - builder.append('"').append(_quote_embedded_quotes(value)).append('"') + elif isinstance(value, types.StringTypes): + builder.append('"').append(_quote_embedded_quotes(value.strip())).append('"') else: builder.append(value) return builder.toString() + def _quote_embedded_quotes(text): """ Quote all embedded double quotes in a string with a backslash. @@ -217,6 +220,6 @@ def _quote_embedded_quotes(text): :return: the quotes result """ result = text - if type(text) is str and '"' in text: + if isinstance(text, types.StringTypes) and '"' in text: result = text.replace('"', '\\"') return result diff --git a/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py b/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py index b50c9af56..042e98fcd 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py +++ b/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py @@ -74,7 +74,8 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name): class_name=_class_name, method_name=_method_name) short_name = attribute_helper.get_mbean_name() # This is not like other custom interface names and should be changed to be more flexible - interface_name = security_provider_interface_name(attribute_helper.get_mbean_interface_name()) + interface_name = security_provider_interface_name( + attribute_helper.get_mbean_instance(), attribute_helper.get_mbean_interface_name()) subfolder_result[mbean_name][interface_name] = PyOrderedDict() _logger.info('WLSDPLY-06751', model_type, short_name, class_name=_class_name, method_name=_method_name) _logger.info('WLSDPLY-06752', mbean_name, model_type, short_name, @@ -337,20 +338,25 @@ def equal_jarrays(array1, array2): return False -def security_provider_interface_name(mbean_interface): +def security_provider_interface_name(mbean_instance, mbean_interface_name): """ Return the name that is used to look up the custom Security Provider MBeanInfo. This is too tightly coupled to be in this class. This needs something more to differentiate Security Provider Interface which is formatted differently from other custom MBean Interface names. - :param mbean_interface: interface for the MBean - :return: massaged name specific to the Scurity Provider + :param mbean_instance: instance of the current provider + :param mbean_interface_name: interface for the MBean + :return: name returned from the mbean instance or massaged name specific to the Scurity Provider """ - result = mbean_interface - idx = mbean_interface.rfind('MBean') - if idx > 0: - result = result[:idx] + try: + getter = getattr(mbean_instance, 'getProviderClassName') + result = getter() + except AttributeError: + result = mbean_interface_name + idx = mbean_interface_name.rfind('MBean') + if idx > 0: + result = result[:idx] return result @@ -422,7 +428,7 @@ def is_empty(value): :return: True if the attribute does not contain a value """ return value is None or (type(value) in [list, dict] and len(value) == 0) or \ - ((type(value) == str or isinstance(value, String)) and + ((isinstance(value, basestring) or isinstance(value, String)) and (len(value) == 0 or value == '[]' or value == 'null' or value == 'None')) diff --git a/core/src/main/python/wlsdeploy/tool/discover/discoverer.py b/core/src/main/python/wlsdeploy/tool/discover/discoverer.py index d100a1d02..8a7d30ec3 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/discoverer.py +++ b/core/src/main/python/wlsdeploy/tool/discover/discoverer.py @@ -612,7 +612,7 @@ def _find_mbean_interface(self, location, interfaces): _method_name = '_find_mbean_interface' mbean_name = None for interface in interfaces: - interface_name = str(interface) + interface_name = str(interface.getTypeName()) if 'MBean' in interface_name: _logger.finer('WLSDPLY-06126', interface_name, self._alias_helper.get_model_folder_path(location), class_name=_class_name, method_name=_method_name) diff --git a/core/src/main/python/wlsdeploy/tool/util/mbean_utils.py b/core/src/main/python/wlsdeploy/tool/util/mbean_utils.py index 5e6e7852f..5dbfafce6 100644 --- a/core/src/main/python/wlsdeploy/tool/util/mbean_utils.py +++ b/core/src/main/python/wlsdeploy/tool/util/mbean_utils.py @@ -340,16 +340,17 @@ class MBeanAttributes(object): specific information. """ - __interface_matcher = re.compile('Bean$') + __interface_matcher = re.compile('Bean') - def __init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name): + def __init__(self, model_context, alias_helper, exception_type, location): self.__model_context = model_context self.__exception_type = exception_type self.__location = location self.__alias_helper = alias_helper - self.__mbean_interface = mbean_interface_name self.__wlst_helper = WlstHelper(_logger, exception_type) + self.__mbean_interface_name = None self.__mbean_instance = None + self.__mbean_interface = None self.__mbean_name = '' def mbean_string(self): @@ -371,10 +372,11 @@ def get_mbean_interface_name(self): Return the full name of the MBean interface class. :return: Interface name """ - return self._get_mbean_interface() + self._get_mbean_interface() + return self.__mbean_interface_name - def _get_mbean_instance(self): - _method_name = '_get_mbean_instance' + def get_mbean_instance(self): + _method_name = 'get_mbean_instance' if self.__mbean_instance is None: attribute_path = self.__alias_helper.get_wlst_attributes_path(self.__location) self.__mbean_instance = self.__wlst_helper.get_mbean(attribute_path) @@ -392,17 +394,18 @@ def _get_mbean_interface(self): if re.search(self.__interface_matcher, str(interface)) is not None] if len(interfaces) == 0: ex = exception_helper.create_exception(self._get_exception_type(), 'WLSDPLY-01777', - self._get_mbean_instance()) + str(self._get_mbean_interfaces()), self.get_mbean_instance()) _logger.throwing(ex, class_name=self.__class__.__name__, method_name=_method_name) raise ex else: if len(interfaces) > 1: - _logger.fine('WLSDPLY-01770', interfaces, self._get_mbean_instance(), + _logger.fine('WLSDPLY-01770', interfaces, self.get_mbean_instance(), class_name=self.__class__.__name__, method_name=_method_name) - interface = interfaces[0] - self.__mbean_name = interface.getSimpleName() - self.__mbean_interface = str(interface) - _logger.exiting(class_name=self.__class__.__name__, method_name=_method_name, result=self.__mbean_interface) + self.__mbean_interface = interfaces[0] + self.__mbean_name = str(self.__mbean_interface.getSimpleName()) + self.__mbean_interface_name = str(self.__mbean_interface.getTypeName()) + _logger.exiting(class_name=self.__class__.__name__, method_name=_method_name, + result=self.__mbean_interface_name) return self.__mbean_interface @@ -421,7 +424,7 @@ def _get_exception_type(self): def __get_mbean_class(self): _method_name = '__get_mbean_class' mbean_class = None - mbean_instance = self._get_mbean_instance() + mbean_instance = self.get_mbean_instance() try: getter = getattr(mbean_instance, 'getClass') mbean_class = getter() @@ -438,7 +441,7 @@ def _get_from_bean_proxy(self, getter): success = False value = None try: - get_method = getattr(self._get_mbean_instance(), getter) + get_method = getattr(self.get_mbean_instance(), getter) if get_method is not None: value = get_method() _logger.finest('WLSDPLY-01784', getter, self._get_mbean_name(), @@ -466,8 +469,8 @@ class InterfaceAttributes(MBeanAttributes): attribute methods on the WLST CMO instance. """ - def __init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name=None): - MBeanAttributes.__init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name) + def __init__(self, model_context, alias_helper, exception_type, location): + MBeanAttributes.__init__(self, model_context, alias_helper, exception_type, location) self.__interface_methods_list = None self.__interface_method_names_list = None @@ -718,8 +721,8 @@ class MBeanInfoAttributes(MBeanAttributes): __class_name = 'MBeanInfoAttributes' - def __init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name=None): - MBeanAttributes.__init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name) + def __init__(self, model_context, alias_helper, exception_type, location): + MBeanAttributes.__init__(self, model_context, alias_helper, exception_type, location) self.__weblogic_helper = WebLogicHelper(_logger) self.__mbean_info_descriptors = None @@ -886,10 +889,10 @@ def __get_mbean_info_map(self): def __get_mbean_descriptors(self): _method_name = '__get_mbean_descriptors' if self.__mbean_info_descriptors is None: - mbean_info = self.__weblogic_helper.get_bean_info_for_interface(self._get_mbean_interface()) + mbean_info = self.__weblogic_helper.get_bean_info_for_interface(self.get_mbean_interface_name()) if mbean_info is None: ex = exception_helper.create_exception(self._get_exception_type(), 'WLSDPLY-01774', - self._get_mbean_interface(), self.mbean_string()) + self.get_mbean_interface_name(), self.mbean_string()) _logger.throwing(ex, class_name=self.__class__.__name__, method_name=_method_name) raise ex self.__mbean_info_descriptors = mbean_info.getPropertyDescriptors() diff --git a/core/src/main/python/wlsdeploy/tool/util/variable_injector.py b/core/src/main/python/wlsdeploy/tool/util/variable_injector.py index e583bfb88..ab2c06dc8 100644 --- a/core/src/main/python/wlsdeploy/tool/util/variable_injector.py +++ b/core/src/main/python/wlsdeploy/tool/util/variable_injector.py @@ -728,7 +728,7 @@ def _compile_pattern(pattern): def _already_property(check_string): - return type(check_string) == str and check_string.startswith('@@PROP:') + return isinstance(check_string, basestring) and check_string.startswith('@@PROP:') def _format_as_property(prop_name): diff --git a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py index 40292e5b7..5822c8921 100644 --- a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py +++ b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py @@ -23,7 +23,16 @@ def extract_path_tokens(tokenized_value): :param tokenized_value: :return: """ - tokens = re.findall(_path_token_pattern, str(tokenized_value)) + path_pattern = _path_token_pattern + path_value = tokenized_value + print 'path is ', path_value, ' and pattern is ', path_value + print dir(path_value) + if tokenized_value.isunicode(): + path_pattern = unicode(_path_token_pattern) + elif not isinstance(tokenized_value, basestring): + path_value = str(tokenized_value) + print 'path is ', path_value, ' and pattern is ', path_value + tokens = re.findall(path_pattern, path_value) if tokens is None: # tokenized_value didn't contain any variable expressions, so # return an empty list @@ -55,6 +64,7 @@ def get_python_data_type(value): """ data_types_map = { types.StringType: 'string', + "": 'unicode', types.IntType: 'integer', types.LongType: 'long', types.FloatType: 'float', @@ -64,9 +74,11 @@ def get_python_data_type(value): types.ListType: 'list' } data_type = type(value) - + print ' *************************************************** the type is ', str(data_type) if data_type in data_types_map: rtnval = data_types_map[data_type] + elif str(data_type) in data_types_map: + rtnval = data_types_map[str(data_type)] else: rtnval = data_type @@ -133,21 +145,21 @@ def is_compatible_data_type(expected_data_type, actual_data_type): if expected_data_type == 'string': retval = (actual_data_type in ["", "", ""]) elif expected_data_type == 'integer': - retval = (actual_data_type in ["", "", ""]) + retval = (actual_data_type in ["", "", "", ""]) elif expected_data_type == 'long': - retval = (actual_data_type in ["", "", ""]) + retval = (actual_data_type in ["", "", "", ""]) elif expected_data_type in ['boolean', 'java.lang.Boolean']: retval = (actual_data_type in ["", "", "", ""]) elif expected_data_type in ['float', 'double']: - retval = (actual_data_type in ["", ""]) + retval = (actual_data_type in ["", "", ""]) elif expected_data_type == 'properties' or expected_data_type == 'dict': retval = (actual_data_type in ["", "", ""]) elif 'list' in expected_data_type: - retval = (actual_data_type in ["", ""]) + retval = (actual_data_type in ["", "", ""]) elif expected_data_type in ['password', 'credential', 'jarray']: retval = (actual_data_type in [""]) elif 'delimited_' in expected_data_type: - retval = (actual_data_type in ["", ""]) + retval = (actual_data_type in ["", "", ""]) return retval diff --git a/core/src/main/python/wlsdeploy/tool/validate/validator.py b/core/src/main/python/wlsdeploy/tool/validate/validator.py index 434a1dd0d..080cb3aa1 100644 --- a/core/src/main/python/wlsdeploy/tool/validate/validator.py +++ b/core/src/main/python/wlsdeploy/tool/validate/validator.py @@ -896,11 +896,14 @@ def __validate_path_tokens_attribute(self, attribute_name, attribute_value, mode value_data_type = validation_utils.get_python_data_type(attribute_value) + if value_data_type == 'string': + attribute_value = attribute_value.toString() + self._logger.finest('value_data_type={0}', value_data_type, class_name=_class_name, method_name=_method_name) - valid_valus_data_types = ['list', 'string'] - if value_data_type not in valid_valus_data_types: + valid_values_data_types = ['list', 'string', 'unicode'] + if value_data_type not in valid_values_data_types: validation_result.add_error('WLSDPLY-05023', attribute_name, model_folder_path, value_data_type) else: attr_values = [] @@ -908,7 +911,7 @@ def __validate_path_tokens_attribute(self, attribute_name, attribute_value, mode if value_data_type == 'string' and model_constants.MODEL_LIST_DELIMITER in attribute_value: attr_values = attribute_value.split(model_constants.MODEL_LIST_DELIMITER) - elif value_data_type == 'string': + elif value_data_type in ['string', 'unicode']: attr_values.append(attribute_value) else: @@ -983,7 +986,7 @@ def __validate_server_group_targeting_limits(self, attribute_name, attribute_val key, validation_result = \ _report_unsupported_variable_usage(key, model_folder_path, validation_result) - if type(value) is str and MODEL_LIST_DELIMITER in value: + if isinstance(value, basestring) and MODEL_LIST_DELIMITER in value: value = value.split(MODEL_LIST_DELIMITER) if type(value) is list: diff --git a/core/src/main/typedefs/RestrictedJRF.json b/core/src/main/typedefs/RestrictedJRF.json index 61b606283..7988abd9a 100644 --- a/core/src/main/typedefs/RestrictedJRF.json +++ b/core/src/main/typedefs/RestrictedJRF.json @@ -7,7 +7,7 @@ "12.2.1": "RJRF_12CR2", "12.2.1.3": "RJRF_12CR2", "12.2.1.4": "RJRF_12CR2", - "14.1.1": "RJRF-14" + "14.1.1": "RJRF_14" }, "definitions": { "RJRF_12CR2": { diff --git a/pom.xml b/pom.xml index 6ae56c288..3cc23f960 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,8 @@ .flattened-pom.xml,target/** src/test/** ${env.WLST_DIR} + ${env.JYTHON_PACKAGE} + ${env.JYTHON_VERSION} @@ -66,9 +68,7 @@ org.python jython - 2.7.1 - system - ${project.build.directory}/dependency + 2.2.1 junit @@ -81,7 +81,6 @@ - org.apache.maven.plugins maven-assembly-plugin @@ -192,34 +191,6 @@ - - org.apache.maven.plugins - maven-dependency-plugin - 3.1.1 - - - unpack-dependencies - compile - - unpack - - - - - org.python - jython-installer - 2.7.1 - jar - false - - - jython.jar,Lib/** - false - true - - - - org.apache.maven.plugins maven-compiler-plugin From caf45ec46c6d76dd1ad0ea6e69a785410f366e94 Mon Sep 17 00:00:00 2001 From: crountre Date: Thu, 17 Oct 2019 15:34:23 -0500 Subject: [PATCH 04/19] Change pom for unit tests to pull in correct jython version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3cc23f960..862c0601f 100644 --- a/pom.xml +++ b/pom.xml @@ -67,8 +67,8 @@ org.python - jython - 2.2.1 + ${jython.package} + ${jython.version} junit From 14b5c2325edf72920f3b468614b175e340ac9176 Mon Sep 17 00:00:00 2001 From: crountre Date: Thu, 17 Oct 2019 17:18:54 -0500 Subject: [PATCH 05/19] change scripts to support jdk 10 and jdk 11 --- installer/src/main/bin/createDomain.cmd | 21 ++++++++++++++------- installer/src/main/bin/deployApps.cmd | 21 ++++++++++++++------- installer/src/main/bin/discoverDomain.cmd | 13 ++++++++++--- installer/src/main/bin/encryptModel.cmd | 21 ++++++++++++++------- installer/src/main/bin/injectVariables.cmd | 11 +++++++++-- installer/src/main/bin/updateDomain.cmd | 21 ++++++++++++++------- installer/src/main/bin/validateModel.cmd | 11 +++++++++-- 7 files changed, 84 insertions(+), 35 deletions(-) diff --git a/installer/src/main/bin/createDomain.cmd b/installer/src/main/bin/createDomain.cmd index 92fae8649..27e930bdc 100644 --- a/installer/src/main/bin/createDomain.cmd +++ b/installer/src/main/bin/createDomain.cmd @@ -164,15 +164,22 @@ IF "%DOMAIN_TYPE%"=="" ( @rem FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS %MIN_JDK_VERSION% ( - IF %JVM_VERSION% LSS 7 ( - ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 - ) ELSE ( - ECHO JDK version 1.8 or higher is required when using encryption >&2 - ) +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS %MIN_JDK_VERSION% ( + SET JVM_SUPPORTED=0 + IF %JVM_VERSION_PART_TWO% LSS 7 ( + ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 + ) ELSE ( + ECHO JDK version 1.8 or higher is required when using encryption >&2 + ) + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( SET RETURN_CODE=2 GOTO exit_script ) ELSE ( diff --git a/installer/src/main/bin/deployApps.cmd b/installer/src/main/bin/deployApps.cmd index 227811ff0..32c0a178f 100644 --- a/installer/src/main/bin/deployApps.cmd +++ b/installer/src/main/bin/deployApps.cmd @@ -161,15 +161,22 @@ IF "%DOMAIN_TYPE%"=="" ( @rem FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS %MIN_JDK_VERSION% ( - IF %JVM_VERSION% LSS 7 ( - ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 - ) ELSE ( - ECHO JDK version 1.8 or higher is required when using encryption >&2 - ) +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS %MIN_JDK_VERSION% ( + SET JVM_SUPPORTED=0 + IF %JVM_VERSION_PART_TWO% LSS 7 ( + ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 + ) ELSE ( + ECHO JDK version 1.8 or higher is required when using encryption >&2 + ) + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( SET RETURN_CODE=2 GOTO exit_script ) ELSE ( diff --git a/installer/src/main/bin/discoverDomain.cmd b/installer/src/main/bin/discoverDomain.cmd index 1c6a93d7d..eb4e200ac 100644 --- a/installer/src/main/bin/discoverDomain.cmd +++ b/installer/src/main/bin/discoverDomain.cmd @@ -74,7 +74,7 @@ IF %WLSDEPLOY_HOME:~-1%==\ SET WLSDEPLOY_HOME=%WLSDEPLOY_HOME:~0,-1% @rem JDK 7 or higher JVM (and that it isn't OpenJDK). @rem IF NOT DEFINED JAVA_HOME ( - ECHO Please set the JAVA_HOME environment variable to point to a Java 7 installation >&2 + ECHO Please set the JAVA_HOME environment variable to point to a Java 7 or later installation >&2 SET RETURN_CODE=2 GOTO exit_script ) ELSE ( @@ -105,10 +105,17 @@ FOR /F %%i IN ('%JAVA_EXE% -version 2^>^&1') DO ( FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS 7 ( +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS 7 ( + SET JVM_SUPPORTED=0 + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 SET RETURN_CODE=2 GOTO exit_script diff --git a/installer/src/main/bin/encryptModel.cmd b/installer/src/main/bin/encryptModel.cmd index c7588ac2f..9f47051f3 100644 --- a/installer/src/main/bin/encryptModel.cmd +++ b/installer/src/main/bin/encryptModel.cmd @@ -108,15 +108,22 @@ FOR /F %%i IN ('%JAVA_EXE% -version 2^>^&1') DO ( FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS 8 ( - IF %JVM_VERSION% LSS 7 ( - ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 - ) ELSE ( - ECHO JDK version 1.8 or higher is required when using encryption >&2 - ) +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS %MIN_JDK_VERSION% ( + SET JVM_SUPPORTED=0 + IF %JVM_VERSION_PART_TWO% LSS 7 ( + ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 + ) ELSE ( + ECHO JDK version 1.8 or higher is required when using encryption >&2 + ) + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( SET RETURN_CODE=2 GOTO exit_script ) ELSE ( diff --git a/installer/src/main/bin/injectVariables.cmd b/installer/src/main/bin/injectVariables.cmd index 6396bfec5..b6fae7bea 100644 --- a/installer/src/main/bin/injectVariables.cmd +++ b/installer/src/main/bin/injectVariables.cmd @@ -107,10 +107,17 @@ FOR /F %%i IN ('%JAVA_EXE% -version 2^>^&1') DO ( FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS 7 ( +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS 7 ( + SET JVM_SUPPORTED=0 + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 SET RETURN_CODE=2 GOTO exit_script diff --git a/installer/src/main/bin/updateDomain.cmd b/installer/src/main/bin/updateDomain.cmd index 8f692e57c..0004c6a7e 100644 --- a/installer/src/main/bin/updateDomain.cmd +++ b/installer/src/main/bin/updateDomain.cmd @@ -161,15 +161,22 @@ IF "%DOMAIN_TYPE%"=="" ( @rem FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS %MIN_JDK_VERSION% ( - IF %JVM_VERSION% LSS 7 ( - ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 - ) ELSE ( - ECHO JDK version 1.8 or higher is required when using encryption >&2 - ) +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS %MIN_JDK_VERSION% ( + SET JVM_SUPPORTED=0 + IF %JVM_VERSION_PART_TWO% LSS 7 ( + ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 + ) ELSE ( + ECHO JDK version 1.8 or higher is required when using encryption >&2 + ) + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( SET RETURN_CODE=2 GOTO exit_script ) ELSE ( diff --git a/installer/src/main/bin/validateModel.cmd b/installer/src/main/bin/validateModel.cmd index dc08d5c7a..2f6553ef4 100644 --- a/installer/src/main/bin/validateModel.cmd +++ b/installer/src/main/bin/validateModel.cmd @@ -144,10 +144,17 @@ FOR /F %%i IN ('%JAVA_EXE% -version 2^>^&1') DO ( FOR /F tokens^=2-5^ delims^=.-_^" %%j IN ('%JAVA_EXE% -fullversion 2^>^&1') DO ( SET "JVM_FULL_VERSION=%%j.%%k.%%l_%%m" - SET "JVM_VERSION=%%k" + SET "JVM_VERSION_PART_ONE=%%j" + SET "JVM_VERSION_PART_TWO=%%k" ) -IF %JVM_VERSION% LSS 7 ( +SET JVM_SUPPORTED=1 +IF %JVM_VERSION_PART_ONE% LEQ 1 ( + IF %JVM_VERSION_PART_TWO% LSS 7 ( + SET JVM_SUPPORTED=0 + ) +) +IF %JVM_SUPPORTED% NEQ 1 ( ECHO You are using an unsupported JDK version %JVM_FULL_VERSION% >&2 SET RETURN_CODE=2 GOTO exit_script From e718009560091df86637e89db9223c06b8efd630 Mon Sep 17 00:00:00 2001 From: crountre Date: Fri, 18 Oct 2019 08:44:20 -0500 Subject: [PATCH 06/19] Fix Java version checking in shell scripts --- installer/src/main/bin/createDomain.sh | 20 +++++++++++--------- installer/src/main/bin/deployApps.sh | 20 +++++++++++--------- installer/src/main/bin/discoverDomain.sh | 14 ++++++++------ installer/src/main/bin/encryptModel.sh | 20 +++++++++++--------- installer/src/main/bin/injectVariables.sh | 14 ++++++++------ installer/src/main/bin/updateDomain.sh | 20 +++++++++++--------- installer/src/main/bin/validateModel.sh | 14 ++++++++------ 7 files changed, 68 insertions(+), 54 deletions(-) diff --git a/installer/src/main/bin/createDomain.sh b/installer/src/main/bin/createDomain.sh index 965d9efbf..3a39e6be2 100644 --- a/installer/src/main/bin/createDomain.sh +++ b/installer/src/main/bin/createDomain.sh @@ -211,18 +211,20 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 + fi + exit 2 fi - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/deployApps.sh b/installer/src/main/bin/deployApps.sh index 7d21c28e9..98fdc6de7 100644 --- a/installer/src/main/bin/deployApps.sh +++ b/installer/src/main/bin/deployApps.sh @@ -189,18 +189,20 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 + fi + exit 2 fi - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/discoverDomain.sh b/installer/src/main/bin/discoverDomain.sh index 16aecc6ad..a2b443165 100644 --- a/installer/src/main/bin/discoverDomain.sh +++ b/installer/src/main/bin/discoverDomain.sh @@ -124,14 +124,16 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 + fi fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/encryptModel.sh b/installer/src/main/bin/encryptModel.sh index 1c9b88891..88bc629c2 100644 --- a/installer/src/main/bin/encryptModel.sh +++ b/installer/src/main/bin/encryptModel.sh @@ -124,18 +124,20 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt 8 ]; then - if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 8 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 + fi + exit 2 fi - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/injectVariables.sh b/installer/src/main/bin/injectVariables.sh index 6d24ca463..56484bfbf 100644 --- a/installer/src/main/bin/injectVariables.sh +++ b/installer/src/main/bin/injectVariables.sh @@ -136,14 +136,16 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 + fi fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/updateDomain.sh b/installer/src/main/bin/updateDomain.sh index 385c533ac..df2e5411f 100644 --- a/installer/src/main/bin/updateDomain.sh +++ b/installer/src/main/bin/updateDomain.sh @@ -188,18 +188,20 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 + fi + exit 2 fi - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/validateModel.sh b/installer/src/main/bin/validateModel.sh index 68f3d29cf..5691e7c22 100644 --- a/installer/src/main/bin/validateModel.sh +++ b/installer/src/main/bin/validateModel.sh @@ -151,14 +151,16 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` +JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` -if [ ${JVM_VERSION} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 -else - echo "JDK version is ${JVM_FULL_VERSION}" +if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then + if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 + fi fi +echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message From 9a13bd011525b29e44f34098070a6324dfc29eb7 Mon Sep 17 00:00:00 2001 From: crountre Date: Fri, 18 Oct 2019 09:51:31 -0500 Subject: [PATCH 07/19] message for jrf in 14.1.1 no supported and pom changes --- core/pom.xml | 2 ++ .../oracle/weblogic/deploy/util/PyOrderedDict.java | 1 + .../python/wlsdeploy/tool/create/domain_typedef.py | 6 ++++++ .../deploy/messages/wlsdeploy_rb.properties | 1 + core/src/main/typedefs/JRF.json | 13 +------------ core/src/main/typedefs/RestrictedJRF.json | 9 +-------- pom.xml | 4 ++-- 7 files changed, 14 insertions(+), 22 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index a0bd38c6d..287ad216f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -16,6 +16,8 @@ + ${jython.package} + ${jython.version} diff --git a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java index 438eaebe6..ca0ef4c90 100644 --- a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java +++ b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java @@ -534,6 +534,7 @@ private static PyObject doDeepCopy(PyObject orig, PyObject memo) { case "long": case "NoneType": case "str": + case "unicode": result = orig; break; diff --git a/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py b/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py index 998f25453..b62a289c2 100644 --- a/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py +++ b/core/src/main/python/wlsdeploy/tool/create/domain_typedef.py @@ -18,6 +18,7 @@ CREATE_DOMAIN = 'createDomain' UPDATE_DOMAIN = 'updateDomain' +NOT_SUPPORTED = 'NOT_SUPPORTED' class DomainTypedef(object): @@ -370,6 +371,7 @@ def __get_version_typedef(self): raise ex self._version_typedef_name = self.__match_version_typedef(self._domain_typedefs_dict['versions']) + if self._version_typedef_name in self._domain_typedefs_dict['definitions']: result = self._domain_typedefs_dict['definitions'][self._version_typedef_name] else: @@ -417,6 +419,10 @@ def __match_version_typedef(self, versions_dict): self._domain_typedef_filename, wls_version) self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name) raise ex + if result == NOT_SUPPORTED: + ex = exception_helper.create_create_exception('WLSDPLY-12313', self._domain_type, wls_version) + self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name) + raise ex self._logger.exiting(self.__class_name, _method_name, result) return result diff --git a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties index 2659731dd..8dc051669 100644 --- a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties +++ b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties @@ -1160,6 +1160,7 @@ WLSDPLY-12309=Domain type {0} type definition in file {1} did not contain a vers WLSDPLY-12310=Version {0} returned from the domain home WLSDPLY-12311=Targeting type "{0}" in type definition file {1} is not allowed for WebLogic version {2} WLSDPLY-12312=Targeting type "{0}" in type definition file {1} is not valid +WLSDPLY-12313=Domain type {0} is not supported for WebLogic version {1} # create.py WLSDPLY-12400={0} got the JAVA_HOME {1} from the environment variable but it was not a valid location: {2} diff --git a/core/src/main/typedefs/JRF.json b/core/src/main/typedefs/JRF.json index 883a4824e..4b106bc2d 100644 --- a/core/src/main/typedefs/JRF.json +++ b/core/src/main/typedefs/JRF.json @@ -10,7 +10,7 @@ "12.2.1": "JRF_12CR2", "12.2.1.3": "JRF_12CR2", "12.2.1.4": "JRF_12CR2", - "14.1.1": "JRF_14" + "14.1.1": "NOT_SUPPORTED" }, "definitions": { "JRF_11G" : { @@ -59,17 +59,6 @@ "customExtensionTemplates": [ ], "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ], "rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ] - }, - "JRF_14": { - "baseTemplate": "Basic WebLogic Server Domain", - "extensionTemplates": [ - "Oracle JRF WebServices Asynchronous services", - "Oracle WSM Policy Manager", - "Oracle Enterprise Manager" - ], - "customExtensionTemplates": [ ], - "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ], - "rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ] } }, "system-elements": { diff --git a/core/src/main/typedefs/RestrictedJRF.json b/core/src/main/typedefs/RestrictedJRF.json index 7988abd9a..4c5d4c73b 100644 --- a/core/src/main/typedefs/RestrictedJRF.json +++ b/core/src/main/typedefs/RestrictedJRF.json @@ -7,7 +7,7 @@ "12.2.1": "RJRF_12CR2", "12.2.1.3": "RJRF_12CR2", "12.2.1.4": "RJRF_12CR2", - "14.1.1": "RJRF_14" + "14.1.1": "NOT_SUPPORTED" }, "definitions": { "RJRF_12CR2": { @@ -16,13 +16,6 @@ "customExtensionTemplates": [ ], "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR"], "rcuSchemas": [ ] - }, - "RJRF_14": { - "baseTemplate": "Basic WebLogic Server Domain", - "extensionTemplates": [ "Oracle Restricted JRF", "Oracle Enterprise Manager-Restricted JRF" ], - "customExtensionTemplates": [ ], - "serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR"], - "rcuSchemas": [ ] } }, "system-elements": { diff --git a/pom.xml b/pom.xml index 862c0601f..43e72d65e 100644 --- a/pom.xml +++ b/pom.xml @@ -49,8 +49,8 @@ .flattened-pom.xml,target/** src/test/** ${env.WLST_DIR} - ${env.JYTHON_PACKAGE} - ${env.JYTHON_VERSION} + ${jython.package} + ${jython.version} From 1f9c751fa78348533badac14319e3b58e921ad75 Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 18 Oct 2019 14:25:56 -0500 Subject: [PATCH 08/19] updated shell scripts to support JDK greater than 1.8 --- installer/src/main/bin/createDomain.sh | 25 +++++++++++++---------- installer/src/main/bin/deployApps.sh | 25 +++++++++++++---------- installer/src/main/bin/discoverDomain.sh | 20 ++++++++++-------- installer/src/main/bin/encryptModel.sh | 25 +++++++++++++---------- installer/src/main/bin/injectVariables.sh | 19 +++++++++-------- installer/src/main/bin/updateDomain.sh | 25 +++++++++++++---------- installer/src/main/bin/validateModel.sh | 19 +++++++++-------- 7 files changed, 90 insertions(+), 68 deletions(-) diff --git a/installer/src/main/bin/createDomain.sh b/installer/src/main/bin/createDomain.sh index 3a39e6be2..745859c99 100644 --- a/installer/src/main/bin/createDomain.sh +++ b/installer/src/main/bin/createDomain.sh @@ -211,20 +211,23 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 - fi - exit 2 +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 fi + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/deployApps.sh b/installer/src/main/bin/deployApps.sh index 98fdc6de7..e9a745efa 100644 --- a/installer/src/main/bin/deployApps.sh +++ b/installer/src/main/bin/deployApps.sh @@ -189,20 +189,23 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 - fi - exit 2 +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 fi + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/discoverDomain.sh b/installer/src/main/bin/discoverDomain.sh index a2b443165..1010ecedb 100644 --- a/installer/src/main/bin/discoverDomain.sh +++ b/installer/src/main/bin/discoverDomain.sh @@ -124,16 +124,20 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 - fi +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` + echo "set JVM version to minor " ${JVM_VERSION} +fi + +if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/encryptModel.sh b/installer/src/main/bin/encryptModel.sh index 88bc629c2..8ac914336 100644 --- a/installer/src/main/bin/encryptModel.sh +++ b/installer/src/main/bin/encryptModel.sh @@ -124,20 +124,23 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 8 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 - fi - exit 2 +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt 8 ]; then + if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 fi + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/injectVariables.sh b/installer/src/main/bin/injectVariables.sh index 56484bfbf..0e535c6ff 100644 --- a/installer/src/main/bin/injectVariables.sh +++ b/installer/src/main/bin/injectVariables.sh @@ -136,16 +136,19 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 - fi +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message diff --git a/installer/src/main/bin/updateDomain.sh b/installer/src/main/bin/updateDomain.sh index df2e5411f..09627e18f 100644 --- a/installer/src/main/bin/updateDomain.sh +++ b/installer/src/main/bin/updateDomain.sh @@ -188,20 +188,23 @@ fi # Validate the JVM version based on whether or not the user asked us to use encryption # JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt ${MIN_JDK_VERSION} ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - else - echo "JDK version 1.8 or higher is required when using encryption" >&2 - fi - exit 2 +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then + if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + else + echo "JDK version 1.8 or higher is required when using encryption" >&2 fi + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check for values of required arguments for this script to continue. diff --git a/installer/src/main/bin/validateModel.sh b/installer/src/main/bin/validateModel.sh index 5691e7c22..d822c5adb 100644 --- a/installer/src/main/bin/validateModel.sh +++ b/installer/src/main/bin/validateModel.sh @@ -151,16 +151,19 @@ case "${JVM_OUTPUT}" in esac JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'` -JVM_VERSION_PART_ONE=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -JVM_VERSION_PART_TWO=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +# set JVM version to the major version, unless equal to 1, like 1.8.0, then use the minor version +JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $1 }'` -if [ ${JVM_VERSION_PART_ONE} -le 1 ]; then - if [ ${JVM_VERSION_PART_TWO} -lt 7 ]; then - echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 - exit 2 - fi +if [ "${JVM_VERSION}" -eq "1" ]; then + JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'` +fi + +if [ ${JVM_VERSION} -lt 7 ]; then + echo "You are using an unsupported JDK version ${JVM_FULL_VERSION}" >&2 + exit 2 +else + echo "JDK version is ${JVM_FULL_VERSION}" fi -echo "JDK version is ${JVM_FULL_VERSION}" # # Check to see if no args were given and print the usage message From 9888b4c9f5acea0e62bf385efa3e7e53b79a3bd7 Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 18 Oct 2019 15:07:04 -0500 Subject: [PATCH 09/19] toString no longer exists in Jython 2.7.1 --- core/src/main/python/wlsdeploy/tool/validate/validator.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/src/main/python/wlsdeploy/tool/validate/validator.py b/core/src/main/python/wlsdeploy/tool/validate/validator.py index 080cb3aa1..694cccc72 100644 --- a/core/src/main/python/wlsdeploy/tool/validate/validator.py +++ b/core/src/main/python/wlsdeploy/tool/validate/validator.py @@ -896,9 +896,6 @@ def __validate_path_tokens_attribute(self, attribute_name, attribute_value, mode value_data_type = validation_utils.get_python_data_type(attribute_value) - if value_data_type == 'string': - attribute_value = attribute_value.toString() - self._logger.finest('value_data_type={0}', value_data_type, class_name=_class_name, method_name=_method_name) From 793cccf54cfce95fda56c6876e10b1d2e22f0e0b Mon Sep 17 00:00:00 2001 From: crountre Date: Fri, 18 Oct 2019 15:34:40 -0500 Subject: [PATCH 10/19] remove prints and change pom --- core/pom.xml | 2 -- core/src/main/python/wlsdeploy/logging/platform_logger.py | 1 - .../main/python/wlsdeploy/tool/validate/validation_utils.py | 4 ---- core/src/test/python/custom_folder_helper_test.py | 1 - core/src/test/python/variable_injector_test.py | 1 - core/src/test/python/variables_test.py | 1 - pom.xml | 4 ++-- 7 files changed, 2 insertions(+), 12 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 287ad216f..a0bd38c6d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -16,8 +16,6 @@ - ${jython.package} - ${jython.version} diff --git a/core/src/main/python/wlsdeploy/logging/platform_logger.py b/core/src/main/python/wlsdeploy/logging/platform_logger.py index e0984cd5c..c270c89b6 100644 --- a/core/src/main/python/wlsdeploy/logging/platform_logger.py +++ b/core/src/main/python/wlsdeploy/logging/platform_logger.py @@ -2,7 +2,6 @@ Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. """ -print 'about to import JAVA.LANG classes' import java.lang.System as JSystem import java.lang.Thread as JThread import java.lang.Throwable as Throwable diff --git a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py index 5822c8921..66ee9b33d 100644 --- a/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py +++ b/core/src/main/python/wlsdeploy/tool/validate/validation_utils.py @@ -25,13 +25,10 @@ def extract_path_tokens(tokenized_value): """ path_pattern = _path_token_pattern path_value = tokenized_value - print 'path is ', path_value, ' and pattern is ', path_value - print dir(path_value) if tokenized_value.isunicode(): path_pattern = unicode(_path_token_pattern) elif not isinstance(tokenized_value, basestring): path_value = str(tokenized_value) - print 'path is ', path_value, ' and pattern is ', path_value tokens = re.findall(path_pattern, path_value) if tokens is None: # tokenized_value didn't contain any variable expressions, so @@ -74,7 +71,6 @@ def get_python_data_type(value): types.ListType: 'list' } data_type = type(value) - print ' *************************************************** the type is ', str(data_type) if data_type in data_types_map: rtnval = data_types_map[data_type] elif str(data_type) in data_types_map: diff --git a/core/src/test/python/custom_folder_helper_test.py b/core/src/test/python/custom_folder_helper_test.py index 55af55eb9..6d843979a 100644 --- a/core/src/test/python/custom_folder_helper_test.py +++ b/core/src/test/python/custom_folder_helper_test.py @@ -280,7 +280,6 @@ def is_expected_dict(self, expected_dict, converted_dict): def roll_dict(self, dict1, dict2): dict1_keys = dict1.keys() - print '***** The dict2 is of type ', type(dict2) for key in dict2.keys(): if key not in dict1_keys or dict2[key] != dict1[key]: return False diff --git a/core/src/test/python/variable_injector_test.py b/core/src/test/python/variable_injector_test.py index 8b76d1f21..c7e635cfb 100644 --- a/core/src/test/python/variable_injector_test.py +++ b/core/src/test/python/variable_injector_test.py @@ -278,7 +278,6 @@ def testReplaceVariableValueAttribute(self): 'JNDIProperty[java.naming.security.principal].Value'][ variable_injector.VARIABLE_VALUE] = 'k8s' actual = self._helper.inject_variables(replacement_dict) - print actual self._compare_to_expected_dictionary(expected, actual) def testReplaceVariableValueSegmentInString(self): diff --git a/core/src/test/python/variables_test.py b/core/src/test/python/variables_test.py index ec5d26d12..b3e088ca6 100644 --- a/core/src/test/python/variables_test.py +++ b/core/src/test/python/variables_test.py @@ -53,7 +53,6 @@ def testVariableNotFound(self): ${key} substitution is deprecated. """ model = FileToPython(self._resources_dir + '/variables-test.json', self._use_ordering).parse() - print 'type of model after parse is ', type(model) model['topology']['Name'] = '${bad.variable}' variable_map = variables.load_variables(self._variables_file) variables.substitute(model, variable_map, self.model_context) diff --git a/pom.xml b/pom.xml index 43e72d65e..8a1e09121 100644 --- a/pom.xml +++ b/pom.xml @@ -49,8 +49,8 @@ .flattened-pom.xml,target/** src/test/** ${env.WLST_DIR} - ${jython.package} - ${jython.version} + jython + 2.2.1 From df002127d941c1b75b73cd11f8fb066d636889e4 Mon Sep 17 00:00:00 2001 From: crountre Date: Fri, 18 Oct 2019 18:12:58 -0500 Subject: [PATCH 11/19] remove Vector related additions --- .../weblogic/deploy/util/PyOrderedDict.java | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java index 1a81b5723..1977385af 100644 --- a/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java +++ b/core/src/main/java/oracle/weblogic/deploy/util/PyOrderedDict.java @@ -6,8 +6,6 @@ import java.io.IOException; import java.io.ObjectInputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.Type; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; @@ -294,7 +292,7 @@ public void __setitem__(PyObject key, PyObject value) { @Override public void clear() { this.linkedHashMap.clear(); - super.clear();; + super.clear(); } /** @@ -347,10 +345,6 @@ public PyList items() { for (Map.Entry entry: entries) { l.add(new PyTuple(new PyObject[] { entry.getKey(), entry.getValue() })); } - System.out.println("Class is " + l.getClass().getName()); - for (Class i : l.getClass().getInterfaces()) { - System.out.println("Interface : " + i.getName()); - } return new PyList(l); } @@ -391,31 +385,9 @@ public PyObject iteritems() { */ @Override public PyList keys() { - - Class c = PyList.class; - Constructor[] allConstructors = c.getDeclaredConstructors(); Set keys = this.linkedHashMap.keySet(); java.util.Vector v = new java.util.Vector<>(keys.size()); v.addAll(keys); - System.out.println("########## What is the type of the vector key lists " + v.getClass().getName()); - Class cArg = v.getClass(); - for (Constructor ctor : allConstructors) { - Class[] pType = ctor.getParameterTypes(); - for (int i = 0; i < pType.length; i++) { - if (pType[i].equals(cArg)) { - System.out.format("%s%n", ctor.toGenericString()); - - Type[] gpType = ctor.getGenericParameterTypes(); - for (int j = 0; j < gpType.length; j++) { - char ch = (pType[j].equals(cArg) ? '*' : ' '); - System.out.format("%7c%s[%d]: %s%n", ch, - "GenericParameterType", j, gpType[j]); - } - break; - } - } - } - System.out.println(); return new PyList(v); } @@ -509,11 +481,9 @@ private void doUpdate(PyDictionary od) { for (int i = 0; i < pylist.size(); i++) { PyTuple tuple = (PyTuple) pylist.get(i); - System.out.println("py tuple " + tuple.toString()); this.__setitem__(Py.java2py(tuple.get(0)), Py.java2py(tuple.get(1))); super.__setitem__(Py.java2py(tuple.get(0)), Py.java2py(tuple.get(1))); } - System.out.println("LOOP ENDED"); } private void doUpdate(PyObject d,PyObject keys) { From ab964d88ac48975f48e581ff9df46f4acd0f7401 Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 18 Oct 2019 19:32:02 -0500 Subject: [PATCH 12/19] reverted jython properties change --- core/pom.xml | 3 +-- pom.xml | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index ffa53350f..ef8e5a997 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -31,8 +31,7 @@ org.python - ${jython.package} - ${jython.version} + jython provided diff --git a/pom.xml b/pom.xml index 9fa58d126..8cdd06e0e 100644 --- a/pom.xml +++ b/pom.xml @@ -49,8 +49,6 @@ .flattened-pom.xml,target/** src/test/** ${env.WLST_DIR} - jython - 2.2.1 @@ -62,8 +60,8 @@ org.python - ${jython.package} - ${jython.version} + jython + 2.2.1 junit From c31067cbd4fbbf3574ffe6c338a601564e3648ce Mon Sep 17 00:00:00 2001 From: crountre Date: Mon, 21 Oct 2019 15:39:36 -0500 Subject: [PATCH 13/19] save log files to debug problem in system test --- .../weblogic/deploy/integration/BaseTest.java | 15 ++++++++++++++- .../oracle/weblogic/deploy/integration/ITWdt.java | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index 68027b172..05c832c7f 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -1,3 +1,9 @@ + + + + + + // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. @@ -79,7 +85,8 @@ protected static void cleanup() throws Exception { logger.info("cleaning up the test environment ..."); // remove WDT script home directory - String cmd = "rm -rf " + getTargetDir() + FS + WDT_HOME_DIR; + String cmd = "tar -cvf" + getTargetDir() +FS + executeNoVerify(cmd); // delete the domain directory created by the tests @@ -89,7 +96,13 @@ protected static void cleanup() throws Exception { FileUtils.deleteDirectory(domainParentDir); } } + protected static void saveLogFiles(testMethodName) throws Exception { + logger.info("saving log files ..."); + // remove WDT script home directory + String cmd = "tar -cvf" + getTargetDir() +FS + "testMethodName.tar " + getTargetDir() + FS + WDT_HOME_DIR; + executeNoVerify(cmd); + } protected static String getProjectRoot() { return projectRoot; } diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java index 792db9672..f18b817fd 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java @@ -362,6 +362,7 @@ public void testFDiscoverDomainWithRequiredArgument() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); + saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // unzip discoveredArchive.zip @@ -393,6 +394,7 @@ public void testGDiscoverDomainWithModelFile() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); + saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // verify model file @@ -418,6 +420,7 @@ public void testHDiscoverDomainJRFDomainType() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); + saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // verify model file From 6cfca2f7df332850332d2885fcf5c85d1c7b99f4 Mon Sep 17 00:00:00 2001 From: crountre Date: Mon, 21 Oct 2019 16:53:17 -0500 Subject: [PATCH 14/19] correct leftover code --- .../oracle/weblogic/deploy/integration/BaseTest.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index 05c832c7f..b6dab18e6 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -1,9 +1,3 @@ - - - - - - // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. @@ -85,8 +79,7 @@ protected static void cleanup() throws Exception { logger.info("cleaning up the test environment ..."); // remove WDT script home directory - String cmd = "tar -cvf" + getTargetDir() +FS - + String cmd = "rm -rf " + getTargetDir() + FS + WDT_HOME_DIR; executeNoVerify(cmd); // delete the domain directory created by the tests From e7cbe8e934ef4e75775097126a79a09905e2e3e0 Mon Sep 17 00:00:00 2001 From: crountre Date: Mon, 21 Oct 2019 17:03:51 -0500 Subject: [PATCH 15/19] correct leftover code --- .../test/java/oracle/weblogic/deploy/integration/BaseTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index b6dab18e6..6efb90231 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -89,7 +89,7 @@ protected static void cleanup() throws Exception { FileUtils.deleteDirectory(domainParentDir); } } - protected static void saveLogFiles(testMethodName) throws Exception { + protected static void saveLogFiles(String testMethodName) throws Exception { logger.info("saving log files ..."); // remove WDT script home directory From aaf99f82b64b4175d2e1f0498d03f55b4aed9060 Mon Sep 17 00:00:00 2001 From: crountre Date: Tue, 22 Oct 2019 10:10:15 -0500 Subject: [PATCH 16/19] revert code to extract provider class name --- .../tool/discover/custom_folder_helper.py | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py b/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py index e6be7713f..fa40d64e4 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py +++ b/core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py @@ -74,8 +74,7 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name): class_name=_class_name, method_name=_method_name) short_name = attribute_helper.get_mbean_name() # This is not like other custom interface names and should be changed to be more flexible - interface_name = security_provider_interface_name( - attribute_helper.get_mbean_instance(), attribute_helper.get_mbean_interface_name()) + interface_name = security_provider_interface_name(attribute_helper.get_mbean_interface_name()) subfolder_result[mbean_name][interface_name] = PyOrderedDict() _logger.info('WLSDPLY-06751', model_type, short_name, class_name=_class_name, method_name=_method_name) _logger.info('WLSDPLY-06752', mbean_name, model_type, short_name, @@ -338,25 +337,20 @@ def equal_jarrays(array1, array2): return False -def security_provider_interface_name(mbean_instance, mbean_interface_name): +def security_provider_interface_name(mbean_interface_name): """ Return the name that is used to look up the custom Security Provider MBeanInfo. This is too tightly coupled to be in this class. This needs something more to differentiate Security Provider Interface which is formatted differently from other custom MBean Interface names. - :param mbean_instance: instance of the current provider :param mbean_interface_name: interface for the MBean - :return: name returned from the mbean instance or massaged name specific to the Scurity Provider + :return: provider class name returned from the massaged MBean name """ - try: - getter = getattr(mbean_instance, 'getProviderClassName') - result = getter() - except AttributeError: - result = mbean_interface_name - idx = mbean_interface_name.rfind('MBean') - if idx > 0: - result = result[:idx] + result = mbean_interface_name + idx = mbean_interface_name.rfind('MBean') + if idx > 0: + result = result[:idx] return result From cf55ab266f13967d8e0f1d972617e1f17bccb245 Mon Sep 17 00:00:00 2001 From: crountre Date: Tue, 22 Oct 2019 10:10:50 -0500 Subject: [PATCH 17/19] massage code for saving logs in workspace for the system test --- .../test/java/oracle/weblogic/deploy/integration/BaseTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index 6efb90231..7ca819597 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -93,7 +93,8 @@ protected static void saveLogFiles(String testMethodName) throws Exception { logger.info("saving log files ..."); // remove WDT script home directory - String cmd = "tar -cvf" + getTargetDir() +FS + "testMethodName.tar " + getTargetDir() + FS + WDT_HOME_DIR; + String cmd = "tar -cvf" + getTargetDir() +FS + testMethodName + ".tar " + getTargetDir() + FS + WDT_HOME_DIR + + FS + logs; executeNoVerify(cmd); } protected static String getProjectRoot() { From 89d69ee7d74c4004f24ddb0b2e126b7f7488a6e9 Mon Sep 17 00:00:00 2001 From: crountre Date: Tue, 22 Oct 2019 10:33:50 -0500 Subject: [PATCH 18/19] massage code for saving logs in workspace for the system test --- .../test/java/oracle/weblogic/deploy/integration/BaseTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index 7ca819597..c697d451c 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -94,7 +94,7 @@ protected static void saveLogFiles(String testMethodName) throws Exception { // remove WDT script home directory String cmd = "tar -cvf" + getTargetDir() +FS + testMethodName + ".tar " + getTargetDir() + FS + WDT_HOME_DIR + - FS + logs; + FS + "logs"; executeNoVerify(cmd); } protected static String getProjectRoot() { From e1793ffc6bb96f60a0eab16c2831d0e6baf7dab5 Mon Sep 17 00:00:00 2001 From: crountre Date: Tue, 22 Oct 2019 11:03:27 -0500 Subject: [PATCH 19/19] revert save logs and move to different PR --- .../java/oracle/weblogic/deploy/integration/BaseTest.java | 7 ------- .../java/oracle/weblogic/deploy/integration/ITWdt.java | 3 --- 2 files changed, 10 deletions(-) diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java index c697d451c..68027b172 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java @@ -89,14 +89,7 @@ protected static void cleanup() throws Exception { FileUtils.deleteDirectory(domainParentDir); } } - protected static void saveLogFiles(String testMethodName) throws Exception { - logger.info("saving log files ..."); - // remove WDT script home directory - String cmd = "tar -cvf" + getTargetDir() +FS + testMethodName + ".tar " + getTargetDir() + FS + WDT_HOME_DIR + - FS + "logs"; - executeNoVerify(cmd); - } protected static String getProjectRoot() { return projectRoot; } diff --git a/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java b/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java index f18b817fd..792db9672 100644 --- a/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java +++ b/system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java @@ -362,7 +362,6 @@ public void testFDiscoverDomainWithRequiredArgument() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); - saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // unzip discoveredArchive.zip @@ -394,7 +393,6 @@ public void testGDiscoverDomainWithModelFile() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); - saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // verify model file @@ -420,7 +418,6 @@ public void testHDiscoverDomainJRFDomainType() throws Exception { logger.info("executing command: " + cmd); ExecResult result = ExecCommand.exec(cmd); - saveLogFiles(testMethodName); verifyResult(result, "discoverDomain.sh completed successfully"); // verify model file