Showing posts with label deploy. Show all posts
Showing posts with label deploy. Show all posts

Sunday, September 15, 2024

Convert Java properties file to sed commands using ant

 HOWTO

GitHub

Install antcontrib 

Get via Maven  https://github.com/dveselka/java-tutorial/blob/master/tools/pom.xml

To install ant-contrib:

  1. Copy ant-contrib-0.3.jar to the lib directory of your Ant installation. If you want to use one of the tasks in your own project, add the lines
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
    
    to your build file.
  2. Keep ant-contrib-0.3.jar in a separate location. You now have to tell Ant explicitly where to find it (say in /usr/share/java/lib):
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
      <classpath>
        <pathelement location="/usr/share/java/lib/ant-contrib-0.3.jar"/>
      </classpath>
    </taskdef>

 

Get antcontrib.jar via Maven
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>dave</groupId>
    <artifactId>tools</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>dave</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/ant-contrib/ant-contrib -->
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

$ mvn clean install


[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default) @ tools ---
[INFO] Copying ant-contrib-1.0b3.jar to /git/java-tutorial/tools/target/lib/ant-contrib-1.0b3.jar
[INFO] Copying ant-1.5.jar to /git/java-tutorial/tools/target/lib/ant-1.5.jar

 Properties file https://github.com/dveselka/java-tutorial/blob/master/tools/dave.properties

 a=1
jdbc.url=jdbc:oracle:thin:dave@dave:1521/DAVE_DB
url=https://dave.com/dave
date=Sun Sep 15 08:43:48 AM CEST 2024

 

Build.xml to produce sed file from properties file https://github.com/dveselka/java-tutorial/blob/master/tools/build.xml

Notice that @ gives value of for cycle variable , $ gives value of ant property
<project name="properties-to-sed">

    <taskdef resource="net/sf/antcontrib/antlib.xml">
        <classpath>
            <pathelement location="target/lib/ant-contrib-1.0b3.jar"/>
        </classpath>
    </taskdef>

    <target name="convert">
        
        <property file="dave.properties" prefix="dave."/>
        <propertyselector property="dave" match="dave\.(.*)" select="\1"/>
        
        <for param="key" list="${dave}">
            <sequential>
                <echo>@{key}=${dave.@{key}}</echo>
                <echo message="s#@{key}#${dave.@{key}}#g${line.separator}" file="replace-dave-props.sed" append="true"/>
            </sequential>
        </for>
    </target>
</project>
 

Run ant 

 
 $ ant convert
Buildfile: /git/java-tutorial/tools/build.xml

convert:
     [echo] url=https://dave.com/dave
     [echo] a=1
     [echo] date=Sun Sep 15 08:43:48 AM CEST 2024
     [echo] jdbc.url=jdbc:oracle:thin:dave@dave:1521/DAVE_DB

BUILD SUCCESSFUL
Total time: 0 seconds

Sed file produced from properties file

$ cat replace-dave-props.sed
s#url#https://dave.com/dave#g
s#a#1#g
s#date#Sun Sep 15 08:43:48 AM CEST 2024#g
s#jdbc.url#jdbc:oracle:thin:dave@dave:1521/DAVE_DB#g

 

 Asking Gemimi for hints - useful, provided idea with antcontrib for cycle, needs fixing - add antcontrib install, fix for cycle

 

Approach:

  1. Create a build.xml file:

    • Write the Ant build script in a build.xml file.
    • Define a target to perform the conversion.
  2. Load properties file:

    • Use the property task to load the properties file.
  3. Generate sed commands:

    • Use the for task to iterate over the properties entries.
    • For each entry, create a sed command using the echo task.
  4. Write sed commands to file:

    • Use the echo task to write the generated sed commands to a file.

build.xml example:

XML
<project name="properties-to-sed">
    <target name="convert">
        <property file="replacements.properties"/>

        <for param="key" elements="${replacements.keys()}">
            <sequential>
                <echo message="s/${replacements.${key}}/${replacements.${key}}/g" file="sed_script.sed" append="true"/>
            </sequential>
        </for>
    </target>
</project>

Explanation:

  • The replacements.properties file should contain key-value pairs where the key is the search pattern and the value is the replacement string. For example:
search1=replacement1
search2=replacement2
  • The build.xml file defines a convert target.
  • The property task loads the properties file.
  • The for task iterates over the keys in the properties file.
  • For each key, an echo task creates a sed command using the key and value as the search pattern and replacement string.
  • The echo task writes the sed command to the sed_script.sed file, appending it to the end of the file.

Additional considerations:

  • You can customize the sed command format based on your specific requirements.
  • If you need to escape special characters in the search patterns or replacement strings, use appropriate escape sequences.
  • For more complex scenarios or performance optimization, consider using a dedicated scripting language like Python or Perl.


 Asking ChatGPT for comparison


Daniel Veselka
convert properties file to sed commands using antcontrib for cycle
ChatGPT

To convert a properties file to sed commands using ant-contrib's for loop functionality, you'll need to follow a similar approach as previously mentioned, with some adjustments to implement the loop correctly. Below, I’ll provide a complete and detailed example, including how to set up your environment to use ant-contrib for iterating through properties.

Example Properties File

Assuming you have a properties file named config.properties:

properties
# config.properties
app.name=MyApp
app.version=1.0.0
app.author=John Doe

Ant Build File
<project name="PropertiesToSed" default="convert" basedir=".">
    
    <property file="config.properties"/>
    
    <target name="convert">
        <echo message="Converting properties to sed commands..." />

        <!-- Loop through the properties defined in config.properties -->
        <property name="properties.list" value="app.name,app.version,app.author"/>

        <foreach list="${properties.list}" param="property">
            <sequential>
                <echo message="sed -i 's/${property}=.*/${property}=${property}:${property}/g' target_file.txt" />
            </sequential>
        </foreach>
        
    </target>
    
</project>

Explanation of the Ant Build File

  1. Task Definition for Ant-Contrib: The line <taskdef resource="antcontrib.properties" /> defines the ant-contrib functions so you can use them in your Ant script. Make sure you have the ant-contrib.jar in your Ant classpath.

  2. Loading Properties: The properties file is loaded into the project with <property file="config.properties"/>.

  3. Defining Properties List: A property properties.list is defined, listing all the keys in the properties file that you want to generate sed commands for.

  4. Using <for> Loop: The <for> loop is used to iterate over the properties list. Each property will be accessible via the variable ${property} in the loop.

  5. Generating sed Commands:

    • The echo command inside the loop outputs the sed command that will perform the desired replacement in target_file.txt.
    • If you want to replace the value of each property in the file, you can use ${property} to get the key and ${property.value} to retrieve the corresponding value.

Step to Execute the Ant Script

  1. Ensure you have ant-contrib: Download the ant-contrib.jar and place it in the lib directory of your Ant installation or add it to your classpath.

  2. Run the Ant command:

bash
ant convert

Final Notes

  • The generated sed command will replace the line in target_file.txt that matches the pattern property=, updating it with the value from config.properties.
  • Adjust the target_file.txt with your actual target file; this is the file where the properties should be replaced.
  • Remember that you can customize the sed command based on how you want to implement the replacements based on your specific requirements.

 

Monday, April 1, 2024

WDT - discover domain with 4 managed servers, DS and EAR

 HOWTO


GitHub


Deploy DS and EAR via Weblogic console 




Run discover.sh


dave@dave:/app/weblogic-deploy/bin$ ./discoverDomain.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -admin_user weblogic -admin_url t3://dave:7001
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
WLST_EXT_CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /app/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 
/app/weblogic/oracle_common/common/bin/wlst.sh /app/weblogic-deploy/lib/python/discover.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -admin_user weblogic -admin_url t3://dave:7001

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Apr 1, 2024 10:50:35 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Apr 1, 2024 10:50:35 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /app/weblogic-deploy/logs>
####<Apr 1, 2024 10:50:35 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:50:35 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
Please enter the WebLogic administrator password: 
####<Apr 1, 2024 10:50:40 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:50:40 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:50:40 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Apr 1, 2024 10:50:40 PM> <INFO> <discover> <main> <WLSDPLY-06024> <No variable file provided. Model passwords will contain the token '-- FIX ME --'>

####<Apr 1, 2024 10:50:41 PM> <INFO> <discover> <_get_domain_name> <WLSDPLY-06022> <Discover domain base_domain>
####<Apr 1, 2024 10:50:42 PM> <INFO> <TopologyDiscoverer> <discover> <WLSDPLY-06600> <Discovering domain model topology>
####<Apr 1, 2024 10:50:43 PM> <INFO> <WlstHelper> <is_set> <WLSDPLY-00129> <Error calling isSet() for attribute ResourceManagement at location /: java.lang.AssertionError: java.lang.reflect.InvocationTargetException>
####<Apr 1, 2024 10:50:43 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain AdminConsole>
####<Apr 1, 2024 10:50:43 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain CdiContainer>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JMX>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JPA>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JTA>
####<Apr 1, 2024 10:50:45 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain Log>
####<Apr 1, 2024 10:50:45 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain RestfulManagementServices>
####<Apr 1, 2024 10:50:45 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06601> <Discovering 2 clusters>
####<Apr 1, 2024 10:50:45 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterA>
####<Apr 1, 2024 10:50:48 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterB>
####<Apr 1, 2024 10:50:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06603> <Discovering 5 servers>
####<Apr 1, 2024 10:50:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server AdminServer>
####<Apr 1, 2024 10:51:03 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA1>
####<Apr 1, 2024 10:51:15 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA2>
####<Apr 1, 2024 10:51:27 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB1>
####<Apr 1, 2024 10:51:40 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB2>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06607> <Discovering 4 Migratable Targets>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA1 (migratable)>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA2 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB1 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB2 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06605> <Discovering 0 server templates>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_unix_machines> <WLSDPLY-06609> <Discovering 2 Unix machines>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06611> <Discovering 2 machines>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineA>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineB>
####<Apr 1, 2024 10:51:54 PM> <INFO> <TopologyDiscoverer> <discover_security_configuration> <WLSDPLY-06622> <Adding Security Configuration>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <get_embedded_ldap_configuration> <WLSDPLY-06639> <Skipping Embedded LDAP Server Configuration>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_log_filters> <WLSDPLY-06628> <Discovering 0 Log Filters>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_reliable_delivery_policies> <WLSDPLY-06630> <Discovering 0 Reliable Delivery Policies>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_virtual_hosts> <WLSDPLY-06647> <Discovering 0 Virtual Hosts>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_xml_entity_caches> <WLSDPLY-06632> <Discovering 0 XML Entity Caches>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_xml_registries> <WLSDPLY-06634> <Discovering 0 XML Registries>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_ws_securities> <WLSDPLY-06649> <Discovering 0 Web Service Securities>
####<Apr 1, 2024 10:51:56 PM> <INFO> <ResourcesDiscoverer> <discover> <WLSDPLY-06300> <Discovering domain model resources>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_self_tuning> <WLSDPLY-06441> <Adding Self Tuning>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_startup_classes> <WLSDPLY-06442> <Discovering 0 Startup Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_shutdown_classes> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <_get_webapp_container> <WLSDPLY-06615> <Cross Domain Security is enabled, do not remove SecurityConfiguration CredentialEncrypted>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_singleton_service> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_jolt_connection_pool> <WLSDPLY-06449> <Discovering 0 Jolt Connection Pools>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_wtc_servers> <WLSDPLY-06451> <Discovering 0 WTC Servers>
####<Apr 1, 2024 10:51:56 PM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06340> <Discovering 1 JDBC System Resources>
####<Apr 1, 2024 10:51:56 PM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06341> <Adding JDBC System Resource JDBC-Data-Source-Oracle>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_foreign_jndi_providers> <WLSDPLY-06342> <Discovering 0 Foreign JNDI Providers>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_mail_sessions> <WLSDPLY-06344> <Discovering 0 Mail Sessions>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_file_stores> <WLSDPLY-06346> <Discovering 0 File Stores>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_jdbc_stores> <WLSDPLY-06350> <Discovering 0 JDBC Stores>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_path_services> <WLSDPLY-06355> <Discovering 0 Path Services>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_servers> <WLSDPLY-06470> <Discovering 0 JMS Servers>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_saf_agents> <WLSDPLY-06472> <Discovering 0 SAF Agents>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_system_resources> <WLSDPLY-06478> <Discovering 0 JMS System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridge_destinations> <WLSDPLY-06474> <Discovering 0 JMS Bridge Destinations>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridges> <WLSDPLY-06476> <Discovering 0 JMS Messaging Bridges>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_wldf_system_resources> <WLSDPLY-06357> <Discovering 0 WLDF System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <_get_named_resources> <WLSDPLY-06364> <Discovering 0 SystemComponent elements>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CoherenceResourcesDiscoverer> <_get_coherence_clusters> <WLSDPLY-06311> <Discovering 0 Coherence Cluster System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <discover> <WLSDPLY-06380> <Discovering domain model deployments>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06391> <Discovering 1 Applications>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06392> <Adding Application basicWebapp>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <add_application_to_archive> <WLSDPLY-06394> <Add application basicWebapp binary /git/weblogic/dave-basic-project/dave-basic-webapp-project/target/basicWebapp.war to archive>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantDiscoverer> <discover> <WLSDPLY-06700> <Discover Multi-tenant>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantTopologyDiscoverer> <discover> <WLSDPLY-06709> <Discover Multi-tenant Topology>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantResourcesDiscoverer> <discover> <WLSDPLY-06707> <Discover Multi-tenant Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Apr 1, 2024 10:51:58 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type discover found in filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Apr 1, 2024 10:51:58 PM> <INFO> <variable_injector> <inject_variables_keyword_file> <WLSDPLY-19519> <No variables were inserted into the model during variable replacement>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST ONLINE mode>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05005> <Performing archive validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip archive file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>

Issue Log for discoverDomain version 3.5.4 running WebLogic version 14.1.1.0.0 online mode:

Total:   SEVERE :    0  WARNING :    0

discoverDomain.sh completed successfully (exit code = 0)

Created model
$ cat /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml
# This model was created using the WebLogic Deploy Tooling 3.5.4 discoverDomain tool
# running in ONLINE mode against a domain using WebLogic Server 14.1.1.0.0.
# 
domainInfo:
    AdminUserName: --FIX ME--
    AdminPassword: --FIX ME--
topology:
    Name: base_domain
    Cluster:
        ClusterA: {}
        ClusterB: {}
    Server:
        AdminServer:
            Machine: machineA
        ManagedServerA1:
            ListenPort: 7003
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA1
                Cluster: ClusterA
        ManagedServerA2:
            ListenPort: 7004
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA2
                Cluster: ClusterA
        ManagedServerB1:
            ListenPort: 7005
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB1
                Cluster: ClusterB
        ManagedServerB2:
            ListenPort: 7006
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB2
                Cluster: ClusterB
    MigratableTarget:
        ManagedServerA1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA1
            Cluster: ClusterA
        ManagedServerA2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA2
            Cluster: ClusterA
        ManagedServerB1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB1
            Cluster: ClusterB
        ManagedServerB2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB2
            Cluster: ClusterB
    Machine:
        machineA: {}
        machineB: {}
    SecurityConfiguration:
        NodeManagerPasswordEncrypted: --FIX ME--
resources:
    JDBCSystemResource:
        JDBC-Data-Source-Oracle:
            Target: ClusterA,ClusterB
            JdbcResource:
                DatasourceType: GENERIC
                JDBCConnectionPoolParams:
                    TestTableName: SQL ISVALID
                JDBCDataSourceParams:
                    JNDIName: jdbc/DaveOracle
                JDBCDriverParams:
                    DriverName: oracle.jdbc.OracleDriver
                    PasswordEncrypted: --FIX ME--
                    URL: jdbc:oracle:thin:@//localhost:1521/DAVE_ORACLE
                    Properties:
                        user:
                            Value: weblogic
appDeployments:
    Application:
        basicWebapp:
            SourcePath: wlsdeploy/applications/basicWebapp.war
            ModuleType: war
            Target: ClusterA,ClusterB

Created archive
$ unzip -l /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip
Archive:  /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    22119  04-01-2024 22:51   wlsdeploy/applications/basicWebapp.war
---------                     -------
    22119                     1 file

Extract domain
$ ./extractDomainResource.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file  /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml  -output_dir  /git/weblogic/wdt/resource/k8s/domainABDSEAR -target wko
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar
JAVA_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console= 
/usr/java/jdk-11/bin/java -cp /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar           -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console=            -Dpython.path=/app/weblogic/wlserver/common/wlst/modules/jython-modules.jar/Lib           org.python.util.jython           /app/weblogic-deploy/lib/python/extract_resource.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -output_dir /git/weblogic/wdt/resource/k8s/domainABDSEAR -target wko
####<Apr 1, 2024 10:57:26 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling extractDomainResource version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Apr 1, 2024 10:57:26 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The extractDomainResource program will write its log to directory /app/weblogic-deploy/logs>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Apr 1, 2024 10:57:26 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type extract found in filter configuration file /app/weblogic-deploy/lib/targets/wko/target.json>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml model file>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_single_path_in_archive> <WLSDPLY-05025> <Attribute SourcePath in model location appDeployments:/Application/basicWebapp references archive entry wlsdeploy/applications/basicWebapp.war but the archive file was not provided>
####<Apr 1, 2024 10:57:27 PM> <INFO> <vz_config_helper> <_create_file> <WLSDPLY-01662> <Creating target configuration file /git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml>
####<Apr 1, 2024 10:57:27 PM> <INFO> <crd_file_updater> <update_from_model> <WLSDPLY-01675> <Updating target output file "/git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml" from the kubernetes section of the model>

Issue Log for extractDomainResource version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

Total:   SEVERE :    0  WARNING :    0

extractDomainResource.sh completed successfully (exit code = 0)

Created domain resource
$ cat /git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml
apiVersion: weblogic.oracle/v8
kind: Domain
metadata:
    name: base-domain
    namespace: base-domain
    labels:
        weblogic.domainUID: base-domain
spec:
    domainHome: /app/weblogic/user_projects/domains/base_domain/
    domainHomeSourceType: FromModel
    image: '{{{imageName}}}'
    # Add any credential secrets that are required to pull the image
    imagePullSecrets: []
    webLogicCredentialsSecret:
        name: base-domain-weblogic-credentials
    serverPod:
        env:
          - name: JAVA_OPTIONS
            value: -Dweblogic.StdoutDebugEnabled=false
          - name: USER_MEM_ARGS
            value: '-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m '
    clusters:
      - clusterName: ClusterA
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
      - clusterName: ClusterB
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
    configuration:
        istio:
            enabled: false
        introspectorJobActiveDeadlineSeconds: 900
        model:
            domainType: WLS
            modelHome: '{{{modelHome}}}'
            runtimeEncryptionSecret: base-domain-runtime-encryption-secret


Friday, March 29, 2024

Weblogic Deploy Tool - WDT - discover domain with 4 managed servers

 HOWTO


See also 

GitHub



Create Weblogic domain via config.sh 




Discover domain via WDT


$ ./discoverDomain.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -admin_user weblogic -admin_url t3://dave:7001
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
WLST_EXT_CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /app/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 
/app/weblogic/oracle_common/common/bin/wlst.sh /app/weblogic-deploy/lib/python/discover.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -admin_user weblogic -admin_url t3://dave:7001

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Mar 29, 2024 10:20:37 AM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 29, 2024 10:20:37 AM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 29, 2024 10:20:37 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:20:37 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
Please enter the WebLogic administrator password: 
####<Mar 29, 2024 10:20:44 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:20:44 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:20:44 AM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 29, 2024 10:20:44 AM> <INFO> <discover> <main> <WLSDPLY-06024> <No variable file provided. Model passwords will contain the token '-- FIX ME --'>

####<Mar 29, 2024 10:20:45 AM> <INFO> <discover> <_get_domain_name> <WLSDPLY-06022> <Discover domain base_domain>
####<Mar 29, 2024 10:20:46 AM> <INFO> <TopologyDiscoverer> <discover> <WLSDPLY-06600> <Discovering domain model topology>
####<Mar 29, 2024 10:20:47 AM> <INFO> <WlstHelper> <is_set> <WLSDPLY-00129> <Error calling isSet() for attribute ResourceManagement at location /: java.lang.AssertionError: java.lang.reflect.InvocationTargetException>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain AdminConsole>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain CdiContainer>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JMX>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JPA>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JTA>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain Log>
####<Mar 29, 2024 10:20:49 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain RestfulManagementServices>
####<Mar 29, 2024 10:20:49 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06601> <Discovering 2 clusters>
####<Mar 29, 2024 10:20:49 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterA>
####<Mar 29, 2024 10:20:52 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterB>
####<Mar 29, 2024 10:20:54 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06603> <Discovering 5 servers>
####<Mar 29, 2024 10:20:54 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server AdminServer>
####<Mar 29, 2024 10:21:07 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA1>
####<Mar 29, 2024 10:21:19 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA2>
####<Mar 29, 2024 10:21:31 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB1>
####<Mar 29, 2024 10:21:43 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB2>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06607> <Discovering 4 Migratable Targets>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA1 (migratable)>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA2 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB1 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB2 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06605> <Discovering 0 server templates>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_unix_machines> <WLSDPLY-06609> <Discovering 2 Unix machines>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06611> <Discovering 2 machines>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineA>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineB>
####<Mar 29, 2024 10:21:56 AM> <INFO> <TopologyDiscoverer> <discover_security_configuration> <WLSDPLY-06622> <Adding Security Configuration>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <get_embedded_ldap_configuration> <WLSDPLY-06639> <Skipping Embedded LDAP Server Configuration>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_log_filters> <WLSDPLY-06628> <Discovering 0 Log Filters>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_reliable_delivery_policies> <WLSDPLY-06630> <Discovering 0 Reliable Delivery Policies>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_virtual_hosts> <WLSDPLY-06647> <Discovering 0 Virtual Hosts>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_xml_entity_caches> <WLSDPLY-06632> <Discovering 0 XML Entity Caches>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_xml_registries> <WLSDPLY-06634> <Discovering 0 XML Registries>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_ws_securities> <WLSDPLY-06649> <Discovering 0 Web Service Securities>
####<Mar 29, 2024 10:21:58 AM> <INFO> <ResourcesDiscoverer> <discover> <WLSDPLY-06300> <Discovering domain model resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_self_tuning> <WLSDPLY-06441> <Adding Self Tuning>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_startup_classes> <WLSDPLY-06442> <Discovering 0 Startup Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_shutdown_classes> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <_get_webapp_container> <WLSDPLY-06615> <Cross Domain Security is enabled, do not remove SecurityConfiguration CredentialEncrypted>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_singleton_service> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_jolt_connection_pool> <WLSDPLY-06449> <Discovering 0 Jolt Connection Pools>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_wtc_servers> <WLSDPLY-06451> <Discovering 0 WTC Servers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06340> <Discovering 0 JDBC System Resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_foreign_jndi_providers> <WLSDPLY-06342> <Discovering 0 Foreign JNDI Providers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_mail_sessions> <WLSDPLY-06344> <Discovering 0 Mail Sessions>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_file_stores> <WLSDPLY-06346> <Discovering 0 File Stores>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_jdbc_stores> <WLSDPLY-06350> <Discovering 0 JDBC Stores>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_path_services> <WLSDPLY-06355> <Discovering 0 Path Services>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_servers> <WLSDPLY-06470> <Discovering 0 JMS Servers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_saf_agents> <WLSDPLY-06472> <Discovering 0 SAF Agents>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_system_resources> <WLSDPLY-06478> <Discovering 0 JMS System Resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridge_destinations> <WLSDPLY-06474> <Discovering 0 JMS Bridge Destinations>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridges> <WLSDPLY-06476> <Discovering 0 JMS Messaging Bridges>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CommonResourcesDiscoverer> <get_wldf_system_resources> <WLSDPLY-06357> <Discovering 0 WLDF System Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CommonResourcesDiscoverer> <_get_named_resources> <WLSDPLY-06364> <Discovering 0 SystemComponent elements>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CoherenceResourcesDiscoverer> <_get_coherence_clusters> <WLSDPLY-06311> <Discovering 0 Coherence Cluster System Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <DeploymentsDiscoverer> <discover> <WLSDPLY-06380> <Discovering domain model deployments>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantDiscoverer> <discover> <WLSDPLY-06700> <Discover Multi-tenant>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantTopologyDiscoverer> <discover> <WLSDPLY-06709> <Discover Multi-tenant Topology>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantResourcesDiscoverer> <discover> <WLSDPLY-06707> <Discover Multi-tenant Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 29, 2024 10:21:59 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type discover found in filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 29, 2024 10:21:59 AM> <INFO> <variable_injector> <inject_variables_keyword_file> <WLSDPLY-19519> <No variables were inserted into the model during variable replacement>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST ONLINE mode>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDomain.yaml model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05005> <Performing archive validation on the /git/weblogic/wdt/DiscoveredABDomain.zip archive file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a appDeployments section, validation of appDeployments was skipped.>

Issue Log for discoverDomain version 3.5.4 running WebLogic version 14.1.1.0.0 online mode:

Total:   SEVERE :    0  WARNING :    0

discoverDomain.sh completed successfully (exit code = 0)


Created model 

$ cat /git/weblogic/wdt/DiscoveredABDomain.yaml
# This model was created using the WebLogic Deploy Tooling 3.5.4 discoverDomain tool
# running in ONLINE mode against a domain using WebLogic Server 14.1.1.0.0.
# 
domainInfo:
    AdminUserName: --FIX ME--
    AdminPassword: --FIX ME--
topology:
    Name: base_domain
    Cluster:
        ClusterA: {}
        ClusterB: {}
    Server:
        AdminServer:
            Machine: machineA
        ManagedServerA1:
            ListenPort: 7003
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA1
                Cluster: ClusterA
        ManagedServerA2:
            ListenPort: 7004
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA2
                Cluster: ClusterA
        ManagedServerB1:
            ListenPort: 7005
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB1
                Cluster: ClusterB
        ManagedServerB2:
            ListenPort: 7006
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB2
                Cluster: ClusterB
    MigratableTarget:
        ManagedServerA1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA1
            Cluster: ClusterA
        ManagedServerA2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA2
            Cluster: ClusterA
        ManagedServerB1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB1
            Cluster: ClusterB
        ManagedServerB2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB2
            Cluster: ClusterB
    Machine:
        machineA: {}
        machineB: {}
    SecurityConfiguration:
        NodeManagerPasswordEncrypted: --FIX ME--


Extract domain 

$ ./extractDomainResource.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file  /git/weblogic/wdt/DiscoveredABDomain.yaml  -output_dir  /git/weblogic/wdt/resource/k8s -target wko
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar
JAVA_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console= 
/usr/java/jdk-11/bin/java -cp /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar           -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console=            -Dpython.path=/app/weblogic/wlserver/common/wlst/modules/jython-modules.jar/Lib           org.python.util.jython           /app/weblogic-deploy/lib/python/extract_resource.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -output_dir /git/weblogic/wdt/resource/k8s -target wko
####<Mar 29, 2024 10:35:25 AM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling extractDomainResource version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 29, 2024 10:35:25 AM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The extractDomainResource program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 29, 2024 10:35:26 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type extract found in filter configuration file /app/weblogic-deploy/lib/targets/wko/target.json>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDomain.yaml model file>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a appDeployments section, validation of appDeployments was skipped.>
####<Mar 29, 2024 10:35:27 AM> <INFO> <vz_config_helper> <_create_file> <WLSDPLY-01662> <Creating target configuration file /git/weblogic/wdt/resource/k8s/wko-domain.yaml>
####<Mar 29, 2024 10:35:27 AM> <INFO> <crd_file_updater> <update_from_model> <WLSDPLY-01675> <Updating target output file "/git/weblogic/wdt/resource/k8s/wko-domain.yaml" from the kubernetes section of the model>

Issue Log for extractDomainResource version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

Total:   SEVERE :    0  WARNING :    0

extractDomainResource.sh completed successfully (exit code = 0)


Generated domain resource
$ cat /git/weblogic/wdt/resource/k8s/wko-domain.yaml
apiVersion: weblogic.oracle/v8
kind: Domain
metadata:
    name: base-domain
    namespace: base-domain
    labels:
        weblogic.domainUID: base-domain
spec:
    domainHome: /app/weblogic/user_projects/domains/base_domain/
    domainHomeSourceType: FromModel
    image: '{{{imageName}}}'
    # Add any credential secrets that are required to pull the image
    imagePullSecrets: []
    webLogicCredentialsSecret:
        name: base-domain-weblogic-credentials
    serverPod:
        env:
          - name: JAVA_OPTIONS
            value: -Dweblogic.StdoutDebugEnabled=false
          - name: USER_MEM_ARGS
            value: '-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m '
    clusters:
      - clusterName: ClusterA
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
      - clusterName: ClusterB
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
    configuration:
        istio:
            enabled: false
        introspectorJobActiveDeadlineSeconds: 900
        model:
            domainType: WLS
            modelHome: '{{{modelHome}}}'
            runtimeEncryptionSecret: base-domain-runtime-encryption-secret