Applying properties files
Use this topic and wsadmin to apply modified configuration properties to the environment using properties files.
Use the extractConfigProperties command in the PropertiesBasedConfiguration command group to extract the properties files of interest. Use a text editor to modify one or more values in the properties file.
Use the validateConfigProperties command in the PropertiesBasedConfiguration command group to validate the modified properties file before applying the file to the configuration.
We cannot apply a z/OS operating system properties file directly to a distributed operating system. Similarly, we cannot apply a distributed operating system properties file directly to a z/OS operating system. gotcha We can also use interactive mode with these commands, as the following syntax demonstrates:
AdminTask.commandName('-interactive')
- Modify one or more properties and apply the properties file to the configuration.
- Launch the wsadmin scripting tool using the Jython scripting language.
- Modify the properties of interest. In the following properties file, use a text editor to change the value of the enableSFSB property:
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=ID#ApplicationServer_1:EJBContainer=ID#EJBContainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp"enableSFSBFailover=true #boolean server=null parentComponent=ND Server
EnvironmentVariablesSection # # #Environment Variables #Thu Apr 17 14:10:31 CDT 2008 hostName2=* hostName1=localhost cellName=IBM-49F7FB781FECell07 nodeName=IBM-49F7FB781FECellManager07 hostName=IBM-49F7FB781FE.mpls.setgetweb.com serverName=dmgr enableSSB=true
- Apply the modified properties to the configuration. Use the applyConfigProperties command to apply the properties file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props]')- Use additional user modified variables to modify the configuration.
- Launch the wsadmin scripting tool using the Jython scripting language.
- Use additional variables to modify the enableSFSBFailover property of the EJB container, changing the value from true to false.
In the following properties file, modify the enableSFSBFailover property by specifying the value as the !{enableSSB} variable. Use the variable in the section header or in the properties part of the section. Also, one property value can contain multiple variables as shown for ResourceId.
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=ID#ApplicationServer_1:EJBContainer=ID#EJBContainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp"enableSFSBFailover=!{enableSSB} #boolean server=null parentComponent=ND Server
EnvironmentVariablesSection # # #Environment Variables #Thu Apr 17 14:10:31 CDT 2008 hostName2=* hostName1=localhost cellName=IBM-49F7FB781FECell07 nodeName=IBM-49F7FB781FECellManager07 hostName=IBM-49F7FB781FE.mpls.setgetweb.com serverName=dmgr
enableSSB=true
- Apply the modified properties to the configuration. Use the applyConfigProperties command to apply the properties file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props]')- Modify the configuration by applying a properties file and a variable map.
- Launch the wsadmin scripting tool using the Jython scripting language.
- Modify the enableSFSBFailover property of the EJB container, changing the value from true to false. Modify the enableSFSBFailover property by specifying the value as the !{enableSSB} variable in a separate variable map file. Instead of specifying the variable in the section header or in the properties part of the section, create a separate variable map file.
The following code displays a sample variable map file:
ejbprops.vars: # # #Environment Variables #Day Month 11 Time CDT Year hostName2=* hostName1=localhost cellName=myCell nodeName=myNode hostName=myhost.com serverName=myServer enableSSB=true
The following code displays the corresponding properties file to apply to the configuration:
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=ID#ApplicationServer_1:EJBContainer=ID#EJBContainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp" enableSFSBFailover=true#boolean server=null parentComponent=ND Server- Apply the modified properties to the configuration. Use the applyConfigProperties command to apply the properties file and the variable map file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props -variablesMapFileName ejbprops.vars]')
What to do next
To verify that the system made the changes to the configuration, extract the properties file from the configuration using the extractPropertiesFile command.
Related tasks
Extracting properties files
Validating properties files
Create server, cluster, application, or authorization group objects using properties files
Delete server, cluster, application, or authorization group objects using properties files
Create and deleting configuration objects using properties files
Manage environment configurations using properties files
Extracting properties files to troubleshoot the environment
Manage servers and nodes with scripting
Related
PropertiesBasedConfiguration