1
votes

in a WSADMIN jacl Script how i can get wsadmin.properties values ? for example the "com.ibm.ws.scripting.traceFile" ?

i already try with

puts $com.ibm.ws.scripting.traceFile

buts return

can't read "com.ibm.ws.scripting.traceFile": no such variable while executing "puts $com.ibm.ws.scripting.traceFile"

1

1 Answers

1
votes

The values stored in wsadmin.properties are loaded into the JVM, and are stored as System Properties. You can obtain the values of these properties by working with Java's java.lang.System object, and then retrieving the specific property you want:

Here's the JACL code:

package require java

set sysprops [java::call System getProperties]
set traceFile [[$sysprops get com.ibm.ws.scripting.traceFile] toString]

puts "trace file: $traceFile"

For anyone interested, here's the Jython equivalent:

from java.lang import System as javasystem

sysprops = javasystem.getProperties()
traceFile = sysprops.get('com.ibm.ws.scripting.traceFile')

print "traceFile: " + traceFile