Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 66196 invoked from network); 18 May 2007 15:05:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2007 15:05:39 -0000 Received: (qmail 83852 invoked by uid 500); 18 May 2007 15:05:43 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 83823 invoked by uid 500); 18 May 2007 15:05:43 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 83814 invoked by uid 99); 18 May 2007 15:05:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 08:05:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 08:05:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7621C71406F for ; Fri, 18 May 2007 08:05:16 -0700 (PDT) Message-ID: <29847696.1179500716481.JavaMail.jira@brutus> Date: Fri, 18 May 2007 08:05:16 -0700 (PDT) From: "Stefan Guggisberg (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-912) OverlappingFileLockException with JRE 1.6 In-Reply-To: <28195734.1178889195538.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Guggisberg resolved JCR-912. ----------------------------------- Resolution: Fixed Fix Version/s: 1.4 fixed in svn r539491. thanks for reporting this issue! > OverlappingFileLockException with JRE 1.6 > ----------------------------------------- > > Key: JCR-912 > URL: https://issues.apache.org/jira/browse/JCR-912 > Project: Jackrabbit > Issue Type: Bug > Components: core > Affects Versions: 1.3 > Environment: Linux + Java6; however, per http://blogs.sun.com/DaveB/date/200612, this may be a problem on all Java6 platforms > Reporter: Patrick Haggood > Assigned To: Stefan Guggisberg > Fix For: 1.4 > > > Per email discussion: > On Mon, 2007-02-26 at 10:26 +0100, Marcel Reutegger wrote: > > > just my 2c, I didn't really investigated this issue in more detail... > > > > > > according to the javadoc of FileChannel.tryLock() the > > > OverlappingFileLockException is thrown if the JVM already holds a lock on the > > > channel. > > > > > > in contrast, the current check in the repository startup method primarily > > > focuses on the situation where *two* JVMs start a repository on the same home > > > directory. > > > > > > I'd say the OverlappingFileLockException is thrown because two repository > > > instances are startup within the *same* JVM using the same repository home > > > directory. > > > > > > I suggest we add a catch clause, which also covers OverlappingFileLockException > > > in addition to IOException. > > > > > > regards > > > marcel > > > > > > Stefan Guggisberg wrote: > > > > btw, afaik OverlappingFileLockException is only thrown on linux, > > > > FileChannel#getLock on windows e.g. returns null in the same situation. > > > > > > > > you might want to test on a different platform to further isolate the > > > > issue. > > > > you could also place a breakpoint at the top of the > > > > RepositoryImpl#acquireRepositoryLock > > > > method, step through the code, verify the contents of your fs etc. > > > > > > === Original email > On 2/19/07, Patrick Haggood wrote: > I'm using Linux, Sun Java 6 and Jackrabbit 1.3 with Derby persistance. > I have a putNode(object) function that's giving the above error in unit > tests. It always fails after the second update, even when I swap tests > (i.e. save user doc then save user). Prior to each test, I delete the > repository directory. > Do I need to set explicit locks before/after each session.save()? > *********** Unit Test > DBConn dbc; > public SessionUtilTest(String testName) { > super(testName); > dbc = new DBConn(); > } > // Note - putUser and putDocument both use putNode after determining > which rootnode will be used > /** > * Test of putUnityUser method, of class unityjsr170.jr.SessionUtil. > */ > public void testPutUnityUser() { > System.out.println("putUnityUser"); > UnityUser usr = usr1; > SessionUtil instance = dbc.getSutil(); > String result = instance.putUnityUser(usr1); > assertNotNull(result); > usr = (UnityUser) instance.getUnityUserByID(result); > assertEquals(usr1.getName(),usr.getName()); > } > > /** > * Test of putUnityDocument method, of class > unityjsr170.jr.SessionUtil. > */ > public void testPutUnityDocument() { > System.out.println("putUnityDocument"); > UnityDocument udoc = adr1; > SessionUtil instance = dbc.getSutil(); > String result = instance.putUnityDocument(udoc); <---- File > Lock Error > assertNotNull(result); > udoc = (UnityDocument) instance.getUnityDocumentByID(result); > assertEquals(adr1.getName(),udoc.getName()); > } > ********* Here's where I setup my repository connection > public DBConn(){ > sutil = null; > try { > rp = new TransientRepository(); > sutil= new SessionUtil(rp); > } catch (IOException ex) { > ex.printStackTrace(); > } > } > > public void shutdown(){ > sutil.closeAll(); > } > > public SessionUtil getSutil(){ > return sutil; > } > **************** SessionUtil > public SessionUtil(Repository rp){ > try { > session = rp.login(new > SimpleCredentials("username","password".toCharArray())); > > } catch (LoginException ex) { > ex.printStackTrace(); > } catch (RepositoryException ex) { > ex.printStackTrace(); > } > > } > > public void closeAll(){ > try { > session.logout(); > } catch (Exception ex) { > ex.printStackTrace(); > System.out.println("Error closing repository"); > } > } > > // Put a node on the tree under the root node, return the uuid of the > new or updated node > private String putNode(String nodetype, UnityBaseObject ubo){ > String resultuuid =null; > String uname = ubo.getName(); > String utype = ubo.getType(); > String objectuid = ubo.getId(); > Node pnode; // node to add or update > Session ses = null; > try { > ses = getSession(); > // Does updateable node already have node Id? > if (objectuid==null) { > Node rn = ses.getRootNode(); > pnode = rn.addNode(utype); > pnode.addMixin("mix:referenceable"); > } else{ > // grab existing node by uuid > pnode = ses.getNodeByUUID(objectuid); > } > // Did we get an updateable node? > if (pnode!=null){ > ubo.setId(pnode.getUUID()); > String unityXML = > utrans.getXMLStringFromUnityBaseObject(ubo); > // update all the properties > pnode.setProperty("name",ubo.getName()); > pnode.setProperty("type",ubo.getType()); > pnode.setProperty("xmldata",unityXML); > ses.save(); > resultuuid = ubo.getId(); > } > } catch(Exception e) { > e.printStackTrace(); > } > return resultuuid; > } > private Session getSession(){ > return session; > } > > ************ repository.xml > > class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> > > > class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager"> > > > > class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> > > > > > > > > > > > value="org.apache.lucene.analysis.standard.StandardAnalyzer"/> > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.