java.nio.channels.OverlappingFileLockException
----------------------------------------------

                 Key: JCR-919
                 URL: https://issues.apache.org/jira/browse/JCR-919
             Project: Jackrabbit
          Issue Type: Bug
          Components: core
    Affects Versions: 1.3
         Environment: WINDOWS XP/JDK1.6/Tomacat Apache
            Reporter: CHANDAN KUMAR


I am running Tomcat apache 6.0 in windows XP. I am trying to access Transient 
repository. 

In very first run, I am able to open and close session for Transient 
repository. but in the next run, it always throws exception 
"java.nio.channels.OverlappingFileLockException".

To resolve that issue(workaround)  I have to restart the apache server. In case 
of very first run, I am able to read/write from/to repository. 

code snippet used: ( wrapper calls to class to session open and close)


import java.io.OutputStream;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.apache.jackrabbit.core.TransientRepository;
public class jackrabbitPlugin 
{
        public static Session session;
        public static int SUCCESS =0;
        public static int FAILURE =-1;
        private int isOpened = 0;
        public String errMsg;
        private Repository repository = null;
        
        public String logout() 
        {
                String retValue = "SUCCESS";
                try
                {
                        session.logout();
                }
                catch(Exception exp)
                {
                        retValue = "Exception:" + exp;
                }
                return retValue;
        }
        public String login (String user,String password, String 
RepositoryPath,String workspaceName) 
        {
                String retValue = "SUCCESS";
                if(workspaceName.compareTo("")==0)
                {
                        workspaceName="default";
                }
                try 
                {
                        if(IsSessionOpen()==false)
                        {
                                
System.setProperty("org.apache.jackrabbit.repository.home",RepositoryPath);
                                repository = new TransientRepository();
                                session = repository.login(new 
SimpleCredentials(user,password.toCharArray()),workspaceName);
                                if(session!=null)
                                {
                                        retValue = "SUCCESS";
                                        isOpened = 1;
                                }
                        }
                }
                catch (Exception exp) 
                {
                        String errMsg = "Exception:" + exp;
                        retValue = errMsg;
                        System.out.println(errMsg);
                        ((TransientRepository)repository).shutdown();
                        logout();
                        this.errMsg =  errMsg;
                } 
                return retValue;
        }
                
}




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to