Skip to content

Commit 676a6aa

Browse files
authored
Wdt 577 add missing online deploy undeploy error message (#1092)
* Capture undeploy error message and add it to logger * WDT-577 Fix online deploy, redploy, and undeploy missing error message
1 parent 28197f4 commit 676a6aa

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

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

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55

66
import types
77

8+
from java.io import PrintStream
9+
from java.lang import System
10+
811
import com.oracle.cie.domain.script.jython.WLSTException as offlineWLSTException
912
import oracle.weblogic.deploy.util.StringUtils as StringUtils
1013
import weblogic.management.mbeanservers.edit.ValidationException as ValidationException
1114

1215
from wlsdeploy.exception import exception_helper
1316
from wlsdeploy.logging.platform_logger import PlatformLogger
17+
from wlsdeploy.tool.util.string_output_stream import StringOutputStream
1418

1519
wlst_functions = None
1620

@@ -1022,12 +1026,21 @@ def deploy_application(self, application_name, *args, **kwargs):
10221026
"""
10231027
_method_name = 'deploy_application'
10241028
self.__logger.entering(application_name, args, kwargs, class_name=self.__class_name, method_name=_method_name)
1029+
deploy_error = None
1030+
sostream = None
10251031

10261032
try:
1033+
self.enable_stdout()
1034+
sostream = StringOutputStream()
1035+
System.setOut(PrintStream(sostream))
10271036
result = self.__load_global('deploy')(application_name, *args, **kwargs)
1037+
self.silence()
10281038
except self.__load_global('WLSTException'), e:
1039+
if sostream:
1040+
deploy_error = sostream.get_string()
1041+
self.silence()
10291042
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00058', application_name,
1030-
args, kwargs, _format_exception(e), error=e)
1043+
args, kwargs, _format_exception(e), deploy_error, error=e)
10311044
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
10321045
raise pwe
10331046
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=result)
@@ -1044,14 +1057,23 @@ def undeploy_application(self, application_name, *args, **kwargs):
10441057
"""
10451058
_method_name = 'undeploy_application'
10461059
self.__logger.entering(application_name, args, kwargs, class_name=self.__class_name, method_name=_method_name)
1047-
1060+
undeploy_error = None
1061+
sostream = None
10481062
try:
1063+
self.enable_stdout()
1064+
sostream = StringOutputStream()
1065+
System.setOut(PrintStream(sostream))
10491066
result = self.__load_global('undeploy')(application_name, *args, **kwargs)
1067+
self.silence()
10501068
except self.__load_global('WLSTException'), e:
1069+
if sostream:
1070+
undeploy_error = sostream.get_string()
1071+
self.silence()
10511072
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00059', application_name,
1052-
args, kwargs, _format_exception(e), error=e)
1073+
args, kwargs, _format_exception(e), undeploy_error, error=e)
10531074
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
10541075
raise pwe
1076+
10551077
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=result)
10561078
return result
10571079

@@ -1066,12 +1088,21 @@ def redeploy_application(self, application_name, *args, **kwargs):
10661088
"""
10671089
_method_name = 'redeploy_application'
10681090
self.__logger.entering(application_name, args, kwargs, class_name=self.__class_name, method_name=_method_name)
1091+
redeploy_error = None
1092+
sostream = None
10691093

10701094
try:
1095+
self.enable_stdout()
1096+
sostream = StringOutputStream()
1097+
System.setOut(PrintStream(sostream))
10711098
result = self.__load_global('redeploy')(application_name, *args, **kwargs)
1099+
self.silence()
10721100
except self.__load_global('WLSTException'), e:
1101+
if sostream:
1102+
redeploy_error = sostream.get_string()
1103+
self.silence()
10731104
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00060', application_name,
1074-
args, kwargs, _format_exception(e), error=e)
1105+
args, kwargs, _format_exception(e), redeploy_error, error=e)
10751106
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
10761107
raise pwe
10771108
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=result)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ WLSDPLY-00054=Entering get_exiting_object_list({0}) method
6262
WLSDPLY-00055=Exiting get_object_list_path({0}) method with result {1}
6363
WLSDPLY-00056=startApplication({0}, {1}, {2}) failed: {3}
6464
WLSDPLY-00057=stopApplication({0}, {1}, {2}) failed: {3}
65-
WLSDPLY-00058=deployApplication({0}, {1}, {2}) failed: {3}
66-
WLSDPLY-00059=undeployApplication({0}, {1}, {2}) failed: {3}
67-
WLSDPLY-00060=redeployApplication({0}, {1}, {2}) failed: {3}
65+
WLSDPLY-00058=deployApplication({0}, {1}, {2} {3}) failed: {4}
66+
WLSDPLY-00059=undeployApplication({0}, {1}, {2} {3}) failed: {4}
67+
WLSDPLY-00060=redeployApplication({0}, {1}, {2} {3}) failed: {4}
6868
WLSDPLY-00061=Getting configuration manager failed: {0}
6969
WLSDPLY-00062=Getting active activation tasks failed: {0}
7070
WLSDPLY-00063=Getting current editor failed: {0}

0 commit comments

Comments
 (0)