+

Search Tips   |   Advanced Search

Work with process definition properties files

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.

Determine the changes to make to your Java process definition configuration or its configuration objects.

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.

Use a properties file to 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 the 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:

AdminTask.command_name('-interactive')


Tasks

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

Use the properties file to configure and manage the Java process definition.


What to do next

Save the changes to the configuration.

  • Extracting properties files
  • Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
  • Deleting server, cluster, application, or authorization group objects using properties files
  • PropertiesBasedConfiguration .