Network Deployment (Distributed operating systems), v8.0 > Scripting 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 Java virtual machine (JVM) settings under a server.
Determine the changes to make to your Java process definition configuration or its configuration objects.
Start wsadmin.sh.
To start wsadmin using the Jython language, run...
WP_PROFILE/bin/wsadmin -lang jython
Use a properties file, you 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 the configuration.
Actions for Java process definition properties files. We can modify Java process definition properties.
Action Procedure create Not available modify Edit properties and then run applyConfigProperties. delete Not available Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- 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 your 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- Run applyConfigProperties.
Run applyConfigProperties 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 configure and manage the Java process definition.
What to do next
Save the changes to the configuration.
Extract 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
Related
PropertiesBasedConfiguration command group using wsadmin.sh