• Call: +1 (858) 429-9131

Solr Error message – Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Sometimes when we follow the default steps to install Solr the MySQL JDBC libraries are missed out and we end up getting the following error in the log files.

 

 Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

 

We can get things working by following these steps.

 

Install the missing libraries

 

apt-get install libmysql-java

 

Find the required Jar files by using the following command

 

dpkg-query -L libmysql-java

 

This will give an output like the following

/.
/usr
/usr/share
/usr/share/java
/usr/share/java/mysql-connector-java-5.1.38.jar
/usr/share/doc
/usr/share/doc/libmysql-java
/usr/share/doc/libmysql-java/copyright
/usr/share/doc/libmysql-java/README.gz
/usr/share/doc/libmysql-java/changelog.Debian.gz
/usr/share/maven-repo
/usr/share/maven-repo/mysql
/usr/share/maven-repo/mysql/mysql-connector-java
/usr/share/maven-repo/mysql/mysql-connector-java/5.1.38
/usr/share/maven-repo/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.pom
/usr/share/maven-repo/mysql/mysql-connector-java/debian
/usr/share/maven-repo/mysql/mysql-connector-java/debian/mysql-connector-java-debian.pom
/usr/share/java/mysql.jar
/usr/share/java/mysql-connector-java.jar
/usr/share/maven-repo/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar
/usr/share/maven-repo/mysql/mysql-connector-java/debian/mysql-connector-java-debian.jar

 

From the above, the two jars mysql.jar and mysql-connector-java.jar are the ones which is needed.

create a soft link to the library path of your solr installation. (in this case, /opt/solr-6.6.0 )


cd /opt/solr-6.6.0/server/lib

ln -s /usr/share/java/mysql-connector-java-5.1.38.jar  /opt/solr-6.6.0/server/lib

ln -s /usr/share/java/mysql.jar /opt/solr-6.6.0/server/lib

 

Add the relevant path to your solrconfig.xml

 

<lib dir="${solr.install.dir:../../../..}/server/lib" regex=".*\.jar" />

restart Solr & you are all set.

 

In some cases, you will get an error

 

Caused by: java.sql.SQLException: Illegal value for setFetchSize().

This can be addressed by adding batchSize=”-1″ to the data source declaration.

 

ie,

 










DKIM (Domain keys ) & SPF for domains

DKIM – the technology pioneered by Google is a major weapon against fighting spam. SPF is also another tool that helps us achieve the same goal. Here is the quick steps to enable both.

 

  1.  SPF aka Sender Policy Framework  uses the DNS TXT field

Example:

dig agileblaze.com txt

;; ANSWER SECTION:
agileblaze.com. 300 IN TXT "v=spf1 ip4:52.205.101.12 ip4:52.202.71.86 include:_spf.google.com ~all"
agileblaze.com. 300 IN TXT "google-site-verification=C2mB_M1y9wd9wo8jMdzqSQt-nYUo_oJhlNs4H8rM5u4"

&nbsp;

Tools to verify SPF

 

http://www.kitterman.com/spf/validate.html

 

Checking to see if there is a valid SPF record.

Found v=spf1 record for agileblaze.com:
v=spf1 ip4:52.205.101.12 ip4:52.202.71.86 include:_spf.google.com ~all

evaluating…
SPF record passed validation test with pySPF (Python SPF library)!

Domain Keys – DKIM

 

Domain keys also can be added in the TXT field. Unlike SPF, domain keys uses cryptography infrastructure. We will have to add the txt field in the following format

<selector>._domainkey.domain.TLD

In this example we are using the following,

agileblaze._domainkey.agileblaze.com

 

Generation of the the keys and Verification can be done with http://dkimcore.org/tools/

Once the keys are ready, just add them to the DNS records and forget SPAM!

installing apt-fast from the repository with apt-get

apt-fast is a nifty tool that can be used to speed up installation of software packages on Debian GNU/Linux based systems (ie using .deb). This is a script that acts as a wrapper around apt-get apt aptitude etc.

Quick steps for the installation

 

sudo add-apt-repository ppa:saiarcot895/myppa

 

Press enter to accept the repository

apt-get update ; apt-get -y install apt-fast

 

Choose the the package manager tool that you want to use from the ‘dialogue’ as shown below. Normally we go for apt-get

 

 

You can keep the number of downloads per server at the default value.