Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

weblogic - jython create work manager but I get the new attribute not found error how can i fix this

I was created array from text file in jython for use the wlst scripts. But jython scripts finished with error. The error I get is as follows

import sys
import os
import jarray
import dircache
from java.io import File
from java.lang import String

myPropertyFile = "workManagerProperties.properties" 

def connection():
  print '===> Connecting as '+ username + ' To WebLogic URL ' + url + '...'
  try:
    connect(username, password, url)
  except WLSTException:
    print '==> Error Connecting to The URL ' + url
    CancelEdit('y')
    exit()

loadProperties(myPropertyFile)
url=protocol + '://' + host + ':' + AdminPort
connection()

def main():
edit()
startEdit()
cd ('/Clusters')
Clusters = cmo.getClusters()
for clusters in Clusters:
        svr = clusters.getName()
print svr 
input=open("/oracle12c/scripts/BS_WM_multiple.txt",'r')
m=input.readlines()
input.close()
z=[]
for v in m:
    z.append(v)
print z[0]

a=0
for i in z:    
    workManagerName=z[a] 
    print '======= Creating a WorkManager name as ======='
    cd('edit:/SelfTuning/' + domainName + '/WorkManagers/')
    create(workManagerName,'WorkManagers')
    cd('edit:/SelfTuning/' + domainName + '/WorkManagers/') 
    cd(workManagerName)
    ls('a')
    set('Targets',jarray.array([ObjectName('com.bea:Name='+svr+',Type=Cluster')], ObjectName))
    save()
    print ' WorkManager Created...'
    a=a+1
  save()
  activate(block="true")
main()
disconnect()

weblogic scripting tools jython scripts finished with error,The error I get is as follows.How can I fix this. This is the last point I come to. My already created attribute gives an error as not created.

======= Creating a WorkManager name as =======
MBean type WorkManager with name BPM_POST_AUTO_CHARGE_ORDER_INFO_BS_WM
has been created successfully.
BPM_POST_AUTO_CHARGE_ORDER_INFO_BS_WM

drw-   BPM_POST_AUTO_CHARGE_ORDER_INFO_BS_WM
Problem invoking WLST - Traceback (innermost last):
File "/oracle12c/scripts/wm_create/wm_test.py", line 52, in ?
File "/oracle12c/scripts/wm_create/wm_test.py", line 45, in main
File "<iostream>", line 165, in cd
File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing cd : Attribute 
BPM_POST_AUTO_CHARGE_ORDER_INFO_BS_WM
not found. Use ls('a') to view the attributes
question from:https://stackoverflow.com/questions/66064488/jython-create-work-manager-but-i-get-the-new-attribute-not-found-error-how-can-i

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...