WAS v8.5 > Script the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage specific configuration objects using properties files > Work with server properties files

Work with process definition properties files

We can use properties files to change the Java process definition of a server and the associated process execution, logs, monitoring policy, and JVM settings under a server.

Start the wsadmin scripting tool. To start wsadmin using the Jython language, run...

Using a properties file, we can modify a Java process definition properties.

Run administrative commands using wsadmin to extract a properties file for a Java process definition, validate the properties, and apply them to your configuration.

Action Procedure
create Not available
modify Edit properties and then run the applyConfigProperties command.
delete Not available

Optionally, we can use interactive mode with the commands:

  1. Edit JavaProcessDef properties file under a server.

    Open an editor on a properties file and edit the JavaProcessDef and associated process execution, logs, monitoring policy, and JVM properties under a server. We can copy the following example properties into an editor and modify them as needed for the situation:

    #
    # Header
    #
    ResourceType=JavaProcessDef
    ImplementingResourceType=GenericType
    ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=
    AttributeInfo=processDefinitions
    #
    
    #
    #Properties
    #
    executableTarget=com.ibm.ws.runtime.WsServer
    executableName=null
    stopCommand=null
    stopCommandArgs={}
    terminateCommand=null
    workingDirectory="${USER_INSTALL_ROOT}" #required
    startCommandArgs={}
    executableArguments={}
    startCommand=null
    executableTargetKind=JAVA_CLASS #ENUM(EXECUTABLE_JAR|JAVA_CLASS),default(JAVA_CLASS)
    terminateCommandArgs={}
    processType=null
    
    
    #
    # Header
    #
    ResourceType=ProcessExecution
    ImplementingResourceType=GenericType
    ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:ProcessExecution=
    AttributeInfo=execution
    #
    
    #
    #Properties
    #
    runAsUser=
    runAsGroup=
    runInProcessGroup=0 #integer,default(0)
    umask=022 #default(022)
    processPriority=20 #integer,default(20)
    
    
    #
    # Header
    #
    ResourceType=OutputRedirect
    ImplementingResourceType=GenericType
    ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:OutputRedirect=
    AttributeInfo=ioRedirect
    #
    
    #
    #Properties
    #
    stdinFilename=null
    stderrFilename="${SERVER_LOG_ROOT}/native_stderr.log" #required
    stdoutFilename="${SERVER_LOG_ROOT}/native_stdout.log" #required
    
    # Header 
    #
    ResourceType=MonitoringPolicy
    ImplementingResourceType=GenericType
    ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:MonitoringPolicy=
    AttributeInfo=monitoringPolicy
    
    #Properties
    #
    maximumStartupAttempts=3 #integer,required,default(0)
    pingTimeout=300 #integer,required,default(0)
    pingInterval=60 #integer,default(0)
    nodeRestartState=STOPPED #ENUM(PREVIOUS|STOPPED|RUNNING),default(STOPPED)
    autoRestart=true #boolean,default(true)
    
    #
    # Header : Make sure JavaHome is not in the property list or it is unchanged as it is readonly
    #
    ResourceType=JavaVirtualMachine
    ImplementingResourceType=GenericType
    ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:JavaVirtualMachine=
    AttributeInfo=jvmEntries
    
    #Properties
    #
    internalClassAccessMode=ALLOW #ENUM(ALLOW|RESTRICT),default(ALLOW)
    JavaHome="C:\WAS70.cf050923.16/java" #readonly
    debugArgs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777"
    classpath={}
    initialHeapSize=0 #integer,default(0)
    runHProf=false #boolean,default(false)
    genericJvmArguments=
    hprofArguments=
    osName=null
    bootClasspath={}
    verboseModeJNI=false #boolean,default(false)
    maximumHeapSize=0 #integer,default(0)
    disableJIT=false #boolean,default(false)
    verboseModeGarbageCollection=false #boolean,default(false)
    executableJarFileName=null
    verboseModeClass=false #boolean,default(false)
    debugMode=false #boolean,default(false)
    
    EnvironmentVariablesSection
    #
    #Environment Variables
    cellName=WASCell06
    serverName=myServer
    nodeName=WASNode04

  2. Run the applyConfigProperties command.

    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'])


Results

We can use the properties file to manage the Java process definition.

Save the changes to your configuration.


Related

Extracting properties files using wsadmin.sh
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Delete server, cluster, application, or authorization group objects using properties files


Reference:

PropertiesBasedConfiguration command group for AdminTask using wsadmin.sh


+

Search Tips   |   Advanced Search