cancel
Showing results for 
Search instead for 
Did you mean: 

CMLCreate fails

cburghardt
Champ in-the-making
Champ in-the-making
I have Alfresco 1.3 and my own model. The following code throws an exception:
CMLCreate create = new CMLCreate(name, parentReference, "http://www.inovox.de/model/1.0/email", props);
            CML cml = new CML();
            cml.setCreate(new CMLCreate[]{create});
            // create the node without content
            UpdateResult[] result = repositoryService.update(cml);

The NamedValue[] include the properties of my own model.
The error message:

22:55:41,280 ERROR [org.apache.axis.encoding.ser.BeanSerializer] Exception:
java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:678)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
8 REPLIES 8

fchevance
Champ in-the-making
Champ in-the-making
Hello,

it works fine for me.
Maybe the problem is in the parentReference, i guess it is the folder where you link your object.


ParentReference parentReference = new ParentReference(
      STORE,
      null,
      linkPath,
      Constants.ASSOC_CONTAINS,
      objectName);

Fred

cburghardt
Champ in-the-making
Champ in-the-making
What is your linkPath?
I create my parentReference like this:

        parentReference = new ParentReference();
        parentReference.setAssociationType(ASSOC_CONTAINS);
        parentReference.setStore(store);
        parentReference.setUuid(rootFolder.getUuid());
The store is a reference to the SpacesStore:

store = new Store(StoreEnum.workspace, "SpacesStore");
The rootFolder is a Reference from the following path which is simply a Space in the Company Home:
/app:company_home/*[@cm:name="MySpace"]

This has worked until 1.2 though.

fchevance
Champ in-the-making
Champ in-the-making
The linkpath is the Qname path, ISO9075 encoded.
Ex: /app:company_home/cm:myFolder

Try without setting the uuid, just set the path (and store, assoc,..).
I think I faced the same error some time ago.

cburghardt
Champ in-the-making
Champ in-the-making
So I constructed my parentReference with the path "/app:company_home/cm:MySpace"
MySpace is a space in the company home. But I still get the error 😞

fchevance
Champ in-the-making
Champ in-the-making
Did you constructed your parentReference without setting the uuid, just the store, path, association type and name ?

cburghardt
Champ in-the-making
Champ in-the-making
Exactly. I replaced setUid() with setPath().

fchevance
Champ in-the-making
Champ in-the-making
If you want you can send me your code so that I can test it.

cburghardt
Champ in-the-making
Champ in-the-making
I found the problem. It wasn't the parentReference but the properties. I did not construct them with the Alfresco Helper class but set the name and value with the setters. That worked with 1.2 but not with 1.3.