Working with application server properties files

You can use properties files to create or change application server properties and the associated StateManageable instance under a server.

Before you begin

Determine the changes that you want to make to your application server configuration.

Start the wsadmin scripting tool. To start wsadmin using the Jython language, run the wsadmin -lang jython command from the bin directory of the server profile.

About this task

Using a properties file, you can create, modify, or delete an application server properties.

Run administrative commands using wsadmin to create or change a properties file for an application server, validate the properties, and apply them to your configuration.

Table 1. Actions for application server properties files . You can create, modify, and delete application server properties.
Action Procedure
create Not available
modify Edit properties and then run the applyConfigProperties command.
delete Not available
create Property Set properties and then run the applyConfigProperties command.
delete Property Run the deleteConfigProperties command.

Optionally, you can use interactive mode with the commands:

AdminTask.command_name('-interactive')

Procedure

  • Modify a properties file for an ApplicationServer object.
    1. Obtain a properties file for the application server that you want to change.

      You can extract a properties file for an ApplicationServer using the extractConfigProperties command.

    2. Open the properties file in an editor and change the properties as needed.

      For example, modify the ApplicationServer and associated StateManageable under a server. The following properties file shows a property under ApplicationServer with name myName and value myVal:

      #
      # Header
      #
      ResourceType=ApplicationServer
      ImplementingResourceType=ApplicationServer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=
      AttributeInfo=components
      #
      
      #
      #Properties
      #
      applicationClassLoaderPolicy=MULTIPLE #ENUM(MULTIPLE|SINGLE),default(MULTIPLE)
      name=null
      applicationClassLoadingMode=PARENT_FIRST #ENUM(PARENT_FIRST|PARENT_LAST),default(PARENT_FIRST)
      server=!{serverName}
      parentComponent=null
      id=-1 #long,default(-1)
      
      
      #
      # Header
      #
      ResourceType=StateManageable
      ImplementingResourceType=ApplicationServer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=:StateManageable=
      AttributeInfo=stateManagement
      #
      
      #
      #Properties
      #
      initialState=START #ENUM(STOP|START),default(START)
      managedObject=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer= #ObjectName(ApplicationServer),readonly
      
      
      #
      # Header
      #
      ResourceType=ApplicationServer
      ImplementingResourceType=ApplicationServer
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=
      AttributeInfo=properties(name,value)
      #
      
      #
      #Properties
      #
      myName=myVal
      #
      
      EnvironmentVariablesSection
      #
      #Environment Variables
      cellName=WASCell06
      serverName=myServer
      nodeName=WASNode04
    3. Run the applyConfigProperties command to change an application server configuration and create any new properties.

      Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:

      AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
  • Delete application server properties.

    To delete one or more properties, specify only those properties to delete in the properties file and run deleteConfigProperties; for example:

    AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]') 

Results

You can use the properties file to configure and manage the application server object.

What to do next

Save the changes to your configuration.