1 Reply Latest reply: Aug 14, 2012 10:34 AM by anjhawar - oracle RSS

    AttributeError: what is wrong?

    269975
      Hi ,

      I am getting the below error -

      wls:/bifoundation_domain/serverConfig> atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("csLDAP")

      wls:/bifoundation_domain/serverConfig> atnr.createUser('test','','test')

      Traceback (innermost last):

      File "<console>", line 1, in ?

      AttributeError: 'javainstance' object has no attribute 'createUser'

      what is wrong?

      Please suggest.

      Thanks
      Nandoo
        • 1. Re: AttributeError: what is wrong?
          anjhawar - oracle
          You can try the following sample script to create a group and user:


          connect('weblogic','weblogic1','t3://localhost:7001')

          print 'connected to Admin Server'

          serverConfig()

          print 'Lookup DefaultAuthenticator'

          password = 'weblogic1'

          cmoDefaultAuthenticator=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')

          print 'create group TestGroup'
          group = 'TestGroup'
          group_description = 'Test group'
          cmoDefaultAuthenticator.createGroup(group,group_description)

          users = ['testuser1','testuser2']
          for user in users:
          print 'create user: ',user
          cmoDefaultAuthenticator.createUser(user,password,user)
          cmoDefaultAuthenticator.addMemberToGroup(group,user)

          print 'if we want to add the above group to any of the default groups then for example: Operators. This is optional'

          cmoDefaultAuthenticator.addMemberToGroup('Operators',group)

          print 'created a new user and group..exiting..'

          disconnect()