Jboss 7 firebird connection

2.6k views Asked by At

I'm having trouble connectiong to Firebird database (jaybird driver) from JBoss 7.1.0 CR1

This is the log:

JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.firebirdsql (missing) dependents: [service jboss.data-source.java:/tiranDS] 

This is standalone.xml

This is my standalone.xml [some parts are changed, like ...(some_path)...]

...

  <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                <datasource jndi-name="java:/tiranDS" pool-name="TiranPool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:firebirdsql:serversp/3050:C:\Program Files\...(some_path)...\tiran.gdb
                    </connection-url>
                    <driver>
                        firebirdsql
                    </driver>
                    <pool>
                        <prefill>
                            false
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                            username
                        </user-name>
                        <password>
                            pass
                        </password>
                    </security>
                </datasource>
                <drivers>
                   <driver name="firebirdsql" module="org.firebirdsql">
                        <xa-datasource-class>
                            org.firebirdsql.jdbc.FBDriver
                        </xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>
...

module.xml looks like this (all .jars mentioned in module.xml are in ...\jboss-as-7.1.0.CR1b\modules\org\firebirdsql\main folder)

<module xmlns="urn:jboss:module:1.0" name="org.firebirdsql">
    <resources>
        <resource-root path="jaybird-full-2.1.6.jar"/>
        <resource-root path="jaybird-pool-2.1.6.jar"/>
        <resource-root path="log4j-1.2.13.jar"/>
        <resource-root path="jboss-javaee.jar"/>
        <resource-root path="jmxri.jar"/>
        <resource-root path="jmxtools.jar"/>
        <resource-root path="sax2.jar"/>

        <resource-root path="commons-logging-1.1.jar"/>
        <resource-root path="junit-3.8.1.jar"/>

    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="javax.activation.api"/>
        <module name="javax.xml.soap.api"/>
        <module name="javax.servlet.api"/>
        <module name="org.jboss.common-core"/>
        <module name="org.jboss.logging"/>
        <module name="javax.mail.api"/>


        <module name="org.apache.log4j"/>               
        <module name="org.jboss.logmanager.log4j"/>
        <module name="org.apache.james.mime4j"/>
        <module name="org.apache.commons.codec"/>
        <module name="org.apache.commons.collections"/>
        <module name="org.apache.commons.io"/>
        <module name="org.apache.commons.lang"/>
        <module name="org.apache.commons.logging"/>
        <module name="org.apache.httpcomponents"/>
        <module name="org.apache.xalan"/>
        <module name="org.apache.xerces"/>
        <module name="org.w3c.css.sac"/>
        <module name="net.sourceforge.cssparser"/>
        <module name="net.sourceforge.nekohtml"/>
    </dependencies>
</module>

Whati is wrong here?


Application with this driver class worked on JBoss 5, but I've tried both classes org.firebirdsql.jdbc.FBDriver and org.firebirdsql.pool.FBConnectionPoolDataSource still no change.

Also, I've tried putting jaybird-2.1.6.jar instead of jaybird-full-2.1.6.jar but still the error is the same.

JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.firebirdsql (missing) dependents: [service jboss.data-source.java:/tiranDS] 

Although I'm sure that all that you said Mark is true, it seems like the problem before all this mentioned above is that I'm missing some dependencies in module.xml but I do not know wich.

2

There are 2 answers

0
Mark Rotteveel On

The org.firebirdsql.jdbc.FBDriver is not an xa-datasource-class. This element requires the name of the javax.sql.XADataSource implementation in Jaybird, not the java.sql.Driver implementation.

In Jaybird 2.2 and higher, the XADataSource implementation is org.firebirdsql.ds.FBXADataSource.

The XADataSource implementation in Jaybird 2.1.6 and earlier is org.firebirdsql.pool.FBConnectionPoolDataSource (see also http://web.firebirdsql.org/devel/doc/jaybird/pdf/jaybird_manual.pdf ); this class was deprecated in Jaybird 2.2 and removed in Jaybird 3.

As far as I know JBoss actually includes an example to use Firebird. (but that might have been an earlier version).

BTW: When using from an application server you should not use the jaybird-full-2.1.6.jar file, but jaybird-2.1.6.jar (as the former includes some (older) JavaEE interfaces that are already included in JBoss)

1
Rico Metzger On

Perhaps a little late, the point is simply that Firebird is not really JDBC 4 so you have to add the driver class yourself to the configuration like this:

<driver name="firebirdsql" module="org.firebirdsql">
  <driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>
  <xa-datasource-class>org.firebirdsql.pool.FBConnectionPoolDataSource</xa-datasource-class>
</driver>

That should solve your problem