0
"java.lang.IllegalStateException: Failed to resolve to a single NodeRef with parameters (store=workspace:SpacesStore uuid=null path=/app:company_home/cm:DCSL_DOCS/cm:Scanned_Docs), found 0 nodes."
위의 오류가 내 오류를 나타냅니다. 여기공백을 만들 때 Alfresco java.lang.IllegalStateException 오류가 발생했습니다.
protected Reference createSpace(Reference parentref, String spacename) throws Exception {
Reference space = null;
ParentReference parent = ReferenceToParent(parentref);
try {
System.out.println("Entering space:" + spacename+":");
space = new Reference(STORE, null, parent.getPath() + "/cm:" + ISO9075.encode(spacename));
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{space}, STORE, null));
} catch (Exception e1) {
System.out.println("The space named " + spacename + " does not exist. Creating it.");
parent.setChildName(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, normilizeNodeName(spacename)));
//Set the space's property name
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, spacename)};
// Create the space using CML (Content Manipulation Language)
CMLCreate create = new CMLCreate("1", parent, null, null, null, Constants.TYPE_FOLDER, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
//Execute the CML create statement
try {
getRepositoryService().update(cml);
} catch (Exception e2) {
e2.printStackTrace();
System.err.println("Can not create the space.");
throw e2;
}
}
return space;
}
이 문제를 밖으로 정렬 도와주세요 야외 공간을 만들려고 내 소스 코드입니다. 감사
예외가 발생하는 라인은 무엇입니까? – Gagravarr
경로를 사용하여 NodeRef 일명 참조를 만들 수 없습니다. 이 행은 작동하지 않습니다. space = new 참조 (STORE, null, parent.getPath() + "/ cm :"+ ISO9075.encode (spacename)); 공간이 존재하는지 확인하려면 RepositoryService.queryChildren (...) 또는 RepositoryService.query (...)를 사용하십시오. – alfrescian
가능하면 REST 또는 CMIS 사용을 고려하십시오 - Alfresco CML은 약간 구식입니다 – alfrescian