Hello,
I am facing a DM_API_E_BADID error in the documentum method server logs.
We are trying to create a new virtual parent object based on the virtual document which is already present in documentum, the below code here is trying get the child ids (of the original virtual parent object present in documentum.) and creating new objects for the child and later on linking it to the virtual parent object which is initially created in the code.
Following are the few lines of code followed by the logs:
// Query to find and fetch the child documents of the source parent virtual document
String dql = "select r_object_id from dm_sysobject in DOCUMENT ID('"+id+"')";
System.out.println("dql:::::"+dql);
IDfQuery q = new DfQuery();
q.setDQL(dql);
int colnum=0;
IDfCollection col = q.execute(sess, DfQuery.DF_READ_QUERY);
while(col.next()) {
System.out.println("inside while loop ");
//System.out.println("value of colnum"+colnum);
//System.out.print(col.getId("r_object_id").toString() + "\t");
String childIdString= col.getId("r_object_id").toString();
//code to check if the child doc is the same as parent itself,as based on the above query which also returns the parent id.
if(childIdString.equals(id))
{ System.out.println("parent virtual document object already saved"); }
else{
//Saving the child documents
IDfId childId = sess.getIdByQualification("dm_sysobject where r_object_id='" + childIdString + "'"); childObj = (IDfSysObject) sess.getObject(childId);
childObjmain = (IDfSysObject) sess.newObject(getRecordType());
childObjmain.link(Folder_ChildrenPath);
String contentFilechild = childObj.getFile(null);
String formatNamechild = childObj.getFormat().getName();
System.out.println("formatNamechild");
setWFProperties(childObjmain,srcObj);
childObjmain.setFileEx(contentFilechild,formatNamechild,0,null);
IDfValidator validchild = childObjmain.getValidator();
validchild.validateAll(null,false);
childObjmain.save(); //System.out.println("childObjmain is saved");
String childobjname = childObj.getObjectName();
System.out.println("childobjname name is "+childobjname);
childObjmain.setObjectName(childobjname);
childObjmain.save();
//adding node to the virtual document.
nodeChild1 = vDoc1.addNode(nodeRoot1, null, childObjmain.getChronicleId(), "CURRENT", false, false); System.out.println("node is added");
// System.out.println("getLinkHighCount isss"+pobj.getLinkHighCount()); System.out.println("getLinkCount isssss"+pobj.getLinkCount()); System.out.println("getLock owner is isssss"+pobj.getLockOwner()); // } colnum++;
System.out.println("value of colnum *****"+colnum);
}
Following are the logs:
15:43:45,776 INFO [stdout] (http--0.0.0.0-9080-7) inside while loop 15:43:45,776 INFO [stdout] (http--0.0.0.0-9080-7) parent virtual document object already saved 15:43:45,776 INFO [stdout] (http--0.0.0.0-9080-7) value of colnum *****1 15:43:45,776 INFO [stdout] (http--0.0.0.0-9080-7) inside while loop 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) DfException:: THREAD: http--0.0.0.0-9080-7; MSG: [DM_API_E_BADID]error: "Bad ID given: 0000000000000000"; ERRORCODE: 100; NEXT: null 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.fc.common.DfException.newBadIdException(DfException.java:28) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.fc.client.impl.session.Session.getObjectManager(Session.java:902) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.fc.client.impl.session.Session.getObject(Session.java:963) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.fc.client.impl.session.SessionHandle.getObject(SessionHandle.java:653) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.mfs.workflow.SingleRepositoryRecordDeclaration.declareRecord(SingleRepositoryRecordDeclaration.java:233) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.mfs.methods.WFRecordDeclarationMethod.declareRecord(WFRecordDeclarationMethod.java:172) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.mfs.methods.WFRecordDeclarationMethod.execute(WFRecordDeclarationMethod.java:106) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.mthdservlet.DfMethodRunner.runIt(Unknown Source) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.mthdservlet.AMethodRunner.runAndReturnStatus(Unknown Source) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.mthdservlet.DoMethod.invokeMethod(Unknown Source) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at com.documentum.mthdservlet.DoMethod.doPost(Unknown Source) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) at java.lang.Thread.run(Thread.java:745) 15:43:46,228 ERROR [stderr] (http--0.0.0.0-9080-7) DfException:: THREAD: http--0.0.0.0-9080-7; MSG: [DM_API_E_BADID]error: "Bad ID given: 0000000000000000"; ERRORCODE: 100; NEXT: null