Search code examples
sql-serverjdbcclassnotfoundexceptionconnectorgoogle-search-appliance

ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver while deploying google connector for database


I'm deploying google search appliance connector for database(SQL). I'm filling the information in the GSA hostname and other required variable where I have specified the full class name of my JDBC Driver as:

com.microsoft.sqlserver.jdbc.SQLServerDriver

which is right. I have browsed my library of the JDBC to check that.

But after the installation, I am getting this error in the logs:

main .Application.realDaemonStart() INFO: about to init com.google.enterprise.adaptor.database.DatabaseAdaptor
11-04 14:05:27.314 main .Application.realDaemonStart() WARNING: Failed to initialize adaptor
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.google.enterprise.adaptor.database.DatabaseAdaptor.init(DatabaseAdaptor.java:133)
    at com.google.enterprise.adaptor.Application.realDaemonStart(Application.java:186)
    at com.google.enterprise.adaptor.Application.daemonStart(Application.java:155)
    at com.google.enterprise.adaptor.Application.start(Application.java:110)
    at com.google.enterprise.adaptor.Application.main(Application.java:553)
    at com.google.enterprise.adaptor.AbstractAdaptor.main(AbstractAdaptor.java:64)
    at com.google.enterprise.adaptor.database.DatabaseAdaptor.main(DatabaseAdaptor.java:315)

What does this mean? I have specified the right class name in the JDBC. Any help is appreciated.


Solution

  • When you run the adaptor - is your JAR file in the same directory as your database adaptor JAR file?

    If you are using the Google provided command line, be sure to modify the "classpath" to reference the JAR file for the ODBC driver.

    ie.

    -classpath="msqljdbc.jar,adaptor-database-4.1.1-withlib.jar"
    

    or

    -cp="msqljdbc.jar,adaptor-database-4.1.1-withlib.jar"