cancel
Showing results for 
Search instead for 
Did you mean: 

exception in jpotts CMIS API

ashok
Champ on-the-rise
Champ on-the-rise
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject
   at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:297)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:415)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:490)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:484)
   at com.alfresco.cloud.example.BaseJavaExample.run(BaseJavaExample.java:133)
   at com.alfresco.cloud.example.GetSitesExample.main(GetSitesExample.java:30)
Caused by: java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.api.TransientCmisObject
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   … 6 more


Iam getting above exception when iam trying to create folder in alfrsco cloud. Please let me know if anybody can solve it
27 REPLIES 27

ashok
Champ on-the-rise
Champ on-the-rise
I got it

kaynezhang
World-Class Innovator
World-Class Innovator
Download the file from repository and send stream to user browser.

ashokalfresco
Champ in-the-making
Champ in-the-making
Hi Jeff, Here I got one problem, that is i can access all files uploaded by me to AlfrescoCloud, But if anyone share his files to me, those files I could not access from java code. Getting exception:
CmisObjectNotFoundException.

Could you please help here?.

Iam ashok only, i lost my previous gmail.

Thank You,
Ashok

jpotts
World-Class Innovator
World-Class Innovator
Can you paste the code that is giving you a problem?

Jeff

jpotts
World-Class Innovator
World-Class Innovator
Can you paste the code that is giving you a problem?

Jeff

archimadhu86
Champ in-the-making
Champ in-the-making
Hi Jeff,

I am getting same error mentioned above.

I am using jav v1.6,Alfresco v4.1, alfresco-opencmis-extension-0.7.jar and chemistry-opencmis v0.13 jar files

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject
   at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:348)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:523)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:493)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:485)
   at com.alfresco.api.example.CmisBasicQuery.doQuery(CmisBasicQuery.java:37)
   at com.alfresco.api.example.CmisBasicQuery.doExample(CmisBasicQuery.java:23)
   at com.alfresco.api.example.CmisBasicQuery.main(CmisBasicQuery.java:19)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.api.TransientCmisObject




Here is my code snippet

   

CmisObject object = cmisSession.getObject(cmisSession.createObjectId(folderId));
        Folder folder = (Folder)object;
        OperationContext operationContext = cmisSession.createOperationContext();
        operationContext.setMaxItemsPerPage(maxItemsPerPage);

        ItemIterable<CmisObject> children = folder.getChildren(operationContext);
         for(CmisObject child :children){
             System.out.println(child.getName());
         }

I Fixed it by adding chemistry-opencmis-client-impl-0.13.0.jar to project

joshjones
Champ in-the-making
Champ in-the-making
Hi, I'm getting the same error.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject
   at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:348)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:560)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:534)
   at org.apache.chemistry.opencmis.doc.Upload.main(Upload.java:97)
Caused by: java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.api.TransientCmisObject
   at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
   … 4 more

      

 AlfrescoFolder docLib = (AlfrescoFolder) session.getObjectByPath("/sites/leder-review-system/documentLibrary");         



I have what I believe all of the correct .jars in the project… Any ideas to a solution?

jpotts
World-Class Innovator
World-Class Innovator
Please provide:
- The version of Alfresco
- The service URL
- The version of OpenCMIS you are using

Jeff

mrogers
Star Contributor
Star Contributor
The TransientCmisObject was removed from Chemistry some time ago.  Any classes using it will need to be updated.

In particular if you are using the  alfresco-opencmis-extension then you need a more recent version of the alfresco extension for the current versions of Chemistry or use the old alfresco-opencmis-extension with a an older version of Chemistry.   Can't remember what versions are compatible but I fixed the alfresco-opencmis-extension (removed the need for TransientCmiSObject) a couple of years ago,  IIRC before the release of 5.0.

Also IIRC the extension was hosted on google code which no longer allows versions to be created.   I think the extension is available from alfresco's maven.