3 Replies Latest reply on Jul 2, 2015 5:03 PM by Tomaz Cerar

    How to add cassandra db driver as module

    Simon Cigoj Newbie

      I'm trying to add the cassandra db driver as module to wildfly 8.2

       

      I've added the foulder
      wildfly-8.2.0.Final\modules\system\layers\base\com\datastax\cassandra\main\

      with cassandra-driver-core-2.1.6.jar inside

      wildfly-8.2.0.Final\modules\system\layers\base\com\codahale\metrics\main\

      with metrics-core-3.0.2.jar inside

       

      the casandra module.xml is like this:

       

      <module xmlns="urn:jboss:module:1.3" name="com.datastax.cassandra">
        <resources>
        <resource-root path="cassandra-driver-core-2.1.6.jar"/>
        </resources>
        <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="org.slf4j" />
        <module name="com.google.guava" />
        <module name="io.netty" />
        <module name="com.codahale.metrics" />
        </dependencies>
      </module>
      

       

      the metrics module.xml is like this:

       

      <module xmlns="urn:jboss:module:1.3" name="com.codahale.metrics">
        <resources>
        <resource-root path="metrics-core-3.0.2.jar"/>
        </resources>
        <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="sun.jdk" />
        <module name="org.slf4j" />
        </dependencies>
      </module>
      

       

      Then I added this line to the extensions in standalone.xml

       

       <extension module="com.datastax.cassandra"/>
      

       

      When I run the server I get this exception:

       

      19:23:44,882 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
        at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:112) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.server.ServerService.boot(ServerService.java:331) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:259) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
      Caused by: javax.xml.stream.XMLStreamException: JBAS014674: Failed to load module com.datastax.cassandra
        at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:155) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:434) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:145) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:107) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
        at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
        at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:104) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        ... 3 more
      Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS014744: No META-INF/services/org.jboss.as.controller.Extension found for com.datastax.cassandra:main
        at java.util.concurrent.FutureTask.report(FutureTask.java:122) [rt.jar:1.8.0_45]
        at java.util.concurrent.FutureTask.get(FutureTask.java:192) [rt.jar:1.8.0_45]
        at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:147) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        ... 9 more
      Caused by: java.lang.IllegalStateException: JBAS014744: No META-INF/services/org.jboss.as.controller.Extension found for com.datastax.cassandra:main
        at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:192) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.controller.parsing.ExtensionXml.access$000(ExtensionXml.java:69) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:127) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:124) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
      
      

       

      Any hints?