我 我正在使用此python脚本使用属性文件创建JMS队列,我的属性文件名是domain.properties,错误是WLSTException:执行connect时出错:ServerUrl
{from java.io import FileInputStream
import java.lang
import os
import string
propInputStream = FileInputStream('domain.properties')
configProps = Properties()
configProps.load(propInputStream)
ServerUrl = configProps.get('server.url')
Username = configProps.get('username')
Password = configProps.get('password')
jmsServerName = configProps.get('jms.server.name')
systemModuleName = configProps.get('system.module.name')
queueSubDeploymentName = configProps.get('queue.sub.deployment.name')
queueName = configProps.get('queue.name')
queueJNDIName = configProps.get('queue.jndi.name')
connect('Username','Password', 'ServerUrl')
edit()
print "================== Queue ==================="
startEdit()
cd('/')
cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName)
cmo.createQueue(queueName)
print 'Created a Queue !!'
cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/Queues/'+queueName)
cmo.setJNDIName(queueJNDIName)
cmo.setSubDeploymentName(queueSubDeploymentName)
cd('/SystemResources/'+systemModuleName+'/SubDeployments/'+queueSubDeploymentName)
set('Targets',jarray.array([ObjectName('com.bea:Name='+jmsServerName+',Type=JMSServer')], ObjectName))
print 'Targeted the Queue to the created subdeployment !!'
activate()
print "success"
cmd = "rm -f wlst.log"
os.system(cmd)}
**and finally i got the error
WLSTException: Error occurred while performing connect: ServerUrl**
答案 0 :(得分:0)
connect('Username','Password','ServerUrl')
这些参数是静态字符串,而不是从属性文件中读取的变量 你应该删除单引号。
connect(Username,Password, ServerUrl)