pack and unpack domain files in distributed WebLogic domain

The blog discuss about the technical approach on distributing domain files among distributed WebLogic domain infrastructure , means where multiple machines are installed with same WebLogic version installation but have to share the same domain to be used in distributed infrastructure. 

Lets consider we have 2 machine mach1 and mach2 installed with WebLogic Server. 

Machine1 (mach01) :

  • Weblogic Server Installed
  • Managed Servers (mach_ms1, mach_ms2)
  • Domain: dev_soadomain

Machine2 (mach02) :

  • Weblogic Server Installed
  • Managed Servers (mach_ms3, mach_ms4)

Now , our requirement is to have machine2 to be part of the same domain dev_soadomain created in machine1 to be part of the clustered WebLogic domain

Distribute domain files to another WebLogic Server using pack and unpack

  • Log into Machine1 Weblogic Server Admin User
  • Navigate to WebLogic domain folder
[wls@mach01]$ cd $WL_HOME/common/bin
  • Run the below given command to pack the WebLogic domain file from machine1 (mach01)
[wls@mach01]$ ./pack.sh -domain=$DOMAIN_HOME-template=$WL_HOME/
common/templates/domains/DEV_SOADOMAIN_template.jar -template_
name=DEV_SOADOMAIN –managed=true
  • A file is created at $WL_HOME/common/templates/domains/DEV_SOADOMAIN_template.jar
  • Log into Machine2 Weblogic Server Admin User
  • Naviage to weblogic domain folder
  • Copy the DEV_SOADOMAIN_template.jar from machine1(mach01) to machine2(mach02)
[wls@mach02]$ scp wls@mach01:$WL_HOME/common/templates/domains/
DEV_SOADOMAIN_template.jar $WL_HOME/common/templates/domains/
  • Unpack the DEV_SOADOMAIN_template.jar in machine2(mach02) domain folder
[wls@mach02]$ cd $WL_HOME/common/bin
[wls@mach02]$ ./unpack.sh -template=$WL_HOME/common/templates/
domains/DEV_SOADOMAIN_template.jar –domain=$DOMAIN_HOME
  • An entry to the DEV_SOADOMAIN domain will automatically be added to the nodemanager.properties file

Distribute domain files to another WebLogic Server manually

  • Domain Directory in machine1
DOMAIN_HOME = oracle/Middleware/user_projects/domains/DEV_SOADOMAIN
  • Log into Machine2 Weblogic Server Admin User
  • Create the Domain Directory with the same name as in machine1
[wls@mach02]$ mkdir –p $DOMAIN_HOME

Copy the Domain files from machine1 to machine2

[wls@mach02]$ scp –rp wls@mach01:$DOMAIN_HOME $DOMAIN_HOME/..

Edit the e nodemanager.domains in machine1 and make the entry

[wls@mach01]$ vi $WL_HOME/common/nodemanager/nodemanager.domains
DEV_SOADOMAIN=/oracle/Middleware/user_projects/domains/DEV_SOADOMAIN/

weblogic domain error Malformed argument has embedded quote

The below error encountered when try to create the integrated weblogic domain in Jdeveloper 12.2.1.4.0 ” Malformed argument has embedded quote”  , “java.io.IOException: Cannot run program “cmd.exe”

"C:\oraclesoabpm\oracle_common\common\bin\wlst.cmd" "C:\Users\user\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py""
Cannot run program "cmd.exe" (in directory "C:\oraclesoabpm\oracle_common\common\bin"): Malformed argument has embedded quote: "C:\oraclesoabpm\oracle_common\common\bin\wlst.cmd" "C:\Users\user\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py"
java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\oraclesoabpm\oracle_common\common\bin"): Malformed argument has embedded quote: "C:\oraclesoabpm\oracle_common\common\bin\wlst.cmd" "C:\Users\user\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py"
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at oracle.jdevimpl.adrs.weblogic.wlst.ScriptRunnerImpl.runScript(ScriptRunnerImpl.java:106)
at oracle.jdevimpl.adrs.weblogic.builder.DomainScriptRunnerImpl.runScript(DomainScriptRunnerImpl.java:146)
at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder.createDomain(DefaultDomainBuilder.java:606)
at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder.build(DefaultDomainBuilder.java:274)
at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder$1.run(DefaultDomainBuilder.java:225)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

The below steps can be performed to resolve the Malformed argument issue.

  1. Navigate to the Jdeveloper 
<MW_HOME>\jdeveloper\ide\bin

2. Open the ide.conf file in the text editor . Enter the below given VM Argument details in the  OSGi configuration options

AddVMOption -Djdk.lang.Process.allowAmbiguousCommands=true

# Other OSGi configuration options for locating bundles and boot delegation.
#
AddVMOption -Dorg.eclipse.equinox.simpleconfigurator.configUrl=file:bundles.info
AddVMOption -Dosgi.bundles.defaultStartLevel=1
AddVMOption -Dosgi.configuration.cascaded=false
AddVMOption -Dosgi.noShutdown=true
AddVMOption -Dorg.osgi.framework.bootdelegation=*
AddVMOption -Dosgi.parentClassloader=app
AddVMOption -Dosgi.locking=none
AddVMOption -Dosgi.contextClassLoaderParent=app
AddVMOption -Djdk.lang.Process.allowAmbiguousCommands=true

3. Restart the JDeveloper . Run the Integrated weblogic domain again.

[Waiting for the domain to finish building...]
[10:29:28 AM] IntegratedWebLogicServer Domain is invalid. Regenerating it...
[10:29:30 AM] Creating IntegratedWebLogicServer Domain... [10:32:19 AM] Extending IntegratedWebLogicServer Domain...