My Oracle Support Banner

Issue Using WLST to output thread.getCurrentRequest() to files (Doc ID 2306032.1)

Last updated on SEPTEMBER 15, 2017

Applies to:

Oracle WebLogic Server - Version 10.3.6 and later
Information in this document applies to any platform.

Symptoms

Using the following code:

from java.io import FileInputStream
import java.lang
import os
import string

propInputStream = FileInputStream("domains.properties")
configProps = Properties()
configProps.load(propInputStream)
ServerUrl = configProps.get("admin_url")
ConfigFile = configProps.get("config_file")
KeyFile = configProps.get("key_file")
connect(userConfigFile=ConfigFile,userKeyFile=KeyFile,url=ServerUrl)

serverRuntime()
cd('/')
writeInFile = 'Thread Name' + ',' + ' Module'
print '', writeInFile
cmd = "echo " + writeInFile + " >> currentStatus"
os.system(cmd)
servers=domainRuntimeService.getServerRuntimes()
print('################################################################')
print('# Stuck Thread Count Per Server')
print('################################################################')
for server in servers:
#print server.getName()
cd('/ThreadPoolRuntime/ThreadPoolRuntime')
cnt1=cmo.getStuckThreadCount()
cnt2=cmo.getHoggingThreadCount()
print server.getName(), cnt1, cnt2
for thread in cmo.getExecuteThreads():
x=thread.isHogger()
if ( x != 0 ):
writeInFile = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
print '', writeInFile
cmd = "echo " + writeInFile + " >> currentStatus"
os.system(cmd)
#a=str(thread.getName())
b=str(thread.getCurrentRequest())
#b1= 'Workmanager: default, Version: 0, Scheduled=false, Started=true, Started time: 46330 ms'
#c=str(thread.getModuleName())
writeInFile = b
print '', writeInFile
cmd = "echo " + writeInFile + " >> currentStatus"
os.system(cmd)

 

At the end of this script, we should be able to print the value of the variable b (thread.getCurrentRequest()) in the file currenttStatus.

But that is not happening.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.