title: WLSTException: Error cding to the MBean on line 4
body: <p>I have written a wlst script to create multiple connection factories. Code is as below :</p>
  
  <pre><code>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 !!"
  </code></pre>
  
  <p>And the loop from which this method gets called is :</p>
  
  <pre><code>y=1
  while(y &lt;= 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
  </code></pre>
  
  <p>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 :</p>
  
  <p><code>WLSTException: Error cding to the MBean on line 4</code></p>
  
  <p>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</p>
  
  <p>Thanks ,
  Bhavin</p>