I'm attempting to create a Document object and include its content, but I'm encountering the following error. Below is the code snippet for reference.
byte[] decodedBytes = Base64.getDecoder().decode(base64Document);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(decodedBytes);
this.noteSheet = (IDfSysObject) session.newObject(Config.TypeNoteSheet);
noteSheet.link(eofficeCase.getObjectId().getId());
noteSheet.setObjectName(Config.NotesheetObjectName);
noteSheet.setContentType(Config.NotesheetContentType);
noteSheet.save();
noteSheet.setContent(byteArrayOutputStream);
noteSheet.save(); //Getting error at here
12:18:26,362 INFO [main] com.documentum.acs.dfc - [DFC_ACS_LOG_CACHE_LOAD_DOCBASE_CONFIG] ACS config objects are read from docbaseId="1" docbaseName="dctm"
12:18:26,404 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 @55183b20
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-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.getCallStackStartingAtTopOfStack(DfTypedObject.java:1075) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.isCalledByTrustedCaller(DfTypedObject.java:1042) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.verifyInternalAttributeAccessRights(DfTypedObject.java:1016) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.setStringRaw(DfTypedObject.java:1462) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.doSetString(DfTypedObject.java:1445) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfTypedObject.setString(DfTypedObject.java:1418) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.Content.setContentHash(Content.java:1131) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.Store.updateContentForStoreResult(Store.java:141) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.FileStore___PROXY.updateContentForStoreResult(FileStore___PROXY.java) ~[?:?]
at com.documentum.fc.client.content.impl.Content.recordStoreResult(Content.java:421) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.Content.prePushIfNeeded(Content.java:502) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.Content___PROXY.prePushIfNeeded(Content___PROXY.java) ~[?:?]
at com.documentum.fc.client.content.impl.ContentManager.prePushIfNeeded(ContentManager.java:1363) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.ContentManager.prepareAContentForSave(ContentManager.java:984) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.content.impl.ContentManager.prepareForSave(ContentManager.java:941) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfSysObject.doSaveImpl(DfSysObject.java:366) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfSysObject.doSave(DfSysObject.java:222) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfPersistentObject.saveEx(DfPersistentObject.java:924) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfPersistentObject.save(DfPersistentObject.java:919) ~[dfc-23.2.0000.0142.jar:?]
at com.documentum.fc.client.DfDocument___PROXY.save(DfDocument___PROXY.java) ~[?:?]
at com.eofficeHelper.NoteSheet.createNoteSheet(NoteSheet.java:61) ~[bin/:?]
at com.test.NoteSheetTest.main(NoteSheetTest.java:19) ~[bin/:?]
Exception in thread "main" java.lang.RuntimeException: Failed to get calling context
at com.documentum.fc.client.security.impl.util.ClassContextFetcher.getRawClassContext(ClassContextFetcher.java:39)
at com.documentum.fc.client.security.impl.util.ClassContextFetcher.getClassContext(ClassContextFetcher.java:19)
at com.documentum.fc.client.DfTypedObject.getCallStackStartingAtTopOfStack(DfTypedObject.java:1075)
at com.documentum.fc.client.DfTypedObject.isCalledByTrustedCaller(DfTypedObject.java:1042)
at com.documentum.fc.client.DfTypedObject.verifyInternalAttributeAccessRights(DfTypedObject.java:1016)
at com.documentum.fc.client.DfTypedObject.setStringRaw(DfTypedObject.java:1462)
at com.documentum.fc.client.DfTypedObject.doSetString(DfTypedObject.java:1445)
at com.documentum.fc.client.DfTypedObject.setString(DfTypedObject.java:1418)
at com.documentum.fc.client.content.impl.Content.setContentHash(Content.java:1131)
at com.documentum.fc.client.content.impl.Store.updateContentForStoreResult(Store.java:141)
at com.documentum.fc.client.content.impl.FileStore___PROXY.updateContentForStoreResult(FileStore___PROXY.java)
at com.documentum.fc.client.content.impl.Content.recordStoreResult(Content.java:421)
at com.documentum.fc.client.content.impl.Content.prePushIfNeeded(Content.java:502)
at com.documentum.fc.client.content.impl.Content___PROXY.prePushIfNeeded(Content___PROXY.java)
at com.documentum.fc.client.content.impl.ContentManager.prePushIfNeeded(ContentManager.java:1363)
at com.documentum.fc.client.content.impl.ContentManager.prepareAContentForSave(ContentManager.java:984)
at com.documentum.fc.client.content.impl.ContentManager.prepareForSave(ContentManager.java:941)
at com.documentum.fc.client.DfSysObject.doSaveImpl(DfSysObject.java:366)
at com.documentum.fc.client.DfSysObject.doSave(DfSysObject.java:222)
at com.documentum.fc.client.DfPersistentObject.saveEx(DfPersistentObject.java:924)
at com.documentum.fc.client.DfPersistentObject.save(DfPersistentObject.java:919)
at com.documentum.fc.client.DfDocument___PROXY.save(DfDocument___PROXY.java)
at com.eofficeHelper.NoteSheet.createNoteSheet(NoteSheet.java:61)
at com.test.NoteSheetTest.main(NoteSheetTest.java:19)
Caused by: java.lang.RuntimeException: Static initialization for determining class call context failed. See DFC log for more details
at com.documentum.fc.client.security.impl.util.ClassContextFetcher.getRawClassContext(ClassContextFetcher.java:32)
... 23 more