简体   繁体   中英

Where is the default path to the apache lucene index file with grails searchable plugin?

I'm using in my grails 1.3.7 project the searchable plugin. My project was running well until my macbooks harddrive was full and osx threw an message about memory problems and that it'll delete some files (tmp and so on) (after that i deleted some movies and got more than 10GB free space). I didn't change the sourcecode but when i start my grails app now, i get the following exception:

Running Grails application..
Configuring Spring Security ...
Configuring SpringSocial Facebook
2011-11-18 01:54:16,804 [main] ERROR context.GrailsContextLoader  - Error executing        bootstraps: Failed to retrieve transaction locks; nested exception is java.io.IOException:    Permission denied
org.compass.core.engine.SearchEngineException: Failed to retrieve transaction locks; nested exception is java.io.IOException: Permission denied
java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
at org.apache.lucene.store.SimpleFSLock.obtain(SimpleFSLockFactory.java:144)
at org.apache.lucene.store.Lock.obtain(Lock.java:73)
at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager$6.doInTransaction(DefaultLuceneSearchEngineIndexManager.java:203)
at org.compass.core.impl.DefaultCompass$CompassTransactionContext.execute(DefaultCompass.java:423)
at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager.doOperate(DefaultLuceneSearchEngineIndexManager.java:197)
at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager.doReplaceIndex(DefaultLuceneSearchEngineIndexManager.java:266)
at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager.replaceIndex(DefaultLuceneSearchEngineIndexManager.java:261)
at org.compass.gps.impl.SingleCompassGps.doIndex(SingleCompassGps.java:118)
at org.compass.gps.impl.AbstractCompassGps.index(AbstractCompassGps.java:154)
at org.compass.gps.impl.AbstractCompassGps.index(AbstractCompassGps.java:128)
at grails.plugin.searchable.internal.compass.CompassGpsUtils.index(CompassGpsUtils.java:49)
at grails.plugin.searchable.internal.compass.CompassGpsUtils$index.call(Unknown Source)
at SearchableGrailsPlugin$_closure3.doCall(SearchableGrailsPlugin.groovy:158)
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Application context shutting down...
Application context shutdown.

I think there is a problem with the lucene index in filesystem, but where can i find it? Where is the lucene index folder or file stored? I didn't change the plugins configuration.

It looks like some kind of Unix/OS X permissions issue. When Searchable/Lucene starts up and tries to create an index, the first thing it does is create a lock file in the index directory. From your stack trace this looks to be what is failing.

The Searchable.groovy file is where the index path is defined; it's possible that it has been overridden in the environment block, possibly even in Config.groovy .

grails run-app runs Grails as your user, so the problem doesn't have anything to do with Tomcat running as a different user.

According the the default conf file

/**
 * The location of the Compass index
 *
 * Examples: "/home/app/compassindex", "ram://app-index" or null to use the default
 *
 * The default is "${user.home}/.grails/projects/${app.name}/searchable-index/${grails.env}"
 */

So unless you have changed it (you say you haven't), I'd have a look in

~/.grails/projects/${app.name}/searchable-index/${grails.env}

我的tomcat安装在$ {user.home} /。grails / projects / $ {app.name} / searchable-index中,请记住tomcat进程可能在与您不同的用户下运行,所以我运行了“ sudo nautilus才能看到它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM