WLSTException:错误提示到第4行的MBean [英] WLSTException: Error cding to the MBean on line 4

查看:282
本文介绍了WLSTException:错误提示到第4行的MBean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个wlst脚本来创建多个连接工厂。代码如下:

I have written a wlst script to create multiple connection factories. Code is as below :

def createJMSConnFac(systemModuleName,ConnectionFactoryJNDIName,connectionFactoryName):
    cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName)
    cmo.createConnectionFactory(connectionFactoryName)
    cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName)
    cmo.setJNDIName(ConnectionFactoryJNDIName)
    print "Created a ConnectionFactory !!"
    cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName+'/SecurityParams/'+connectionFactoryName)
    cmo.setAttachJMSXUserId(false)
    cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName)
    cmo.setDefaultTargetingEnabled(true)
    print "Targeted the ConnectionFactory !!"

调用此方法的循环是:

y=1
while(y <= int(total_conf)):
    print '----------- Connection Factory Creation ---------'
    print 'Total Conf :' +total_conf
    conf_name=configProps.get("conf_name"+ str(a) + "." +str(y))
    conf_jndi=configProps.get("conf_jndi"+ str(a) + "." +str(y))
    print 'Conf Name :' +conf_name
    print 'Conf JNDI :' +conf_jndi
    print 'Conf JMS Mod Name :'+jms_mod_name
    print a
    print y
    createJMSConnFac(jms_mod_name,conf_jndi,conf_name)
    y = y + 1

这里要注意的有趣的事情是:它正确地创建了connfac1,但是只要它进行第二次迭代时间,它抛出一个错误:

Interesting thing to note here is that : It creates connfac1 properly however as soon as it iterates for second time , it throws me an error saying :

WLSTException:错误提示第4行的MBean

正在打印jms_mod_name,conf_jndi和conf_name的值在两次迭代中都正确。
还有其他我可能会想念的东西吗?请求帮助

The values of jms_mod_name , conf_jndi and conf_name are being printed properly in both the iterations. Is there anything else that I may be missing here ? Request your help

谢谢,
Bhavin

Thanks , Bhavin

推荐答案

我可以使用以下代码创建3个(或更多)CF:

I was able to create 3(or more) CFs with this code :

def createJMSConnFac(systemModuleName,ConnectionFactoryJNDIName,connectionFactoryName):
    cmo=cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName)
    cmo.createConnectionFactory(connectionFactoryName)
    cmo=cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName)
    cmo.setJNDIName(ConnectionFactoryJNDIName)
    print "Created a ConnectionFactory !!"
    cmo=cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName+'/SecurityParams/'+connectionFactoryName)
    cmo.setAttachJMSXUserId(false)
    cmo=cd('/JMSSystemResources/'+systemModuleName+'/JMSResource/'+systemModuleName+'/ConnectionFactories/'+connectionFactoryName)
    cmo.setDefaultTargetingEnabled(true)
    print "Targeted the ConnectionFactory !!"

connect("weblogic","password","t3://host:port")
edit()
startEdit()
y=1
while(y <= 3):
    print '----------- Connection Factory Creation ---------'
    conf_name="conf_name." +str(y)
    conf_jndi="conf_jndi." +str(y)
    print 'Conf Name :' +conf_name
    print 'Conf JNDI :' +conf_jndi
    #print a
    print y
    createJMSConnFac('testModule',conf_jndi,conf_name)
    y = y + 1
save()
activate(block="true")
disconnect()

这篇关于WLSTException:错误提示到第4行的MBean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆