Property 'my:property' is not valid for this type or one of the secondary types
my:property seems to be a custom property, and should then be handled with a custom Alfresco aspect.
If you want to use Alfresco aspects, you will need the Alfresco OpenCMIS Extension
The following code fragment allows to use the Alfresco Extension with OpenCMIS:
Map<String, String> parameter = new HashMap<String, String>();
// user credentials
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
// create session
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();
The following code allows to create a new document with a custom property filled :
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, "doc1");
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,my:docProps");
properties.put("my:property", "My document");
Document doc = session.getRootFolder().createDocument(properties, null, null);