I have problem connect my cassandraDB to wildfly. I am using Cassandra 3.0.9 and wildfly 10.1.0.Final.
When I start the wildfly server, it will give me an error like this:
Here is my standalone.xml to add cassandra datasource:
And here is my module.xml for my cassandra jdbc driver:
I have my cassandra jdbc driver configured according to this blog: http://johnsanda.blogspot.com/2012/10/configuring-cassandra-jdbc-with-jboss.html
And the jdbc driver dir I use is downloaded from here:
I am pretty sure I have the directories and files are in the right places. I have the module.xml in
along with its dependencies.
And I have the datasource class in
I can see the datasource is added through my wildfly admin page. But when I try to test connection, it failed. But the exampleDS provided by wildfly worked perfect.
I don't know what is going on. Is there because of some version compatibility problems? But I didn't see cassandra providing their official jdbc driver on their homepage.
Someone please help me!
<driver name="cassandra" module="org.wildfly.extension.cassandra">
This config says you have jdbc driver in module org.wildfly.extension.cassandra.
but later on you say you have it in
Which would mean module name is org.apache.cassandra.cql.jdbc
given that you have proper module.xml in $WILDFLY_HOME/modules/system/layers/base/org/apache/cassandra/cql/jdbc/main
Hi, Tomaz, thank you for your comments.
I have my module.xml and a lot of jars in:
And I have a lot of classes like the CassandraDataSource.class in:
According to the tutorial I have, it seems to me that
module="org.wildfly.extension.cassandra" tells wildfly where to find the jdbc driver. And
tells wildfly where the actual data source is. So I don't know where is the problem. I don't have any class file in my $WILDFLY_HOME/modules/system/layers/base/org/wildfly/extension/cassandra/main directory.
Have you been successful with connecting to Cassandra via a plain Java class using JDBC?
Your documentation also seems to be quite old.
Apparently there had also been some changes in the schema ([CASSANDRA-10996] The system table system.schema_columnfamilies does not exist - ASF JIRA )
At least in my environment I've got no other JDBC driver working beside of the jdbc wrapper (GitHub - adejanovski/cassandra-jdbc-wrapper: A JDBC wrapper for the Datastax Java Driver for Cassandra)
But here the configuration in WildFly is rather simple
- Copy cassandra-jdbc-wrapper-3.1.0.jar to $JBOSS_HOME/modules/org/cassandra/main/
- Create module.xml in $JBOSS_HOME/modules/org/cassandra/main
- To avoid SLF4J errors you should also copy slf4j-jdk14-1.7.24.jar
<module xmlns="urn:jboss:module:1.3" name="org.cassandra">
<module name="sun.jdk" export="true" >
<include path="sun/misc/Unsafe" />
create the driver via cli:
Hi, Wolfgang, thanks a lot! I have successfully added cassandra datasource to my wildfly app server using this jdbc driver.
One thing to mention is that the git repository cannot complete the whole "mvn clean install", there will an error when doing that, but it still generates the cassandra-jdbc-wrapper-3.1.0.jar we need.
And I downloaded slf4j-jdk14-1.7.24.jar from Maven Repository: org.slf4j » slf4j-jdk14 rather than copy it from the git repository.
Thanks a lot!