Allocate exception for servlet search

Help
2012-12-17
2013-05-30
  • Amrita Lakshmi
    Amrita Lakshmi
    2012-12-17

    I've installed wikipedia miner's Java API and it is working correctly. Then I deployed the war file on my tomcat 7 and if I try http://localhost:8080/wikipediaminer/services/ , it works and prints out the html. But when I try to access the search service as in http://localhost:8080/wikipediaminer/services/search?query=education,  I get exceptions with root cause displayed as:
    java.io.IOException: Couldn't get lock for /wikipedia-miner-1.2.0/db/je.info

    In my db directory, I can see files called je.info.0 and je.info.0.lck but they are 0 bytes long.
    Any pointers as to what may be going wrong? Here is the log:

    SEVERE: Allocate exception for servlet search
    java.io.IOException: Couldn't get lock for /media/ephemeral0/wikipedia-miner-1.2.0/db/je.info
            at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
            at java.util.logging.FileHandler.<init>(FileHandler.java:363)
            at com.sleepycat.je.util.FileHandler.<init>(FileHandler.java:54)
            at com.sleepycat.je.dbi.EnvironmentImpl.initFileHandler(EnvironmentImpl.java:1323)
            at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:429)
            at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:341)
            at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:181)
            at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:229)
            at com.sleepycat.je.Environment.<init>(Environment.java:211)
            at com.sleepycat.je.Environment.<init>(Environment.java:165)
            at org.wikipedia.miner.db.WEnvironment.<init>(Unknown Source)
            at org.wikipedia.miner.model.Wikipedia.<init>(Unknown Source)
            at org.wikipedia.miner.service.ServiceHub.<init>(Unknown Source)
            at org.wikipedia.miner.service.ServiceHub.getInstance(Unknown Source)
            at org.wikipedia.miner.service.Service.init(Unknown Source)
            at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
            at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
            at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
            at java.lang.Thread.run(Thread.java:722)

     
  • Edgar Meij
    Edgar Meij
    2012-12-17

    Yes, you can delete those files safely and try again.

     
  • Amrita Lakshmi
    Amrita Lakshmi
    2012-12-19

    Thanks for you input ejmeij.
    The service didn't have permission to create the file in the db directory. Once I changed the permissions, it got fixed.

    BTW, if you have hosted this service yourself, could you tell me how to change the responseFormat parameter to json? It works directly on the original service by just adding &responseFormat=json but when I try this on the service I hosted, it still gives me an xml output.