0 Replies Latest reply on Dec 8, 2014 9:28 AM by Shaheen Mahomed

    SQLite Datasource on Wildfly 8.2

    Shaheen Mahomed Newbie

      Hi there

       

      I'm new to Application Servers and JBoss/Wildfly as a whole. I'm trying to run a WildFly 8.2 server and add an sqlite datasource.  So far with very little luck.  I've search over and over but m unable to find an example of hoe to setup the datasource on Wildfly

       

      So far i've added the following to my standalaone.xml

      <datasource jndi-name="java:jboss/SQLiteExample" pool-name="SQLiteDS" enabled="false" use-java-context="true">
          <connection-url>jdbc:sqlite:/home/shaheen/dining.sqlite</connection-url>
          <driver-class>org.sqlite.JDBC</driver-class>
          <driver>sqlite</driver>
      </datasource>
      <driver name="sqlite" module="com.sqlite">
          <xa-datasource-class>org.sqlite.JDBC</xa-datasource-class>
      </driver>
      
      

       

      I created a folder in JBOSS_HOME/modules/system/layers/base/com/sqlite/main

      and have added a module.xml and the jdbc-driver jar file

      <?xml version="1.0" encoding="UTF-8"?>
      <module xlmns="urn:jboss:module:1.1" name="com.sqlite">
          <resources>
              <resource-root path="sqlite-jdbc-3.8.7.jar"/>
          </resources>
          <dependencies>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>
          </dependencies>
      </module>
      
      

       

      WildFly starts up fine but when I attempt to enable the datasource in the admin web interface I get the following error

      15:56:50,039 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-5) JBAS014613: Operation ("enable") failed - address: ([
          ("subsystem" => "datasources"),
          ("data-source" => "SQLiteDS")
      ]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
          "Services that were unable to start:" => [
              "jboss.data-source.reference-factory.SQLiteDS",
              "jboss.naming.context.java.jboss.SQLiteExample"
          ],
          "Services that may be the cause:" => ["jboss.jdbc-driver.sqlite"]
      }}
      
      

       

      Can someone provide some help as to how to properly configure the datasource.  My main problem areas are that I dont know what dependencies WildFly is looking for and I'm not absolutely clear on how to form the JNDI string.  the H2 database uses java:jboss/datasources/ExampleDS but if I add the datasources into the JNDI I get the same error.

       

      I'm suspecting Wildfly is not finding the jdbc driver for SQLite but am unable to figure out where I've gone wrong.  I've tried to follow numerous other examples for other database types (mainly mySQL that I've seen) but without luck.

       

      Any Help would be appreciated.

      Thanks

      Shaheen