solr搭建过程中控制台报错:
olrResourceLoader – new SolrResourceLoader for directory: 'F:\zsolrwork\home\collection1\'
olrConfig – Adding specified lib dirs to ClassLoader
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/extraction/lib (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/clustering/lib/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/langid/lib/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\lan
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/velocity/lib (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\ve
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
.SolrIndexConfig – IndexWriter infoStream solr logging is enabled
olrConfig – Adding specified lib dirs to ClassLoader
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/extraction/lib (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/clustering/lib/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/langid/lib/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\lan
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../contrib/velocity/lib (resolved as: F:\zsolrwork\home\collection1\..\..\..\contrib\ve
olrResourceLoader – Can't find (or read) directory to add to classloader: ../../../dist/ (resolved as: F:\zsolrwork\home\collection1\..\..\..\dist).
.SolrIndexConfig – IndexWriter infoStream solr logging is enabled
解决方法:
方案一:
需要找到collection1/conf 目录下的solrconfig.xml文件,找到
<lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" />
<lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-clustering-\d.*\.jar" />
<lib dir="../../../contrib/langid/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-langid-\d.*\.jar" />
<lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
将其注释掉,然后到sorl源目录中找到相应的jar包添加到项目的lib文件夹中。
方案二:
复制solr-4.5.0\contrib和\solr-4.5.0\dist文件夹,到任意一个目录下。
在collection1/config目录中找到solrconfig.xml文件
修改solrconfig.xml配置文件,将dir目录配置成绝对路径(该路径就是刚刚复制的contrib和dist文件夹地址),根据自己的jar路径进行配置,如: