Question

I am trying to use ha-jdbc with sql server 2008.The ha-jdbc cluster.xml looks like

<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0">
<sync id="passive"/>
<state id="simple"/>
<cluster balancer="load"
 dialect="standard" default-sync="passive" transaction-mode="parallel"   
 durability="none" meta-data-cache="lazy">
<database id="db1" location="com.microsoft.sqlserver.jdbc.SQLServerDriver">
     <user>user</user>
     <password>pass</password>
     <property name="serverName">abc</property>
     <property name="portNumber">121</property>
     <property name="databaseName">dbname</property>
</database>
<database id="db2" location="com.microsoft.sqlserver.jdbc.SQLServerDriver">
     <user></user>
     <password></password>
     <property name="serverName"></property>
     <property name="portNumber"></property>
     <property name="databaseName"</property>
</database>
</cluster>

</ha-jdbc>

Not sure what goes in the location tag.This the exception I get :

 java.sql.SQLException: class com.microsoft.sqlserver.jdbc.SQLServerDriver
at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:51)
at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:35)
at net.sf.hajdbc.AbstractExceptionFactory.createException(AbstractExceptionFactory.java:62)
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:95)
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:34)
at net.sf.hajdbc.sql.CommonDataSource.getProxy(CommonDataSource.java:85)
at net.sf.hajdbc.sql.DataSource.getConnection(DataSource.java:60)
 Caused by: java.lang.ClassCastException: class com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.lang.Class.asSubclass(Class.java:3126)
at net.sf.hajdbc.sql.CommonDataSourceDatabase.getConnectionSource(CommonDataSourceDatabase.java:81)
at net.sf.hajdbc.sql.CommonDataSourceDatabase.getConnectionSource(CommonDataSourceDatabase.java:43)
at net.sf.hajdbc.sql.DatabaseClusterImpl.isAlive(DatabaseClusterImpl.java:841)
at net.sf.hajdbc.sql.DatabaseClusterImpl.start(DatabaseClusterImpl.java:715)
at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:76)

Read lot of blogs but could not find any solution.Any sort of guidance will be really appreciated.

Was it helpful?

Solution

com.microsoft.sqlserver.jdbc.SQLServerDataSource worked for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top