oracle / weblogic-deploy-tooling

WebLogic Deploy Tooling
https://oracle.github.io/weblogic-deploy-tooling/
Universal Permissive License v1.0
152 stars 90 forks source link

str or unicode required for replace when discovering WLS 12.1.3 domain #1466

Closed anatoliatanasov closed 1 year ago

anatoliatanasov commented 1 year ago

Hi there,

Just downloaded the latest version of the WLDT tool and tried to run it against offline (shutdown) domain of version 12.1.3. The command I use is

./bin/discoverDomain.sh -oracle_home /opt/Applications/Oracle/soa_studio_1213 -remote -skip_archive -model_file ./model.yaml -domain_home /opt/Applications/Oracle/soa_studio_1213/user_projects/domains/base_domain

where at /opt/Applications/Oracle/soa_studio_1213 I have installed Oracle SOA Suite Studio 12.1.3 (JDeveloper) plus the integrated WLS.

The outcome of the command above is:

JDK version is 1.8.0_301-b09
JAVA_HOME = /opt/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
WLST_EXT_CLASSPATH = /opt/Applications/Oracle/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /opt/Applications/Oracle/weblogic-deploy/lib/weblogic-deploy-core.jar
WLST_PROPERTIES = -Dcom.oracle.cie.script.throwException=true -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig 
/opt/Applications/Oracle/soa_studio_1213/oracle_common/common/bin/wlst.sh /opt/Applications/Oracle/weblogic-deploy/lib/python/discover.py -oracle_home /opt/Applications/Oracle/soa_studio_1213 -remote -skip_archive -model_file ./model.yaml -domain_home /opt/Applications/Oracle/soa_studio_1213/user_projects/domains/base_domain

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Jun 14, 2023 2:43:03 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.2.0:.3f64264:May 11, 2023 00:30 UTC>
####<Jun 14, 2023 2:43:03 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /opt/Applications/Oracle/weblogic-deploy/logs>
Problem invoking WLST - Traceback (innermost last):
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/discover.py", line 632, in ?
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/util/tool_main.py", line 49, in run_tool
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/tool/util/model_context_helper.py", line 37, in create_exit_context
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/tool/util/model_context_helper.py", line 25, in create_context
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/tool/create/domain_typedef.py", line 119, in set_model_context
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/tool/create/domain_typedef.py", line 303, in _DomainTypedef__resolve_paths
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/util/model_context.py", line 892, in replace_token_string
  File "/opt/Applications/Oracle/weblogic-deploy/lib/python/wlsdeploy/util/model_context.py", line 976, in _replace
TypeError: str or unicode required for replace

discoverDomain.sh completed but with some issues (exit code = 1)

The same error crops up in case the tool is executed against WLS 10.3.6 domain.

  1. Are there any WLS versions related limitations of the tool?
  2. Do I have to specify any additional CLI args in case running the discovery against older versions of WLS?

Thanks and regards, A.

anatoliatanasov commented 1 year ago

The issue is resolved by modifying the ${WLDT_HOME}/lib/typedefs/WLS.json file. The WLS_12CR1 object's baseTemplate attribute is changed to "Basic WebLogic Server Domain", e.g.:

{
    "copyright": "Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates.  All rights reserved.",
    "license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
    "name": "WLS",
    "description": "WLS type domain definitions",
    "versions": {
        "10.3.6": "WLS_11G",
        "12.1.1": "WLS_11G",
        "12.1.2": "WLS_12CR1",
        "12.1.3": "WLS_12CR1",
        "12.2.1": "WLS_12CR2",
        "12.2.1.3": "WLS_12CR2",
        "12.2.1.4": "WLS_12CR2",
        "14.1":     "WLS_14"
    },
    "definitions": {
        "WLS_11G": {
            "baseTemplate": "@@WL_HOME@@/common/templates/domains/wls.jar",
            "extensionTemplates": [ ],
            "customExtensionTemplates": [ ],
            "serverGroupsToTarget": [ ],
            "rcuSchemas": [ ]
        },
        "WLS_12CR1": {
            "baseTemplate": "Basic WebLogic Server Domain",
            "extensionTemplates": [ ],
            "customExtensionTemplates": [ ],
            "serverGroupsToTarget": [ ],
            "rcuSchemas": [ ]
        },
        "WLS_12CR2": {
            "baseTemplate": "Basic WebLogic Server Domain",
            "extensionTemplates": [ ],
            "customExtensionTemplates": [ ],
            "serverGroupsToTarget": [ ],
            "rcuSchemas": [ ]
        },
        "WLS_14": {
            "baseTemplate": "Basic WebLogic Server Domain",
            "extensionTemplates": [ ],
            "customExtensionTemplates": [ ],
            "serverGroupsToTarget": [ ],
            "rcuSchemas": [ ]
        }
    }
}
anatoliatanasov commented 1 year ago

Reopening after seeing that someone took the assignment.

robertpatrick commented 1 year ago

There is a fundamental problem here we will fix. Your change to the WLS typedef is working around the problem but will break the typedef if used for createDomain.

anatoliatanasov commented 1 year ago

Do you need any details from my side?

robertpatrick commented 1 year ago

No, this is easily reproduced

robertpatrick commented 1 year ago

Fixed in release 3.2.1