cancel
Showing results for 
Search instead for 
Did you mean: 

Error while creating folder

priyankasoni
Champ in-the-making
Champ in-the-making
Hi i am creating a folder by Cmsi

import java.util.HashMap;
import java.util.Map;

import org.apache.chemistry.opencmis.client.api.Folder;
import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.api.SessionFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.enums.BindingType;

public class Newfolder {
   public void set_newFolder()
   {
      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, "Mykarma_version2");
      properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder,P:cm:titled");
      properties.put("cm:description", "MykarmaFolder");

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

}

now i am calling this class to my jsp page
it give me error like


org.apache.jasper.JasperException: Unable to compile class for JSP:
please give me idea i want  to call this from my jsp application…
3 REPLIES 3

jspuchau
Champ in-the-making
Champ in-the-making
Maybe the problem is in the JSP page.
Try to write a test for your class in order to isolate if your code it's working.

ya its working … without jsp page call… but it is not working in jsp Can you tell me why?

kaynezhang
World-Class Innovator
World-Class Innovator
maybe caused by jar conflict ,check jar files in your classpath
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.