Subject jboss+jaybird: Problem getting connection: javax.resource.ResourceException: Failure to delist resource
Author Jens Viebig
I'm using jboss 3.2.6, jaybird 1.5.4, firebird 1.0.x with jrockit jvm

My (Web-)Application is running fine for some time (some hours) and then the
database driver dies with the following exception.I have to restart the
server to get it back running.
The App worked fine with interclient Driver and jboss 3.0.8.

I really like to go to jboss 3.2.6+jaybird because of performance issues but
it has to run stable. For now I switched back to Interclient which is old but works stable.

Here is the Stack Trace:
--------------------------------------------------
Problem getting connection: javax.resource.ResourceException: Failure to
delist resource
at
com.como.ejb.AccessSecurityBean.hasReadAccess(Ljava.lang.String;Ljava.lang.String;)Z(Unknown
Source)
at
jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)
at
jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)
at
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)
at
java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown
Source)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(StatelessSessionContainer.java:683)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(CachedConnectionInterceptor.java:186)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(StatelessSessionInstanceInterceptor.java:72)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Lorg.jboss.invocation.Invocation;Z)Ljava.lang.Object;(AbstractTxInterceptor.java:84)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(Optimized
Method)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TxInterceptorCMT.java:148)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(SecurityInterceptor.java:111)
at
org.jboss.ejb.plugins.LogInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(LogInterceptor.java:191)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(ProxyFactoryFinderInterceptor.java:122)
at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(StatelessSessionContainer.java:331)
at
org.jboss.ejb.Container.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(Optimized
Method)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(Ljava.lang.Object;Ljava.lang.reflect.Method;[Ljava.lang.Object;)Ljava.lang.Object;(BaseLocalProxyFactory.java:419)
at
org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(Ljava.lang.Object;Ljava.lang.reflect.Method;[Ljava.lang.Object;)Ljava.lang.Object;(StatelessSessionProxy.java:83)
...
org.firebirdsql.jdbc.FBSQLException: Problem getting connection:
javax.resource.ResourceException: Failure to delist resource
at
org.firebirdsql.jdbc.FBDataSource.getConnection()Ljava.sql.Connection;(FBDataSource.java:88)
--------------------------------------------------

What does this error message mean ?

Here is the code that tried to get the connection its a function inside a
Stateless SessionBean:

--------------------------------------------------

public int myfunction()
{
int count = 0;
Connection connect = null;
PreparedStatement sqlPrep = null;
try
{
InitialContext ic = new InitialContext();
javax.sql.DataSource source = (javax.sql.DataSource)
ic.lookup("java:/MyDS");
connect = source.getConnection();
sqlPrep =
connect.prepareStatement("SELECT SOMEFILED FROM SOMETABLE WHERE
SOMETHING = ?");
sqlPrep.setString(1,something);
ResultSet result = sqlPrep.executeQuery();
if (result.next())
{
count = result.getInt("SOMEFIELD");
}
return count;
}
catch (Exception e)
{
throw new EJBException(e);
}
finally
{
try
{
if (sqlPrep != null)
sqlPrep.close();
}
catch (Exception e) {}
try
{
if (connect != null)
connect.close();
}
catch (Exception e) {}
}
}

--------------------------------------------------

Is there something wrong with my code ?

--------- This is my driver configuration ------
<?xml version="1.0" encoding="UTF-8"?>

<!--
==================================================================== -->
<!-- New ConnectionManager setup for firebird dbs using jca-jdbc xa
driver-->
<!-- Build jmx-api (build/build.sh all) and view for config
documentation -->
<!--
==================================================================== -->

<connection-factories>

<!--FBManager can be used to create and drop databases.
Drop is especially useful during testing, since it
assures a clean start next time. -->
<mbean code="org.firebirdsql.management.FBManager"
name="jboss.jca:service=FirebirdManager">
<attribute
name="FileName">/var/opt/firebird/contentatdisk.gdb</attribute>
<attribute name="UserName">SYSDBA</attribute>
<attribute name="Password">masterkey</attribute>
<attribute name="CreateOnStart">false</attribute>
<attribute name="DropOnStop">false</attribute>
</mbean>

<tx-connection-factory>

<jndi-name>MyDS</jndi-name>

<xa-transaction/>

<adapter-display-name>Firebird Database Connector</adapter-display-name>

<config-property name="Database"
type="java.lang.String">127.0.0.1/3050:/var/opt/firebird/mydb.gdb</config-property>

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

<password>masterkey</password>

<!--additional properties. only use one way of setting tx isolation,
please
<config-property name="TransactionIsolation"></config-property>
<config-property
name="TransactionIsolationName">TRANSACTION_READ_COMMITTED</config-property>
<config-property name="BlobBufferLength"></config-property>
<config-property name="Encoding">UNICODE_FSS</config-property>
-->

<min-pool-size>0</min-pool-size>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->

<!-- sql to call on an existing pooled connection when it is
obtained from pool
<check-valid-connection-sql>some arbitrary
sql</check-valid-connection-sql>
-->

</tx-connection-factory>

</connection-factories>




[Non-text portions of this message have been removed]