01-28-2009 01:28 PM
"Duplicate child name not allowed:"error (which is good!).
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{reference}, STORE, null) );generated this error:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>java.lang.IllegalStateException: Failed to resolve to a single NodeRef with parameters (store=workspace:SpacesStore uuid=null path=/app:company_home/cm:AdPortal2/cm:test_Duplicate), found 2 nodes.</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.repository.RepositoryWebService.get(RepositoryWebService.java:482)01-30-2009 08:33 AM
01-30-2009 08:48 AM
01-30-2009 02:21 PM
/**
* @author Roy Wetherall
*/
public class SamplesBase
{
/** Admin user name and password used to connect to the repository */
protected static final String USERNAME = "admin";
protected static final String PASSWORD = "admin";
/** The store used throughout the samples */
protected static final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
protected static final Reference SAMPLE_FOLDER = new Reference(STORE, null, "/app:company_home/cm:sample_folder");
protected static void createSampleData() throws Exception
{
try
{
// Check to see if the sample folder has already been created or not
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{SAMPLE_FOLDER}, STORE, null));
}
catch (Exception exception)
{
// Create parent reference to company home
ParentReference parentReference = new ParentReference(
STORE,
null,
"/app:company_home",
Constants.ASSOC_CONTAINS,
Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "sample_folder"));
// Create folder
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, "Web Service Sample Folder")};
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_FOLDER, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml); Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.