Expand my Community achievements bar.

Create Roles and Permissions using API

Avatar

Level 2

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.java:72)

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

          at com.adobe.livecycle.usermanager.client.AuthorizationManagerServiceClient.createRole(AuthorizationManagerServiceClient.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(ServiceClientFactory.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

0 Replies