Skip to content

Commit 5fb2a70

Browse files
authored
Catch Java error when isSet() is called for attribute /ResourceManagement (#1141)
* Issue #1126 - Catch Java error when isSet() is called for attribute /ResourceManagement
1 parent 905b5ac commit 5fb2a70

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/src/main/python/wlsdeploy/tool/util/wlst_helper.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from java.io import PrintStream
99
from java.lang import System
10+
from java.lang import Throwable
1011

1112
import com.oracle.cie.domain.script.jython.WLSTException as offlineWLSTException
1213
import oracle.weblogic.deploy.util.StringUtils as StringUtils
@@ -112,8 +113,9 @@ def is_set(self, attribute):
112113
if not self.__check_online_connection():
113114
return True
114115

116+
mbean_path = self.get_pwd()
117+
115118
try:
116-
mbean_path = self.get_pwd()
117119
mbean = self.get_mbean_for_wlst_path(mbean_path)
118120
if 'isSet' not in dir(mbean):
119121
return True
@@ -124,6 +126,12 @@ def is_set(self, attribute):
124126
self.__get_exception_mode(e), _format_exception(e), error=e)
125127
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
126128
raise pwe
129+
except Throwable, e:
130+
# isSet() throws a Java error for /ResourceManagement attribute in 14.1.1.
131+
# in this case, return False to prevent further processing of this attribute.
132+
self.__logger.info('WLSDPLY-00129', attribute, mbean_path, e, class_name=self.__class_name,
133+
method_name=_method_name)
134+
return False
127135

128136
self.__logger.finest('WLSDPLY-00126', attribute, class_name=self.__class_name, method_name=_method_name)
129137
return result

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ WLSDPLY-00125=is_set({0}) in {1} mode failed: {2}
111111
WLSDPLY-00126=Exiting is_set({0}) method
112112
WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0}
113113
WLSDPLY-00128=setTopologyProfile({0}) failed: {1}
114+
WLSDPLY-00129=Error calling isSet() for attribute {0} at location {1}: {2}
114115

115116
###############################################################################
116117
# Util messages (1000 - 3999) #

0 commit comments

Comments
 (0)