Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
579 views
in Technique[技术] by (71.8m points)

indexing - WSO2 API Manager issues with solr

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:wso2wso2am-1.10.0solrdataindex 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...