Problem WLST script to create OSB Domain with AdminServer+1 ManagedServer
I created a python script that should create a OSB domain containing an Admin Server and one Managed Server. This script creates a domain but with some errors. Somehow not all resources are correctly targeted. Both FileStores (FileStore,WseeFileStore) do not have a target (null value). The SAFAgent (ReliableWseeSAFAgent) also does not have a target specified. I also have my doubts concerning the following parts within the config.xml of the created domain (see bold):
<library>
<name>weblogic-controls-1.0#1.0@1.0</name>
<target>ManagedServer1</target>
<source-path>/apps/bea/workshop_10.3/common/deployable-libraries/weblogic-controls-1.0.ear</source-path>
<sub-deployment>
<name>WlwRuntimeAppScopedJMS</name>
<target>ManagedServer1</target>
<sub-deployment>
<name>cgJMSServer</name>
<target> ManagedServer1 </target>
</sub-deployment>
</sub-deployment>
<deployment-order>1</deployment-order>
</library>
When I create a domain with configuration wizard the subdeployment target is not ManagedServer1 but WseeJmsServer. This can also be seen for the weblogic-controls-10.0#10.0@10.2 library.
So it looks like the adding of OSB template (+workshop/web services template) and updating of the domain somehow goes wrong with my scripts where I first add a Managed Server to a default weblogic domain template. I copied my script below.
What I am doing wrong? I can of course fix my domain by targetting the resources using a assign(..,..,'Target',...) in my script after adding the templates but this does not feel the right solution to me. -----
h6. createDomainScript
import sys
print "@@@ Starting the script ..."
global props
try:
# Open a domain template.
readTemplate(wl_home + 'common/templates/domains/wls.jar')
#=======================================================================================
# Create Admin Server and configure it.
#
#=======================================================================================
cd('Servers/AdminServer')
set('ListenPort', long(admin_port) )
set('ListenAddress',admin_address)
create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'True')
set('ListenPort', long(admin_sslport))
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setName(domain_user)
cmo.setPassword(domain_passwd)
#=======================================================================================
# Create Unix Machine.
#
#=======================================================================================
cd('/')
create(ma_name,'UnixMachine')
cd('Machine/' + ma_name)
set('PostBindGID','weblogic')
set('PostBindGIDEnabled','true')
set('PostBindUID','weblogic')
set('PostBindUIDEnabled','true')
set('Address',ma_address)
create(nm_name,'NodeManager')
cd('NodeManager/'+nm_name)
set('ListenAddress',nm_address)
set('NMType','SSL')
set('NodeManagerHome',nm_home)
#=======================================================================================
# Create Managed Server and configure it.
#
#=======================================================================================
cd('/')
create(ms_name, 'Server')
cd('Server/'+ms_name)
set('ListenPort', long(ms_port))
set('ListenAddress', ms_address)
set('ManagedServerIndependenceEnabled','true')
set('MSIFileReplicationEnabled','false')
set('AutoRestart','true')
set('Machine',ma_name)
create(ms_name,'ServerStart')
cd('ServerStart/'+ms_name)
set('BeaHome',bea_home)
cp = '.:'+bea_home+'patch_wlw1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:'+bea_home+'patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:'+bea_home+'patch_cie670/profiles/default/sys_manifest_classpath/weblogic_patch.jar:'+bea_home+'patch_alsb1031/profiles/default/sys_manifest_classpath/weblogic_patch.jar:'+java_home+'lib/tools.jar:'+wl_home+'server/lib/weblogic_sp.jar:'+wl_home+'server/lib/weblogic.jar:'+bea_home+'modules/features/weblogic.server.modules_10.3.0.0.jar:'+wl_home+'server/lib/webservices.jar:'+bea_home+'modules/org.apache.ant_1.6.5/lib/ant-all.jar:'+bea_home+'modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar::'+wl_home+'../modules/features/osb.server.modules_10.3.1.0.jar:'+bea_home+'osb_10.3/lib/flow/sb-flow.jar:'+wl_home+'../modules/com.bea.core.jaxen_1.0.1.0_1-1-1.jar:'+osb_home+'lib/version.jar:'+osb_home+'lib/alsb.jar:'+osb_home+'3rdparty/lib/j2ssh-ant.jar:'+osb_home+'3rdparty/lib/j2ssh-common.jar:'+osb_home+'3rdparty/lib/j2ssh-core.jar:'+osb_home+'3rdparty/lib/j2ssh-dameon.jar:'+osb_home+'3rdparty/classes:'+wl_home+'../modules/com.bea.core.apache.commons.logging_1.1.0.jar:'+osb_home+'lib/transports/jca/jca-binding-api.jar:'+osb_home+'lib/transports/jca/bpm-infra.jar:'+osb_home+'lib/transports/jca/log4j_1.2.8.jar:'+osb_home+'lib/transports/jca/xmlparserv2.jar:'+wl_home+'server/ext/jdbc/oracle/orai18n.jar:'+wl_home+'server/lib/xqrl.jar::'
set('ClassPath', cp )
set('JavaHome',java_home)
set('JavaVendor',java_vendor)
set('RootDirectory',domaintarget)
cd('../../')
create(ms_name,'SSL')
cd('SSL/'+ms_name)
set('Enabled', 'True')
set('ListenPort', long(ms_sslport))
setOption('OverwriteDomain', 'true')
setOption('ServerStartMode', server_startmode )
writeDomain(domaintarget)
closeTemplate()
readDomain(domaintarget)
addTemplate(workshop_home + 'common/templates/applications/workshop_wl.jar')
addTemplate(wl_home + 'common/templates/applications/wls_webservice.jar')
addTemplate(osb_home + 'common/templates/applications/wlsb.jar')
updateDomain()
closeDomain()
except:
dumpStack()
print "Unexpected error:", sys.exc_info()[0]
raise
-----
h6. domain.properties
# weblogic settings
bea_home=/apps/bea/
osb_home=/apps/bea/osb_10.3/
wl_home=/apps/bea/wlserver_10.3/
workshop_home=/apps/bea/workshop_10.3/
java_home=/apps/bea/jrockit_160_05
java_vendor=BEA
# database settings
db_server=localhost
db_name=XE
db_user=WEBLOGIC
db_passwd=WEBLOGIC
# domain settings
domaintarget=/apps/bea/domains/DEMO_DOMAIN
admin_port=7101
admin_address=192.168.137.128
admin_sslport=7102
domain_user=weblogic
domain_passwd=weblogic
server_startmode=prod
ms_name=ManagedServer1
ms_port=7001
ms_address=192.168.137.128
ms_sslport=7002
ma_name=centos
ma_address=192.168.137.128
nm_name=centos
nm_address=192.168.137.128
nm_home=/apps/bea/wlserver_10.3/common/nodemanager/