Domanda

I have installed Elastic Search on an AMazon Ec2 Windows Instance (Windows Server 2008 x64) using the setup available here

I was using this blog post as a reference. I was able to successfully install and communicate with elastic search. Now I am trying to implement a river so that I can get data from Sql Server db. I downloaded and extracted the Microsoft Sql Server Jdbc driver and copied the sqljdbc4.jar to the lib folder of ElasticSearch.

But the river does not run and I get the following exception in the logs/console

[2012-11-22 16:27:03,165][ERROR][river.jdbc               ] com.microsoft.sqlserver.jdbc.SqlServerDriver
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SqlServerDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    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 org.elasticsearch.river.jdbc.SQLService.getConnection(SQLService.java:102)
    at org.elasticsearch.river.jdbc.JDBCRiver$JDBCConnector.run(JDBCRiver.java:194)
    at java.lang.Thread.run(Unknown Source)

This is really frsutrating because the jar file is in lib directory. In fact I specifically added the sqljdbc.jar to the ES_CLASSPATH and it the classpath does have the directory, but still i get the error. I do not know how to further debug this and didn't find any solution on the net.

How do I fix this?

È stato utile?

Soluzione

While configuring the river, the class name given was

com.microsoft.sqlserver.jdbc.SqlServerDriver

where as it should have been

com.microsoft.sqlserver.jdbc.SQLServerDriver

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top