Error while creating folder

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2013 07:47 AM
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…
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…
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2013 10:40 PM
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.
Try to write a test for your class in order to isolate if your code it's working.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2013 01:00 AM
ya its working … without jsp page call… but it is not working in jsp Can you tell me why?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2013 01:00 AM
maybe caused by jar conflict ,check jar files in your classpath
