WSO2 API Manager issues with solr

痴心易碎 提交于 2019-12-17 10:01:23

问题


I have setup a new setup of WSO2 API Manager integrated with WSO2 Identity Server. When starting the WSO2 API Manager I start getting the following error:

 SolrIndexWriter was not closed prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!! {org.apache.solr.update.SolrIndexWriter}
TID: [-1] [] [2017-03-07 10:38:31,745] ERROR {org.apache.solr.update.SolrIndexWriter} -  Error closing IndexWriter {org.apache.solr.update.SolrIndexWriter}
java.lang.NullPointerException
    at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3010)
    at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:2978)
    at org.apache.lucene.index.IndexWriter.shutdown(IndexWriter.java:970)
    at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1015)
    at org.apache.solr.update.SolrIndexWriter.close(SolrIndexWriter.java:130)
    at org.apache.solr.update.SolrIndexWriter.finalize(SolrIndexWriter.java:183)
    at java.lang.System$2.invokeFinalize(System.java:1213)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
TID: [-1] [] [2017-03-07 10:38:32,198] ERROR {org.apache.solr.core.CoreContainer} -  Error creating core [registry-indexing]: Error opening new searcher {org.apache.solr.core.CoreContainer}
org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:815)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:658)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:637)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:381)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:375)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:148)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1657)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1769)
    at org.apache.solr.core.SolrCore.initSearcher(SolrCore.java:911)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:788)
    ... 9 more
Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in NRTCachingDirectory(MMapDirectory@C:\wso2\wso2am-1.10.0\solr\data\index lockFactory=org.apache.lucene.store.NativeFSLockFactory@2d38ca50; maxCacheMB=48.0 maxMergeSizeMB=4.0): files: [_od3a_Lucene50_0.tim, _od3a.fnm, write.lock, _od3a.nvd, _od3a_1.liv, _od3a_Lucene50_0.pos, _od3a.fdx, _od3a_Lucene50_0.doc, _od3a.si, _od3a.fdt, _od3a_Lucene50_0.tip, _od3a.nvm]
    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:825)
    at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:78)
    at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:65)
    at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:273)
    at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:116)
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1626)
    ... 12 more

Any one has any ideas please?


回答1:


This could happen if the indexing has not happened properly. You can try redoing the indexing as follows.

  1. Backup the solr folder which resides in /solr and remove from API Manager home location.
  2. Open /repository/conf/registry.xml
  3. Under indexingConfiguration tag there is a value called lastAccessTimeLocation. Default value is

/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime

Change that value to

/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime1

  1. Start the server.
  2. Wait about 2 minutes for indexing.
  3. Recheck the creation of the API.


来源:https://stackoverflow.com/questions/42646421/wso2-api-manager-issues-with-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!