11 Replies Latest reply on May 25, 2016 2:09 PM by Lou Feliz

    Wildfly  FirebirdSQLhibernate error

    Lou Feliz Newbie

      Hello,

       

      I am running  Wildfly 8.2,  on Win 7 64 Bit,  JDK 1.8

       

      I have deployed the application Dashbuilder  (http://www.dashbuilder.org/)  and run demo with H2  and then I succesfully installed Postgres as my default datasource and repository.  I added additional jdbc drivers to WildFly and used Postgres as a datasource for a simple dashboard.

       

      I installed  Firebird Jayberd2.2.10.jar driver into Wildfly and successfully tested it.

       

      I restarted the Wildfly server (batch file).  Logged into conosole  made sure the datasource was enabled and did a test connect and it was succesful.

       

      I follow steps to setup datasource in Dashbuilder and I get the error from Wildfly Log

       

      2016-05-17 10:11:05,173 ERROR [org.jboss.dashboard.database. hibernate. HibernateInitializer] (default task-51) The underlying database code [firebird 1.55li] is not supported.

      2016-05-17 10:11:05,185 ERROR [org.jboss.dashboard.dataset. sql.SQLDataSet] (default task-51) Error in load() SQLDataset. SQL = null: java.lang.NullPointerException

       

       

       

       

      I tried with newer version of Firebrid SQL and similar error

      2016-05-13 16:01:21,372 ERROR [org.jboss.dashboard.database.hibernate.HibernateInitializer] (default task-10) The underlying database code [firebird 2.1.wi] is not supported.

      2016-05-13 16:01:21,383 ERROR [org.jboss.dashboard.dataset.sql.SQLDataSet] (default task-10) Error in load() SQLDataset. SQL = null: java.lang.NullPointerException

       

       

      In theory I understand that Hibernate needs particular info on Firebird. What I am stuck on is where do tell it about firebird.   I need to access a firebird database, but will also be using the app against  Postgres and MS SQL.  I found some information on dialects, but need some guidance on the next part.  Is this something that I must set for each Firebird connection (Java:/fbdatabase)

       

      Is Hibernate something configured within WildFly or is it possibly in the application?

       

      I found info on mysql dialect and if same holds true for Firebird, I just need to locate the file in which to place this snippet of xml

       

      <hibernate-configuration>

          <session-factory>

                  <property name="dialect">

                  org.hibernate.dialect.FirebirdDialect

              </property>

              <property name="connection.datasource">java:/rskinfo</property>

          </session-factory>

      </hibernate-configuration>

       

      and perhaps this is what needs

       

       

      I really want to get Firebird working with this and would greatly appreciate some help.

       

      Below is my configuration information:

      I setup a folder  C:\Server\wildfly-8.2.1\modules\system\layers\base\org\firebirdsql\main

      copied in the jaybird-2.2.10.jar  file (not the full jar)

      module.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.3" name="org.firebirdsql">

          <resources>

              <resource-root path="jaybird-2.2.10.jar"/>

          </resources>

       

          <dependencies>

              <module name="javax.api"/>

        <module name = "javax.resource.api"/>

              <module name="javax.transaction.api"/>

          </dependencies>

      </module>

       

      I am running the STandlone.bat  so I edit the standalone.xml config file adding the driver to drivers section

       

      <driver name="firebirdsql" module="org.firebirdsql">

                              <driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>

                              <xa-datasource-class>org.firebirdsql.ds.FBXADataSource</xa-datasource-class>

                          </driver>

       

      Then added   a datasource

       

                      <datasource jta="false" jndi-name="java:/rskinfo" pool-name="rskinfo" enabled="true" use-ccm="false">

                          <connection-url>jdbc:firebirdsql://server:3050/RSKINFO</connection-url>

                          <driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>

                          <connection-property name="charset">

                              UTF8

                          </connection-property>

                          <driver>firebirdsql</driver>

                          <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

                          <security>

                              <user-name>SYSDBA</user-name>

                              <password>masterkey</password>

                          </security>

                          <validation>

                              <validate-on-match>false</validate-on-match>

                              <background-validation>false</background-validation>

                          </validation>

                          <timeout>

                              <set-tx-query-timeout>false</set-tx-query-timeout>

                              <blocking-timeout-millis>0</blocking-timeout-millis>

                              <idle-timeout-minutes>0</idle-timeout-minutes>

                              <query-timeout>0</query-timeout>

                              <use-try-lock>0</use-try-lock>

                              <allocation-retry>0</allocation-retry>

                              <allocation-retry-wait-millis>0</allocation-retry-wait-millis>

                          </timeout>

                          <statement>

                              <share-prepared-statements>false</share-prepared-statements>

                          </statement>

                      </datasource>

        • 1. Re: Wildfly  FirebirdSQLhibernate error
          Lou Feliz Newbie

          Just updating this.... Problem is with Dashbuilder not directly supporting FirebridSQL.  I has submitted a ticket to the Dashbuilder  dev's.

           

          Cheers!

           

          - Lou

          • 2. Re: Wildfly  FirebirdSQLhibernate error
            Wolfgang Mayer Master

            I don't think this is related to Dashbuilder (but you should use the 'JNDI' configruration)

            You also should make sure that your driver is installed correctly in wildfly.

            This module.xm should be working


            <module xmlns="urn:jboss:module:1.3" name="org.firebird">

                <resources>

                    <resource-root path="jaybird-2.2.10.jar"/>

                </resources>

                <dependencies>

                    <module name="javax.api"/>

                    <module name="javax.resource.api"/>

                    <module name="javax.transaction.api"/>

                </dependencies>

            </module>

            I'd suggest that you install the driver via cli. You datasource could be created via the console

            • 3. Re: Wildfly  FirebirdSQLhibernate error
              Lou Feliz Newbie

              Hello,

               

              Interesting as the driver says it is fine in Wildfly.    What steps did you take to install driver via CLI ?

               

              Regards,

               

              Lou

              • 4. Re: Wildfly  FirebirdSQLhibernate error
                Wolfgang Mayer Master

                This documentation should provide more details (JDBC Driver / DataSource Setup | HAL Management Console). But in short this is:

                 

                1. change to directory $JBOSS_HOME/bin
                2. Connect to WildFly: ./jboss-cli.sh  --connect
                3. add the driver:

                /subsystem=datasources/jdbc-driver=firebird:add(driver-name=firebird,driver-module-name=org.firebird,driver-class-name=org.firebirdsql.jdbc.FBDriver,driver-xa-datasource-class-name=org.firebirdsql.ds.FBXADataSource)

                • 5. Re: Wildfly  FirebirdSQLhibernate error
                  Lou Feliz Newbie

                  Hello,

                   

                  I just want to clarify my problem, before I attempt redoing install via CLI, I checked my install and updated naming convention I used for the module and updated my config. I am able to setup an External Connection to Firebird datasource that is configured in Wildfly.  When setting the Ext Connection in Dashbuilder,  the test SQL does pass.

                   

                  In Dashbuilder, I get the hibernate error in log file when I goto define the datasource and select the SQL Qry - external firebird connection that I defined. 

                   

                  I will now attempt installing driver in manner you mentioned via CLI and see what happens.....

                  • 6. Re: Wildfly  FirebirdSQLhibernate error
                    Lou Feliz Newbie

                    Hello ,

                     

                    I added the driver via the cli, thank you.

                     

                    I then proceed to add data source via Wildfly Admin control panel,  enable it, test connection. All is well.

                     

                    Login to Dashbuilder,    add External Connection,    test it successfully,

                     

                    Then proceed to add a Data provider.  I select  the type, select my External connection, put in valid SQL, one I used to test the Connection and error.  Below is excerpt from the Log.

                     

                     

                     

                    2016-05-24 15:05:05,873 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-16) JBAS010400: Bound data source [java:/wsdmxtransport]

                    2016-05-24 15:06:16,935 ERROR [org.jboss.dashboard.database.hibernate.HibernateInitializer] (default task-40) The underlying database code [firebird 2.5] is not supported.

                    2016-05-24 15:06:16,935 ERROR [org.jboss.dashboard.dataset.sql.SQLDataSet] (default task-40) Error in load() SQLDataset. SQL = null: java.lang.NullPointerException

                    • 7. Re: Wildfly  FirebirdSQLhibernate error
                      Wolfgang Mayer Master

                      Yes, you are right. This message is thrown within the class HibernateInitializer from Dashbuilder (dashboard-builder-6.4.0.Final/modules/dashboard-commons/src/main/java/org/jboss/dashboard/database/hibernate/HibernateInitializer.java)

                      But it worked in my test when I made some simple changes:

                       

                      below: public static final String DB_SYBASE = "sybase";

                      add:public static final String DB_FIREBIRD = "firebird";

                       

                      change: DB_SYBASE + "=org.hibernate.dialect.SybaseASE157Dialect")

                      to:         DB_SYBASE + "=org.hibernate.dialect.SybaseASE157Dialect," +

                                   DB_FIREBIRD + "=org.hibernate.dialect.FirebirdDialect")

                       

                      below: if (dbProductName.contains("oracle")) return DB_ORACLE;

                      add: if (dbProductName.contains("firebird")) return DB_FIREBIRD

                       

                      Then do the

                      mvn clean install -Dfull -DskipTests

                      • 8. Re: Wildfly  FirebirdSQLhibernate error
                        Lou Feliz Newbie

                        Thank you that's good to know.  My experience working with Java is minimal, I am able to open war file, modify properties and build new war to deploy Dashbuilder with different default database, add role etc...

                         

                        Is there a good place for me to find step by step what I need to setup on my workstation to modify the project as you have?  I am primarily developing desktop biz apps with Delphi.  I am working on Win 7 64 bit. If needed, I can setup a linux VM for this and would like to be able to modify the DashB source so I can keep testing FirebirdSQL.    I would then generate my own custom build of DashB until Firebird support is officially added by the dev team.

                         

                        I am currently using V2.5, and would like to migrate to V3 which was just recently released.

                         

                        Regards,

                         

                        - Lou

                        • 10. Re: Wildfly  FirebirdSQLhibernate error
                          Lou Feliz Newbie

                          Thanks.  I will give this a go on Windows, and later on a newly minted Linux VM.

                           

                          -Lou

                          • 11. Re: Wildfly  FirebirdSQLhibernate error
                            Lou Feliz Newbie

                            Hello.  Success!  I added the lines  as indicated  to enable Firebird and it worked against FB 1.5. I will be testing against  FB 2.5 and 3.0 NExt.

                             

                            I built on Windows 7 64 bit using JDK 8 and latest Maven and all is good....so far. Lets see  what happens when I start building new workspace.

                             

                            This is great.  I hope that this change makes it into next build.  My users are going to like DashBuilder!

                             

                            - Lou