Skip to content

Commit 4f327d7

Browse files
Issue#690 unicode logging issue (#694)
* Fix unicode logging conversion * Jira WDT-312 - Corrected exception type thrown by aliases Co-authored-by: Richard Killen <[email protected]>
1 parent 94cc3d0 commit 4f327d7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

core/src/main/python/wlsdeploy/logging/platform_logger.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
5+
import java.lang.Object as JObject
56
import java.lang.System as JSystem
67
import java.lang.Thread as JThread
78
import java.lang.Throwable as Throwable
@@ -286,6 +287,14 @@ def _get_args_as_java_array(*args):
286287
result = JArrayList()
287288
if args is not None and len(args) > 0:
288289
for arg in args:
289-
result.add(str(arg))
290+
if arg is not None:
291+
if isinstance(arg, unicode) or isinstance(arg, str):
292+
result.add(arg)
293+
elif isinstance(arg, JObject):
294+
result.add(arg.toString())
295+
else:
296+
result.add(unicode(arg))
297+
else:
298+
result.add(str(arg))
290299
return result.toArray()
291300

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from java.net import URISyntaxException
99
from java.net import MalformedURLException
1010

11-
from oracle.weblogic.deploy.aliases import AliasException
1211
from oracle.weblogic.deploy.discover import DiscoverException
1312
from oracle.weblogic.deploy.util import PyOrderedDict as OrderedDict
1413
from oracle.weblogic.deploy.util import StringUtils
@@ -157,7 +156,7 @@ def _add_to_dictionary(self, dictionary, location, wlst_param, wlst_value, wlst_
157156
model_param, model_value = self._aliases.get_model_attribute_name_and_value(location,
158157
wlst_param,
159158
wlst_value)
160-
except AliasException, de:
159+
except DiscoverException, de:
161160
_logger.info('WLSDPLY-06106', wlst_param, wlst_path, de.getLocalizedMessage(),
162161
class_name=_class_name, method_name=_method_name)
163162
return
@@ -668,7 +667,7 @@ def _get_wlst_attributes(self, location):
668667
wlst_attribute = self._aliases.get_wlst_attribute_name(location, model_attribute)
669668
if wlst_attribute:
670669
wlst_attributes.append(wlst_attribute)
671-
except AliasException:
670+
except DiscoverException:
672671
continue
673672
return wlst_attributes
674673

0 commit comments

Comments
 (0)