cancel
Showing results for 
Search instead for 
Did you mean: 

error in cmis

priyankasoni
Champ in-the-making
Champ in-the-making
hi  i write a application in java and calling that java class from a jsp page like

vaultsafe folder=new vaultsafe();
folder.create_folder("jeely","jellyfish",null);

public void create_folder(String Name, String description,String title)
   {
      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();
      Map<String, Object> properties = new HashMap<String, Object>();
      properties.put(PropertyIds.NAME, Name);
      properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder,P:cm:titled");
      properties.put("cm:description", description);

      //Document doc = session.getRootFolder().createDocument(properties,null,null);
   Folder folder=session.getRootFolder().createFolder(properties,null,null, null, null);
   }


it give me error

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/SessionFactory
Can u tell me where i am wrong plz help me i have aatched all jar file
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
If you are using Alfresco 4.0 then you are likely using OpenCMIS 0.6. That class is in chemistry-opencmis-client-api-0.6.0-SNAPSHOT.jar. Is that JAR in your web application's classpath? For example, you can find it in alfresco/WEB-INF/lib but maybe your JSP is not in the alfresco web app and is instead in some other web app that does not have the JAR?

Jeff