Hi,
We are upgrading our Documentum installation and need to create new services which import documents into Documentum and add the lifecycle (policy) to the documents during import.
Normally I would use the attach method to attach the policy but because we relocate documents during the policy attachment in the lifecycle actions I need to apply the lifecycle manually as the documents needs to be located in a separate folder structure until a user pick up the imported document and correct whatever in the metadata.
The below code is just sample code but it will throw an except also below:
public static voidUpdatePolicyID(String strRObjectId, String strRPolicyID) {
try {
IDfSysObject dctmSysObject = (IDfSysObject) dctmIDfSession.getObjectByQualification("dm_document (all) where r_object_id = '"+ strRObjectId + "'");
dctmSysObject.setString("r_policy_id", strRPolicyID);
dctmSysObject.save();
}
catch (DfException ex) {
System.out.println("Failed to update Policy ID!\n" + ex.getStackTraceAsString());
}
catch (Exception ex) {
System.out.println("Failed to update Policy ID!\n" + ex.getMessage());
}
}
14:01:42,863 ERROR [main] com.documentum.fc.client.security.impl.util.ClassContextFetcher - Static initialization for determining class call context failed
java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Class[] java.lang.SecurityManager.getClassContext() accessible: module java.base does not "opens java.lang" to unnamed module @6ad82709
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[?:?]
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[?:?]
at java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[?:?]
at java.lang.reflect.Method.setAccessible(Method.java:193) ~[?:?]
at com.documentum.fc.client.security.impl.util.ClassContextFetcher.(ClassContextFetcher.java:63) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.getCallStackStartingAtTopOfStack(DfTypedObject.java:1075) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.isCalledByTrustedCaller(DfTypedObject.java:1042) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.verifyInternalAttributeAccessRights(DfTypedObject.java:1016) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.setStringRaw(DfTypedObject.java:1462) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.doSetString(DfTypedObject.java:1445) [dfc.jar:?]
at com.documentum.fc.client.DfTypedObject.setString(DfTypedObject.java:1418) [dfc.jar:?]
at com.tieto.flsdoc.tbo.FlsEnterpriseImpl___PROXY.setString(FlsEnterpriseImpl___PROXY.java) [dfc.jar:?]
at Main.UpdatePolicyID(Main.java:190) [bin/:?]
at Main.main(Main.java:137) [bin/:?]
I'm no Java expert as I just started learning the language about a year ago.
There is no problem updating other "normal" attributes like "object_name".
So to me it seems like some kind of security issue as I don't have this problem in Documentum 7.3 and prior.
I have tried to add this: -Djava.locale.providers=COMPAT,SPI --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
to the command line but same result.
Inside dfc.jar there is a file called dfc.example.java.policy but it's written in Klingon (for a Java beginner) (file is attached). But I think it's something like that I need to implement.
Product information:
Documentum 21.04
DFC 21.04
JDK 17 (have also tried with JDK 11, same issue)
Please, any help will be appreciated.
Best regards,
Hans Henrik