【问题标题】:Failed to install jts library on Solr 6.4.2在 Solr 6.4.2 上安装 jts 库失败
【发布时间】:2017-03-11 12:28:41
【问题描述】:

我刚刚安装了 Solr-6.4.2,并尝试通过将所有 JTS 库文件复制到 /solr-6.4.2/server/solr-webapp/WEB-INF/lib 目录来安装 JTS 库like here explained

然后通过添加配置托管模式

  <fieldType name="location_rpt"   class="solr.SpatialRecursivePrefixTreeFieldType"
           spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
           distErrPct="0.025"
           maxDistErr="0.000009"
           units="degrees"
        />

<field name="geo"  type="location_rpt"  indexed="true" stored="true"  multiValued="true" />  

并在 /bin 中使用 ./solr start (jetty) 启动它

但是当我访问 solr 界面时,它说:

> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Could not load conf for core polygon: Can't load schema
> /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema:
> Plugin Initializing failure for [schema.xml] fieldType

在我看来,该库未找到或未自动加载(根据教程应该如此)。

你能帮帮我吗? 这是日志文件:

2017-03-11 15:44:57.061 INFO  (main) [   ] o.a.s.c.CorePropertiesLocator Cores are: [polygon]
2017-03-11 15:44:57.067 INFO  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.c.SolrResourceLoader [null] Added 8 libs to classloader, from paths: [/home/spatial/solr-6.4.2/server/solr/polygon/lib]
2017-03-11 15:44:57.117 INFO  (main) [   ] o.e.j.s.Server Started @777ms
2017-03-11 15:44:57.174 INFO  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.c.SolrResourceLoader [polygon] Added 59 libs to classloader, from paths: [/home/spatial/solr-6.4.2/contrib/clustering/lib, /home/spatial/solr-6.4.2/contrib/extraction/lib, /home/spatial/solr-6.4.2/contrib/langid/lib, /home/spatial/solr-6.4.2/contrib/velocity/lib, /home/spatial/solr-6.4.2/dist]
2017-03-11 15:44:57.209 INFO  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.c.SolrConfig Using Lucene MatchVersion: 6.4.2
2017-03-11 15:44:57.298 INFO  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.s.IndexSchema [polygon] Schema name=example-data-driven-schema
2017-03-11 15:44:57.385 WARN  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.c.SolrResourceLoader Solr loaded a deprecated plugin/analysis class [solr.SynonymFilterFactory]. Please consult documentation how to replace it accordingly.
2017-03-11 15:44:57.535 WARN  (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.s.AbstractSpatialFieldType Replace 'com.spatial4j.core' with 'org.locationtech.spatial4j' in your schema.
2017-03-11 15:44:57.556 ERROR (coreLoadExecutor-6-thread-1) [   x:polygon] o.a.s.c.CoreContainer Error creating core [polygon]: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType
org.apache.solr.common.SolrException: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:84)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:888)
    at org.apache.solr.core.CoreContainer.lambda$load$3(CoreContainer.java:542)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:598)
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:183)
    at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104)
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173)
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45)
    at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75)
    at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:106)
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78)
    ... 8 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:194)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491)
    ... 15 more
Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees}
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:202)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:165)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:53)
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:191)
    ... 16 more
2017-03-11 15:44:57.558 ERROR (coreContainerWorkExecutor-2-thread-1) [   ] o.a.s.c.CoreContainer Error waiting for SolrCore to be created
java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core [polygon]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.solr.core.CoreContainer.lambda$load$4(CoreContainer.java:570)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Unable to create core [polygon]
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:903)
    at org.apache.solr.core.CoreContainer.lambda$load$3(CoreContainer.java:542)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)
    ... 5 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:84)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:888)
    ... 7 more
Caused by: org.apache.solr.common.SolrException: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:598)
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:183)
    at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104)
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173)
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45)
    at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75)
    at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:106)
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78)
    ... 8 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:194)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491)
    ... 15 more
Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees}
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:202)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:165)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:53)
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:191)

【问题讨论】:

    标签: solr jetty polygon jts


    【解决方案1】:

    原来界面最近发生了变化,在 stackoverflow 上找到的旧示例,如 here 不适用于最新的 solr 版本(6.4.2)。最新的文档是here

    一个可行的配置示例:

      <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
        spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
        autoIndex="true"
        distErrPct="0.025"
        maxDistErr="0.001"
        distanceUnits="kilometers" />
    

    我。 e.现在使用distanceUnits 代替units 等,而degrees 作为属性似乎会引发错误。

    我使用的初始代码在最新的 solr 版本中引发了错误。

    Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees}
    

    【讨论】:

      猜你喜欢
      • 2018-04-07
      • 2016-01-03
      • 2018-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-22
      • 2017-06-06
      • 2020-07-07
      相关资源
      最近更新 更多