1 Reply Latest reply: Apr 30, 2013 8:03 AM by MichaelBaygeldin RSS

    NameError while registering MDS repository

    MichaelBaygeldin
      Hello Experts!
      I have a problem with registering MDS repository through WLST.
      I have written Python script that should register MDS repository but when I try to run it, it says "[Deployment Script]: Unexpected error: exceptions.NameError"
      Here is my Python script:
      from java.io import FileInputStream
      
      propInputStream = FileInputStream("MDSRepository.properties")
      configProps = Properties()
      configProps.load(propInputStream)
      
      repositoryName=configProps.get("repository.name")
      dbVendor=configProps.get("db.vendor")
      host=configProps.get("host")
      port=configProps.get("port")
      sid=configProps.get("sid")
      user=configProps.get("user")
      password=configProps.get("password")
      
      adminURL=configProps.get("admin.url")
      adminUserName=configProps.get("admin.userName")
      adminPassword=configProps.get("admin.password")
      
      connect(adminUserName, adminPassword, adminURL)
      edit()
      startEdit()
      
      print '========================================='
      print 'Registering MDS Repository....'
      print '========================================='
      
      try:     
           registerMetadataDBRepository(repositoryName, dbVendor, host, port, sid, user, password)
      except:
           print '***** CANNOT REGISTER MDS REPOSITORY !!! *****'
           print "[Deployment Script]: Unexpected error:", sys.exc_info()[0]     
           print ''
      
      print '========================================='
      
      save()
      activate()
      disconnect()
      Here is my properties file:
      repository.name=portal-mds
      db.vendor=ORACLE
      host=localhost
      port=1521
      sid=orcl
      user=DEV_MDS
      password=somepassword
      
      admin.url=t3://localhost:7001
      admin.userName=weblogic
      admin.password=somepassword
      Here is how I call this script:
      java weblogic.WLST registerMDSRepository.py
      Here is output:
      Initializing WebLogic Scripting Tool (WLST) ...
      
      Welcome to WebLogic Server Administration Scripting Shell
      
      Type help() for help on available commands
      
      Connecting to t3://localhost:7001 with userid weblogic ...
      Successfully connected to Admin Server 'AdminServer' that belongs to domain 'just_some_domain'.
      
      Warning: An insecure protocol was used to connect to the
      server. To ensure on-the-wire security, the SSL port or
      Admin port should be used instead.
      
      Location changed to edit tree. This is a writable tree with
      DomainMBean as the root. To make changes you will need to start
      an edit session via startEdit().
      
      For more help, use help(edit)
      
      Starting an edit session ...
      Started edit session, please be sure to save and activate your
      changes once you are done.
      =========================================
      Registering MDS Repository....
      =========================================
      ***** CANNOT REGISTER MDS REPOSITORY !!! *****
      [Deployment Script]: Unexpected error: exceptions.NameError
      
      =========================================
      Saving all your changes ...
      Saved all your changes successfully.
      Activating all your changes, this may take a while ...
      The edit lock associated with this edit session is released
      once the activation is completed.
      Activation completed
      Disconnected from weblogic server: AdminServer
      How to solve this problem? Any idea?