我正在运行以下程序。主线程正常运行并终止,但程序继续运行,因为一个名为 pool-1-thread-1 的线程永远不会终止。谁能建议代码有什么问题?配置文件都在 Solr 的标准发行版中提供。
package solrapp;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.core.CoreContainer;
public class SolrApp {
public static void main(String[] args) throws Exception {
CoreContainer coreContainer = new CoreContainer.Initializer().initialize();
SolrServer server = new EmbeddedSolrServer(coreContainer, null);
SolrQuery query = new SolrQuery("*:*");
QueryResponse response = server.query(query);
SolrDocumentList results = response.getResults();
System.out.println(results);
}
}