Skip to content

Commit bb6df54

Browse files
authored
OWLS-89562 - Add option to create-domain.sh in FMW domain home in image sample for use in imagetool --buildNetwork parameter (#2377)
* add buildNetwork option to be passed into imageTool update * support buildNetwork for both wlst and wdt modes * add -b option to create-domain.sh for passing buildNetwork paramater to image tool * add Troubleshooting section for failed to build JDBC Connection object
1 parent efd8e6a commit bb6df54

File tree

3 files changed

+47
-6
lines changed
  • documentation/staging/content/samples/simple/domains/fmw-domain-home-in-image
  • integration-tests/src/test/java/oracle/weblogic/kubernetes
  • kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image

3 files changed

+47
-6
lines changed

documentation/staging/content/samples/simple/domains/fmw-domain-home-in-image/_index.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The usage of the create script is as follows:
121121
$ sh create-domain.sh -h
122122
```
123123
```text
124-
usage: create-domain.sh -o dir -i file -u username -p password [-q rcuSchemaPassword] [-n encryption-key] [-e] [-v] [-h]
124+
usage: create-domain.sh -o dir -i file -u username -p password [-q rcuSchemaPassword] [-b buildNetworkParam] [-n encryption-key] [-e] [-v] [-h]
125125
-i Parameter inputs file, must be specified.
126126
-o Output directory for the generated YAML files, must be specified.
127127
-u WebLogic administrator user name for the WebLogic domain.
@@ -130,6 +130,7 @@ usage: create-domain.sh -o dir -i file -u username -p password [-q rcuSchemaPass
130130
-e Also create the resources in the generated YAML files, optional.
131131
-v Validate the existence of persistentVolumeClaim, optional.
132132
-n Encryption key for encrypting passwords in the WDT model and properties files, optional.
133+
-b Value to be used in the buildNetwork parameter when invoking WebLogic Image Tool, optional.
133134
-h Help
134135
```
135136
@@ -531,3 +532,37 @@ By default, they are installed under `/tmp/dhii-sample/tools` directory.
531532
```shell
532533
$ rm -rf /tmp/dhii-sample/tools/
533534
```
535+
### Troubleshooting
536+
***Message***: `Failed to build JDBC Connection object`
537+
538+
If the WebLogic Image Tool failed to create a domain and the following error is seen in the output:
539+
```shell
540+
Configuring the Service Table DataSource...
541+
fmwDatabase jdbc:oracle:thin:@172.18.0.2:30012/devpdb.k8s
542+
Getting Database Defaults...
543+
Error: getDatabaseDefaults() failed. Do dumpStack() to see details.
544+
Error: runCmd() failed. Do dumpStack() to see details.
545+
Problem invoking WLST - Traceback (innermost last):
546+
File "/u01/oracle/createFMWDomain.py", line 332, in ?
547+
File "/u01/oracle/createFMWDomain.py", line 44, in createInfraDomain
548+
File "/u01/oracle/createFMWDomain.py", line 151, in extendDomain
549+
File "/tmp/WLSTOfflineIni1609018487056199846.py", line 267, in getDatabaseDefaults
550+
File "/tmp/WLSTOfflineIni1609018487056199846.py", line 19, in command
551+
Failed to build JDBC Connection object:
552+
at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:69)
553+
at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:3085)
554+
at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:738)
555+
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
556+
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
557+
at java.lang.reflect.Method.invoke(Method.java:498)
558+
559+
com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: Got exception when auto configuring the schema component(s) with data obtained from shadow table:
560+
Failed to build JDBC Connection object:
561+
```
562+
563+
First, verify that the JDBC connection URL shown in the output is correct. Update the `rcuDatabaseURL` parameter in the inputs YAML file to the correct value if necessary.
564+
565+
If the JDBC connection URL is correct, it is possible that the container in which the WebLogic Image Tool is running for creating a WebLogic domain, is not using the correct networking stack.
566+
The optional `-b` option in the `create-domain.sh` script can be used to specify the networking mode for the RUN instruction during image build.
567+
For example, to use the host's network stack, invoke `create-domain.sh` with `-b host`.
568+
Please refer to Docker Network Settings references for supported networking options.

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDiiSample.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ private void createDomainAndVerify(String domainName, Path sampleBase) {
192192
+ " -u " + ADMIN_USERNAME_DEFAULT
193193
+ " -p " + ADMIN_PASSWORD_DEFAULT
194194
+ " -q " + RCUSYSPASSWORD
195+
+ " -b host"
195196
+ " -o "
196197
+ Paths.get(sampleBase.toString()));
197198

@@ -287,9 +288,6 @@ private void updateDomainInputsFile(String domainUid, Path sampleBase, String sc
287288
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
288289
"domainHomeImageBase: container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4",
289290
"domainHomeImageBase: " + FMWINFRA_IMAGE_TO_USE_IN_SPEC);
290-
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain.sh").toString(),
291-
"imagetool.sh update",
292-
"imagetool.sh update\n --buildNetwork host");
293291
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
294292
"namespace: default", "namespace: " + domainNamespace);
295293
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),

kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ source ${scriptDir}/../../common/wdt-and-wit-utility.sh
2626
source ${scriptDir}/../../common/validate.sh
2727

2828
function usage {
29-
echo usage: ${script} -o dir -i file -u username -p password [-q rcuSchemaPassword] [-e] [-v] [-n] [-h]
29+
echo usage: ${script} -o dir -i file -u username -p password [-q rcuSchemaPassword] [-b buildNetworkParam] [-n encryption-key] [-e] [-v] [-h]
3030
echo " -i Parameter inputs file, must be specified."
3131
echo " -o Output directory for the generated properties and YAML files, must be specified."
3232
echo " -u WebLogic administrator user name for the WebLogic domain."
@@ -35,6 +35,7 @@ function usage {
3535
echo " -e Also create the resources in the generated YAML files, optional."
3636
echo " -v Validate the existence of persistentVolumeClaim, optional."
3737
echo " -n Encryption key for encrypting passwords in the WDT model and properties files, optional."
38+
echo " -b Value to be used in the buildNetwork parameter when invoking WebLogic Image Tool, optional."
3839
echo " -h Help"
3940
exit $1
4041
}
@@ -44,7 +45,7 @@ function usage {
4445
#
4546
doValidation=false
4647
executeIt=false
47-
while getopts "evhi:o:u:p:n:q:" opt; do
48+
while getopts "evhi:o:u:p:n:b:q:" opt; do
4849
case $opt in
4950
i) valuesInputFile="${OPTARG}"
5051
;;
@@ -62,6 +63,8 @@ while getopts "evhi:o:u:p:n:q:" opt; do
6263
;;
6364
n) wdtEncryptKey="${OPTARG}"
6465
;;
66+
b) buildNetwork="${OPTARG}"
67+
;;
6568
h) usage 0
6669
;;
6770
*) usage 1
@@ -279,6 +282,11 @@ function createDomainHome {
279282
fi
280283
fi
281284

285+
if [ -n "${buildNetwork}" ]; then
286+
cmd="$cmd --buildNetwork ${buildNetwork}
287+
"
288+
fi
289+
282290
echo @@ "Info: About to run the following WIT command:"
283291
echo "$cmd"
284292
echo

0 commit comments

Comments
 (0)