jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rokham <somebodyik...@gmail.com>
Subject Jackrabbit OCM insert error
Date Wed, 09 Apr 2008 16:24:11 GMT

Hi all,

My problem with OCM is basically this: (Note: I have followed the
instructions on http://jackrabbit.apache.org/5-with-jackrabbit-ocm.html)

1. I have created a very simple persistent class as follows:
public class CurnitOtmlImpl{
	// Unique number defining each curnit
	@Field(path=true) String number;
	// Name given to the curnit by the author
	@Field String name;
        // getter and setter methods

2. Then I try the following and I fail at ocm.insert(curnit)
   CurnitOtmlImpl cur = new CurnitOtmlImpl();
   repository = new TransientRepository();
   session = repository.login(new SimpleCredentials("username",
    List<Class> classes = new ArrayList<Class>();	
    classes.add(CurnitOtmlImpl.class); // Call this method for each
persistent class
    Mapper mapper = new AnnotationMapperImpl(classes);
    ocm =  new ObjectContentManagerImpl(session, mapper);


This is the error I get:

1957 [main] INFO org.apache.jackrabbit.core.TransientRepository - Transient
repository shut down
Exception in thread "main"
org.apache.jackrabbit.ocm.exception.RepositoryException: Impossible to
insert the object at /123curnit; nested exception is
javax.jcr.RepositoryException: this session has been closed
javax.jcr.RepositoryException: this session has been closed
	at org.apache.jackrabbit.core.SessionImpl.sanityCheck(SessionImpl.java:358)
	at org.apache.jackrabbit.core.SessionImpl.itemExists(SessionImpl.java:870)
	at net.sf.sail.cms.curnit.Test.main(Test.java:14)
View this message in context: http://www.nabble.com/Jackrabbit-OCM-insert-error-tp16590532p16590532.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

View raw message