Configuring the Solr library path
Workaround for DSE Search failure to find files in directories that are defined by the <lib> property.
The location for library files in DataStax Enterprise is not the same location as open source Solr. Contrary to the examples shown in the solrconfig.xml file that indicate support for relative paths, DataStax Enterprise does not support the relative path values that are set for the <lib> property. DSE Search fails to find files in directories that are defined by the <lib> property. The workaround is to place custom code or Solr contrib modules in the Solr library directories.
The workaround is to place the JAR file, custom code, or the Solr contrib modules in the Solr library directories.
Installer-Services | /usr/share/dse/resources/solr/lib |
Package installations | /usr/share/dse/solr/lib |
Installer-No Services and Tarball installations | install_location/resources/solr/lib |
java.lang.ClassNotFoundException
and an error in the system.log like
this:ERROR [http-8983-exec-5] 2015-12-06 16:32:33,992 CoreContainer.java (line 956) Unable to create core: boogle.main
org.apache.solr.common.SolrException: Error loading class 'com.boogle.search.CustomQParserPlugin'
at org.apache.solr.core.SolrCore.(SolrCore.java:851)
at org.apache.solr.core.SolrCore.(SolrCore.java:640)
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.doCreate(CassandraCoreContainer.java:675)
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:234)
at com.datastax.bdp.search.solr.core.SolrCoreResourceManager.createCore(SolrCoreResourceManager.java:256)
at com.datastax.bdp.search.solr.handler.admin.CassandraCoreAdminHandler.handleCreateAction(CassandraCoreAdminHandler.java:117)
...
Caused by: org.apache.solr.common.SolrException: Error loading class 'com.boogle.search.CustomQParserPlugin'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:405)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:541)
...
Caused by: java.lang.ClassNotFoundException: com.boogle.search.CustomQParserPlugin
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
...
Workaround
- Define the parser in the solrconfig.xml
file:
<queryParser name="myCustomQP" class="com.boogle.search.CustomQParserPlugin"/>
- Place custom code or Solr contrib modules in the Solr library directories
- Deploy the JAR file on all DSE Search nodes in the cluster in the appropriate
lib/ directory.
For example, package installations: /usr/share/dse/solr/lib/com.boogle.search.CustomQParserPlugin-1.0.jar
- Reload the Solr core with the new configuration.