On 10/18/21 1:10 PM, Mal Aware wrote:
I was reading the following SOLR reference (
https://solr.apache.org/guide/8_10/stream-source-reference.html#jdbc-syntax)
and was curious to try out the functionality, but unfortunately no matter
what I tried I would always receive the same error: *"EXCEPTION": "Failed
to load JDBC driver for 'org.hsqldb.jdbcDriver'"*.
In order to make sure that the Jar files were loaded, they were copied to
the "dist" directory and were added into the "solrconfig.xml" files of the
launched SOLR nodes. The following xml line was used: *<lib
path="${solr.install.dir:../../../..}/dist/hsqldb-2.4.0.jar" />*
After modifying the "solrconfig.xml" files, the solr server was run in both
a standalone mode using "-e dih" (because it comes by default with a node
requiring the hsql driver), as well as "-e cloud" to test the functionality
in Cloud mode, but they both resulted in the above exception.
Does anyone know how to properly import the jdbcDriver in order for the
Stream component to see it?
Jar loading can be a tricky thing with Solr.
The best advice I can give you is to remove all <lib> configurations
from your solrconfig.xml files, create a "lib" directory under your solr
home directory, and place all the extra jars you need in that lib
directory. Make sure to not include any jars in that directory that are
part of Solr itself. Keep it to the absolute minimum you can.
Any files placed there will automatically be loaded when Solr starts.
As long as there is no <lib> config in your solrconfig.xml files
pointing to locations that may contain the same jars, they will be
loaded exactly once. They will be available to all cores. The loading
once thing is important -- some jars stop working if they are loaded
more than once. Also, loading more than once uses more memory.
In case you don't know, the solr home directory is the directory in
which solr looks for cores. For non-cloud deployments, and cloud
deployments where solr.xml doesn't live in zookeeper, that is where
solr.xml is read from.
Thanks,
Shawn