Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wsadmin - JVM custom properties

Status
Not open for further replies.

Jboy123

MIS
Jun 8, 2004
24
CH
Hi

Does anyone know how to set a JVM custom property in wsadmin? I know how to do it through Web Console (Application Servers > myServer > Process Definition > Java Virtual Machine > Custom Properties) but would much prefer to script this.

Any ideas? Many Thanks.
J

 
I just discovered how to do this in the last two days! I have extracted the relevant sections to your question. Hopefully, there is not too much missing.

The custom properties are of the following form:
name = value

By the way, how do you modify the properties for IBM Service Log (aka, activity.log) and the Diagnostic Trace Log (aka, trace.log).

Code:
#---------------------------------------------------------
proc readCustomProps {inputFilename customProps} {
#---------------------------------------------------------
   puts " "
   puts "################################################"
   puts "# readCustomProps - [mydate]"
   puts "################################################"

   if [catch {open $inputFilename r} FP] {
      puts "==> ERROR: Unable to open file $inputFilename: $FP"
      return -code break
   }

   set i 0
   while {[gets $FP line] >= 0} {
      incr i
      regexp {([^=]+)=([^=]+)} $line match variable value
      set variable [string trim $variable]
      set value [string trim $value]
      lappend customProps [list [list name $variable] [list required true] [list value $value]]
   }
   puts "==> Read $i values.\n"
   close $FP
   return -code ok
}

##############
# MAIN PROGRAM
##############

set inputFilename "myinputs.txt"

# Get custom properties from file
readCustomProps $inputFilename $customProps

set cellName "was9Cell"
set nodeName "was9Node"
set appServerName "myapp_was9_application"
set as [$AdminConfig getid /Cell:$cellName/Node:$nodeName/Server:$appServerName/]
set jvm [$AdminConfig list JavaVirtualMachine $as]
$AdminConfig modify $jvm [subst {{systemProperties {$customProps}}}]
 
I found out the answer to my question.

Code:
   set as [$AdminConfig getid /Cell:$cellName/Node:$nodeName/Server:$appServerName/]

   # IBM Service Activity Log
   set rls [$AdminConfig list RASLoggingService $as]
   $AdminConfig modify $rls [subst {{serviceLog {{enabled true} {name $activitylog} {size 2}}}}]

   # IBM Diagnostic Trace Service Log
   set ts [$AdminConfig list TraceService $as]
   $AdminConfig modify $ts [subst {{traceLog {{fileName $tracelog} {maxNumberOfBackupFiles 1} {rolloverSize 20}}}}]

   $AdminConfig save
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top