Posts tagged "classcastexception"

LiveCycle ES: ClassCastException calling deletePermsForPrincipalForRes(String, String, List)

Issue

If you are trying to remove permissions for a service in LiveCycle ES using the API method
  AuthorizationManager.deletePermsForPrincipalForRes(String principalOid, String resourceId, List permList)
you may encounter the following exception running your Java code:

| [com.adobe.idp.um.api.impl.AuthorizationManagerImpl] errorCode:16385 errorCodeHEX:0x4001 message:public method - 
| [IDPLoggedException] errorCode:8193 errorCodeHEX:0x2001 message:public method - chainedException:java.lang.ClassCastException: 
com.adobe.idp.um.api.infomodel.impl.PermissionImplchainedExceptionMessage:com.adobe.idp.um.api.infomodel.impl.PermissionImpl 
chainedException trace:java.lang.ClassCastException: com.adobe.idp.um.api.infomodel.impl.PermissionImpl
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean.modifyPermsToPrincipalForRes(DirectoryServicesManagerBean.java:7602)
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean.deletePermsForPrincipalForRes(DirectoryServicesManagerBean.java:7752)
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean_jrc290_ELOImpl.deletePermsForPrincipalForRes(DirectoryServicesManagerBean_jrc290_ELOImpl.java:2066)
    at com.adobe.idp.um.api.impl.AuthorizationManagerImpl.deletePermsForPrincipalForRes(AuthorizationManagerImpl.java:860)
    at com.adobe.idp.um.dscservice.AuthorizationManagerServiceImpl.deletePermsForPrincipalForRes(AuthorizationManagerServiceImpl.java:407)
    ....

Solution

This exception occurs if you try to pass a List of <Permission> objects to the method for the last argument. This List should display a List of <String> objects containing the permission OIDs for each permission object you want to remove.

Here is some sample code (ManageRolesAndPermissionsTest) to fix this issue.

Additional information

The current JavaDoc reference for LiveCycle ES is available at:

http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/javadoc/com/adobe/idp/um/api/AuthorizationManager.html#deletePermsForPrincipalForRes%28%29

reference: (181407999/2541386)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

LiveCycle ReaderExtensions7: ClassCastException trying to deploy the sample application

Issue

 When trying to deploy the sample ReaderExtensions application to the application server you may receive the following exception:

java.lang.ClassCastException
 at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)

Reason

 This is caused by the DocumentServicesLibrary.jar which appears in too many places in the ear files. It should not have been included in LiveCycle-security.ear file.

Solution

Workaround 1:

If you already have LiveCycle 7.2 installed, then all you need to do is edit customAssembly.xml in the components\pdfagent and delete the line with DocumentServicesLibrary.jar in it. Run LCM and redeploy.

Workaround 2:

Include AdobeCSAUtils.jar in your project and use:

connectionfactory = Utilities.serviceLookup("DataManagerService"); 
DataManager dataManager = DataManagerHelper.narrow((org.omg.CORBA.Object)connectionfactory.getConnection()); 
connectionfactory = Utilities.serviceLookup("PDFManipulation"); 
PDFFactory pdfFactory = PDFFactoryHelper.narrow((org.omg.CORBA.Object)connectionfactory.getConnection());

________________________________________
reference: (1-32712143)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)