0 Replies Latest reply: Jan 14, 2014 10:12 PM by SGOLI_20 RSS

    Create Roles and Permissions using API

    SGOLI_20 Community Member

      Hello,

       

      I'm new to Java and I'm trying to create Roles and Permissions in LiveCycle using API's. Can someone please check and correct my code below?

       

                  //Create a ServiceClientFactory object

                  ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

       

                  // Create an AuthorizationManagerServiceClient object

                  AuthorizationManagerServiceClient amClient = new AuthorizationManagerServiceClient(myFactory);

                 

                  RoleImpl ri = new RoleImpl();

                  ri.setName("Test ES Role");

                  ri.setDescription("Test Role via API");

                  ri.setMutableStatus(true);

                 

                  amClient.createRole(ri);

       

       

      Executing the above code throws exception as below;

       

      com.adobe.idp.um.api.UMException| [com.adobe.livecycle.usermanager.client.AuthorizationManagerServiceClient] errorCode:16385 errorCodeHEX:0x4001 message:Exception thrown is NOT a DSCException : UnExpected From DSC chainedException:java.lang.IllegalStateExceptionchainedExceptionMessage:null chainedException trace:java.lang.IllegalStateException

                at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable(ServiceClientFactory.j ava:72)

                at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:220)

                at com.adobe.livecycle.usermanager.client.AuthorizationManagerServiceClient.createRole(Autho rizationManagerServiceClient.java:159)

                at com.adobe.lc.ManageRolesAndPermissions.main(ManageRolesAndPermissions.java:70)

      Caused by: java.lang.NoClassDefFoundError: javax.ejb.EJBException

                at com.adobe.idp.dsc.clientsdk.ServiceClientFactory.evaluateMessageDispatcher(ServiceClientF actory.java:595)

                at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:215)

                ... 2 more

      Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBException

       

       

      Thank you,

      Sandeep