402 words

java.nio.channels.OverlappingFileLockException

#1
2011-08-22 14:29

Hello,

whenever I re-deploy my web application in Sun Java System Web Server, I get the following exception and the application cannot run anymore. Any clue what I am doing wrong? 

I use the file-based db access (local to the web app, as described in your tutorial).

Thanks for pointers!

Best, Benjamin

java.nio.channels.OverlappingFileLockException
     at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1176)
     at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1078)
     at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:878)
     at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
     at com.objectdb.o.LFL.N(LFL.java:892)
     at com.objectdb.o.LFL.H(LFL.java:843)
     at com.objectdb.o.LFL.H(LFL.java:753)
     at com.objectdb.o.SFL.<init>(SFL.java:212)
     at com.objectdb.o.MST.<init>(MST.java:111)
     at com.objectdb.o.MST.aG(MST.java:96)
     at com.objectdb.o.MSF.UH(MSF.java:167)
     at com.objectdb.o.OMF.ai(OMF.java:725)
     at com.objectdb.jpa.EMF.ai(EMF.java:143)
     at com.objectdb.o.OMF.ah(OMF.java:681)
     at com.objectdb.jpa.EMF.createEntityManager(EMF.java:160)
     at net.pocketservices.athene.ObjectDB.createEntityManager(ObjectDB.java:32)
     at net.pocketservices.athene.pages.base.BasePage.<init>(BasePage.java:71)
     at net.pocketservices.athene.pages.base.UserPage.<init>(UserPage.java:22)
     at net.pocketservices.athene.pages.user.LoginPage.<init>(LoginPage.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
     at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
     at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
     at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
     at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
     at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
     at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
     at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
     at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
lorenz2304
lorenz2304's picture
Joined on 2011-04-17
User Post #3
#2
2011-08-22 18:45

The exception indicates a file locking conflict.

In embedded mode the database cannot be opened by more than one user (process / class loader) simultaneously.

Please verify that the database is not open by another process - e.g. the ObjectDB Explorer.

If the database is not in use by another user you may want to try the solution in this forum thread.

If the problem is not solved you may consider switching to client server mode.

 

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #553
#3
2014-12-21 21:30

The fix to this is to make sure you only have this line once in the application:

    EntityManagerFactory entityManagerFactory = 
        Persistence.createEntityManagerFactory("$objectdb/database/myapp.odb");
ThreaT
ThreaT's picture
Joined on 2014-02-19
User Post #44
#4
2014-12-22 16:33

It makes sense. Thank you for this tip.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,101

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel