Skip to content

Commit b4a48fe

Browse files
Merge pull request #356 from oracle/fixbinscript
Fix scripts to allow user defined domain type and refactor the scripts
2 parents d9a6fb8 + 3f1a046 commit b4a48fe

19 files changed

+303
-616
lines changed

KnownIssues.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ The following list are known issues. The issue may contain a work-around or an a
1414

1515

1616
**ISSUE**:
17-
The createDomain tool cannot create 11g JRF domains. The tool will issue error messages in the log, and
18-
terminate the create process. The discoverDomain tool can discover 11g JRF domains, and those domains can be
19-
configured with the updateDomain and deploy tools.
17+
The createDomain tool cannot run rcu for 11g JRF domains. The tool will issue error messages in the log, and
18+
terminate the create process.
2019

2120
**ACTION**:
22-
Do not use the createDomain tool for 11g JRF domains. This functionality may be available in a future release.
21+
Run RCU before executing createDomain for JRF domains
2322

2423
**ISSUE**:
2524
The discoverDomain or createDomain tool cannot handle object name with slashes and finished with

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def __extend_domain(self, domain_home):
414414
server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
415415
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
416416
self.wlst_helper.update_domain()
417-
elif self._domain_typedef.domain_type_has_jrf_resources():
417+
elif self._domain_typedef.is_jrf_domain_type():
418418
# Update the domain to apply the extension templates.
419419
self.wlst_helper.update_domain()
420420
self.target_helper.target_jrf_groups_to_clusters_servers(domain_home)

core/src/main/python/wlsdeploy/tool/create/domain_typedef.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ class DomainTypedef(object):
2828
__domain_typedefs_location = os.path.join(os.environ.get('WLSDEPLOY_HOME'), 'lib', 'typedefs')
2929
__domain_typedef_extension = '.json'
3030

31-
__wild_card_suffix = '%%'
32-
__wild_card_suffix_len = len(__wild_card_suffix)
31+
JRF_TEMPLATE_REGEX = "^(.*jrf_template[0-9._]*\\.jar)|(Oracle JRF WebServices Asynchronous services)$"
3332

3433
def __init__(self, program_name, domain_type):
3534
"""
@@ -95,12 +94,16 @@ def get_domain_type(self):
9594
"""
9695
return self._domain_type
9796

98-
def domain_type_is_jrf(self):
97+
def is_jrf_domain_type(self):
9998
"""
100-
Determine if the tool is running with domain type JRF or RestrictedJRF.
101-
:return : True if running with domain type JRF or RestrictedJRF.
99+
Determine if this is a JRF domain type by checking for the JRF extension template.
100+
This returns False for the Restricted JRF domain type.
101+
:return: True if the JRF template is present
102102
"""
103-
return self.get_domain_type() == 'JRF' or self.get_domain_type() == 'RestrictedJRF'
103+
for template in self.get_extension_templates():
104+
if re.match(self.JRF_TEMPLATE_REGEX, template):
105+
return True
106+
return False
104107

105108
def domain_type_has_jrf_resources(self):
106109
"""

core/src/main/python/wlsdeploy/util/weblogic_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def get_stb_user_name(self, rcu_prefix):
114114
:param rcu_prefix: the RCU prefix
115115
:return: the Service Table schema user name
116116
"""
117-
return rcu_prefix + '_STB'
117+
if self.is_weblogic_version_or_above('12.1.2'):
118+
return rcu_prefix + '_STB'
119+
return rcu_prefix + '_MDS'
118120

119121
def get_jrf_service_table_datasource_name(self):
120122
"""

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ WLSDPLY-12404=Failed to read the RCU SYS password input from the user: {0}
10501050
WLSDPLY-12405=Please enter the RCU Schema password
10511051
WLSDPLY-12406=Failed to read the RCU Schema password input from the user: {0}
10521052
WLSDPLY-12407={0} invoked with {1} argument but was missing the {2} argument
1053-
WLSDPLY-12408=Domain type {0} definition has RCU schemas defined so the {2} and {3} arguments are required
1053+
WLSDPLY-12408=Domain type {0} definition has RCU schemas defined so the {1} and {2} arguments are required
10541054
WLSDPLY-12409={0} failed to create the domain: {1}
10551055
WLSDPLY-12410={0} failed to deploy the resources and applications to the domain: {1}
10561056
WLSDPLY-12411=The model file specified ATP database info without oracle.net.tns_admin directory but the archive does \

installer/src/main/bin/createDomain.cmd

Lines changed: 27 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ IF NOT "%~1" == "" (
151151
GOTO arg_loop
152152
)
153153

154+
SET SCRIPT_ARGS=%*
154155
@rem Default domain type if not specified
155-
IF "%DOMAIN_TYPE%"=="" SET DOMAIN_TYPE=WLS
156+
IF "%DOMAIN_TYPE%"=="" (
157+
SET SCRIPT_ARGS=%SCRIPT_ARGS% -domain_type WLS
158+
)
156159

157160

158161
@rem
@@ -211,59 +214,32 @@ IF DEFINED WLST_PATH_DIR (
211214
@rem Find the location for wlst.cmd
212215
@rem
213216
SET WLST=
214-
SET USE_JRF_WLST=FALSE
215-
IF DEFINED DOMAIN_TYPE (
216-
IF "%DOMAIN_TYPE%" == "WLS" (
217-
SET USE_JRF_WLST=FALSE
218-
GOTO domain_type_recognized
219-
)
220-
IF "%DOMAIN_TYPE%" == "RestrictedJRF" (
221-
SET USE_JRF_WLST=TRUE
222-
GOTO domain_type_recognized
223-
)
224-
IF "%DOMAIN_TYPE%" == "JRF" (
225-
SET USE_JRF_WLST=TRUE
226-
GOTO domain_type_recognized
227-
)
217+
IF EXIST "%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd" (
218+
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
219+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
220+
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
221+
GOTO found_wlst
228222
)
229-
230-
ECHO Wrong domain type specified "%DOMAIN_TYPE%": valid value is "WLS|JRF|RestrictedJRF"
231-
SET RETURN_CODE=98
232-
GOTO exit_script
233-
234-
:domain_type_recognized
235-
IF "%USE_JRF_WLST%" == "TRUE" (
236-
IF EXIST "%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd" (
237-
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
238-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
239-
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
240-
GOTO found_wlst
241-
)
242-
) ELSE (
243-
IF EXIST "%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd" (
244-
SET WLST=%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd
245-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
246-
GOTO found_wlst
247-
)
248-
IF EXIST "%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd" (
249-
SET WLST=%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd
223+
IF EXIST "%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd" (
224+
SET WLST=%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd
225+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
226+
GOTO found_wlst
227+
)
228+
IF EXIST "%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd" (
229+
SET WLST=%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd
230+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
231+
GOTO found_wlst
232+
)
233+
IF EXIST "%ORACLE_HOME%\wlserver\common\bin\wlst.cmd" (
234+
IF EXIST "%ORACLE_HOME%\wlserver\.product.properties" (
235+
@rem WLS 12.1.2 or WLS 12.1.3
236+
SET WLST=%ORACLE_HOME%\wlserver\common\bin\wlst.cmd
250237
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
251-
GOTO found_wlst
252-
)
253-
IF EXIST "%ORACLE_HOME%\wlserver\common\bin\wlst.cmd" (
254-
IF EXIST "%ORACLE_HOME%\wlserver\.product.properties" (
255-
@rem WLS 12.1.2 or WLS 12.1.3
256-
SET WLST=%ORACLE_HOME%\wlserver\common\bin\wlst.cmd
257-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
258-
) ELSE (
259-
@rem WLS 12.2.1+
260-
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
261-
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
262-
)
263-
GOTO found_wlst
264238
)
239+
GOTO found_wlst
265240
)
266241

242+
267243
IF NOT EXIST "%WLST%" (
268244
ECHO Unable to locate wlst.cmd script in ORACLE_HOME %ORACLE_HOME% >&2
269245
SET RETURN_CODE=98
@@ -293,9 +269,9 @@ ECHO CLASSPATH = %CLASSPATH%
293269
ECHO WLST_PROPERTIES = %WLST_PROPERTIES%
294270

295271
SET PY_SCRIPTS_PATH=%WLSDEPLOY_HOME%\lib\python
296-
ECHO %WLST% %PY_SCRIPTS_PATH%\create.py %*
272+
ECHO %WLST% %PY_SCRIPTS_PATH%\create.py %SCRIPT_ARGS%
297273

298-
"%WLST%" "%PY_SCRIPTS_PATH%\create.py" %*
274+
"%WLST%" "%PY_SCRIPTS_PATH%\create.py" %SCRIPT_ARGS%
299275

300276
SET RETURN_CODE=%ERRORLEVEL%
301277
IF "%RETURN_CODE%" == "100" (

installer/src/main/bin/createDomain.sh

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ done
201201

202202
if [ -z "${DOMAIN_TYPE}" ]; then
203203
DOMAIN_TYPE="WLS"
204+
SCRIPT_ARGS="${SCRIPT_ARGS} -domain_type $DOMAIN_TYPE"
204205
fi
205206

206207

@@ -250,43 +251,22 @@ if [ "${WLST_PATH_DIR}" != "" ]; then
250251
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
251252
WLST_EXT_CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export WLST_EXT_CLASSPATH
252253
else
253-
#
254-
# Find the location for wlst.sh
255-
#
256254
WLST=""
257-
USE_JRF_WLST=FALSE
258-
if [ "${DOMAIN_TYPE}" = "WLS" ]; then
259-
USE_JRF_WLST=FALSE
260-
elif [ "${DOMAIN_TYPE}" = "RestrictedJRF" ]; then
261-
USE_JRF_WLST=TRUE
262-
elif [ "${DOMAIN_TYPE}" = "JRF" ]; then
263-
USE_JRF_WLST=TRUE
264-
else
265-
echo "Wrong domain type specified ${DOMAIN_TYPE}: valid value is WLS|JRF|RestrictedJRF"
266-
exit 98
255+
if [ -x ${ORACLE_HOME}/oracle_common/common/bin/wlst.sh ]; then
256+
WLST=${ORACLE_HOME}/oracle_common/common/bin/wlst.sh
257+
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
258+
WLST_EXT_CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export WLST_EXT_CLASSPATH
259+
elif [ -x ${ORACLE_HOME}/wlserver_10.3/common/bin/wlst.sh ]; then
260+
WLST=${ORACLE_HOME}/wlserver_10.3/common/bin/wlst.sh
261+
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
262+
elif [ -x ${ORACLE_HOME}/wlserver_12.1/common/bin/wlst.sh ]; then
263+
WLST=${ORACLE_HOME}/wlserver_12.1/common/bin/wlst.sh
264+
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
265+
elif [ -x ${ORACLE_HOME}/wlserver/common/bin/wlst.sh -a -f ${ORACLE_HOME}/wlserver/.product.properties ]; then
266+
WLST=${ORACLE_HOME}/wlserver/common/bin/wlst.sh
267+
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
267268
fi
268269

269-
if [ "${USE_JRF_WLST}" = "TRUE" ]; then
270-
if [ -x ${ORACLE_HOME}/oracle_common/common/bin/wlst.sh ]; then
271-
WLST=${ORACLE_HOME}/oracle_common/common/bin/wlst.sh
272-
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
273-
WLST_EXT_CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export WLST_EXT_CLASSPATH
274-
fi
275-
else
276-
if [ -x ${ORACLE_HOME}/wlserver_10.3/common/bin/wlst.sh ]; then
277-
WLST=${ORACLE_HOME}/wlserver_10.3/common/bin/wlst.sh
278-
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
279-
elif [ -x ${ORACLE_HOME}/wlserver_12.1/common/bin/wlst.sh ]; then
280-
WLST=${ORACLE_HOME}/wlserver_12.1/common/bin/wlst.sh
281-
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
282-
elif [ -x ${ORACLE_HOME}/wlserver/common/bin/wlst.sh -a -f ${ORACLE_HOME}/wlserver/.product.properties ]; then
283-
WLST=${ORACLE_HOME}/wlserver/common/bin/wlst.sh
284-
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH
285-
else
286-
WLST=${ORACLE_HOME}/oracle_common/common/bin/wlst.sh
287-
WLST_EXT_CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export WLST_EXT_CLASSPATH
288-
fi
289-
fi
290270

291271
if [ "${WLST}" = "" ]; then
292272
echo "Unable to determine WLS version in ${ORACLE_HOME} to determine WLST shell script to call" >&2

installer/src/main/bin/deployApps.cmd

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ IF NOT "%~1" == "" (
149149
GOTO arg_loop
150150
)
151151

152+
SET SCRIPT_ARGS=%*
152153
@rem Default domain type if not specified
153-
IF "%DOMAIN_TYPE%"=="" SET DOMAIN_TYPE=WLS
154+
IF "%DOMAIN_TYPE%"=="" (
155+
SET SCRIPT_ARGS=%SCRIPT_ARGS% -domain_type WLS
156+
)
154157

155158
@rem
156159
@rem Validate the JVM version based on whether or not the user asked us to use encryption
@@ -208,57 +211,29 @@ IF DEFINED WLST_PATH_DIR (
208211
@rem Find the location for wlst.cmd
209212
@rem
210213
SET WLST=
211-
SET USE_JRF_WLST=FALSE
212-
IF DEFINED DOMAIN_TYPE (
213-
IF "%DOMAIN_TYPE%" == "WLS" (
214-
SET USE_JRF_WLST=FALSE
215-
GOTO domain_type_recognized
216-
)
217-
IF "%DOMAIN_TYPE%" == "RestrictedJRF" (
218-
SET USE_JRF_WLST=TRUE
219-
GOTO domain_type_recognized
220-
)
221-
IF "%DOMAIN_TYPE%" == "JRF" (
222-
SET USE_JRF_WLST=TRUE
223-
GOTO domain_type_recognized
224-
)
214+
IF EXIST "%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd" (
215+
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
216+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
217+
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
218+
GOTO found_wlst
225219
)
226-
227-
ECHO Wrong domain type specified "%DOMAIN_TYPE%": valid value is "WLS|JRF|RestrictedJRF"
228-
SET RETURN_CODE=98
229-
GOTO exit_script
230-
231-
:domain_type_recognized
232-
IF "%USE_JRF_WLST%" == "TRUE" (
233-
IF EXIST "%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd" (
234-
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
235-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
236-
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
237-
GOTO found_wlst
238-
)
239-
) ELSE (
240-
IF EXIST "%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd" (
241-
SET WLST=%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd
242-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
243-
GOTO found_wlst
244-
)
245-
IF EXIST "%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd" (
246-
SET WLST=%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd
220+
IF EXIST "%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd" (
221+
SET WLST=%ORACLE_HOME%\wlserver_10.3\common\bin\wlst.cmd
222+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
223+
GOTO found_wlst
224+
)
225+
IF EXIST "%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd" (
226+
SET WLST=%ORACLE_HOME%\wlserver_12.1\common\bin\wlst.cmd
227+
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
228+
GOTO found_wlst
229+
)
230+
IF EXIST "%ORACLE_HOME%\wlserver\common\bin\wlst.cmd" (
231+
IF EXIST "%ORACLE_HOME%\wlserver\.product.properties" (
232+
@rem WLS 12.1.2 or WLS 12.1.3
233+
SET WLST=%ORACLE_HOME%\wlserver\common\bin\wlst.cmd
247234
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
248-
GOTO found_wlst
249-
)
250-
IF EXIST "%ORACLE_HOME%\wlserver\common\bin\wlst.cmd" (
251-
IF EXIST "%ORACLE_HOME%\wlserver\.product.properties" (
252-
@rem WLS 12.1.2 or WLS 12.1.3
253-
SET WLST=%ORACLE_HOME%\wlserver\common\bin\wlst.cmd
254-
SET CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
255-
) ELSE (
256-
@rem WLS 12.2.1+
257-
SET WLST=%ORACLE_HOME%\oracle_common\common\bin\wlst.cmd
258-
SET WLST_EXT_CLASSPATH=%WLSDEPLOY_HOME%\lib\weblogic-deploy-core.jar
259-
)
260-
GOTO found_wlst
261235
)
236+
GOTO found_wlst
262237
)
263238

264239
IF NOT EXIST "%WLST%" (
@@ -290,9 +265,9 @@ ECHO CLASSPATH = %CLASSPATH%
290265
ECHO WLST_PROPERTIES = %WLST_PROPERTIES%
291266

292267
SET PY_SCRIPTS_PATH=%WLSDEPLOY_HOME%\lib\python
293-
ECHO %WLST% %PY_SCRIPTS_PATH%\deploy.py %*
268+
ECHO %WLST% %PY_SCRIPTS_PATH%\deploy.py %SCRIPT_ARGS%
294269

295-
"%WLST%" "%PY_SCRIPTS_PATH%\deploy.py" %*
270+
"%WLST%" "%PY_SCRIPTS_PATH%\deploy.py" %SCRIPT_ARGS%
296271

297272
SET RETURN_CODE=%ERRORLEVEL%
298273
IF "%RETURN_CODE%" == "103" (

0 commit comments

Comments
 (0)