but getting the repository not found exception: Repository Id is not set! java.lang.IllegalStateException: Repository Id is not set! While debugging noticed that getRepositoryInfos() call overwrites the repository_id with null.
Can you advise how the session should be established, please? Do i need to enable cmis 1.1 or browser binding on the Alfresco Content Repository? Set some properties?
The only difference between your code and my code was OBJECT_FACTORY_CLASS property set to org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl which was causing an issue. i also had to upgrade chemistry-opencmis-client library to 0.11.0 from 0.6.0 and now the session seems to get established. Only the secondary types "custom:" are not recognized, so not sure if they need another version upgrade.
Right, if you are using CMIS 1.1 you do not use the CMIS extension/Alfresco Object Factory. There is no reason to do so because the point of that library was to add support for aspects, and aspects are supported in CMIS 1.1 natively with secondary object types.
Tip: You can always check $ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/lib for the Chemistry JARs if you want to match the version that Alfresco ships with.
The reason your "custom:*" types are not being recognized is because you have not deployed those content models (we discussed this on the Apache Chemistry list). Look at the content types tutorial to understand how that works.
Tip: You can always use the Apache Chemistry CMIS Workbench to browse the types and secondary types that the repository knows about. If you don't see your type or secondary type listed, you won't be able to create or query that type.