Hi everybody,

there were quite a lot of mails about how to access a datasource from a
connection pool, but I am still unable to make it work. I use jboss2.1 and
Interbase together with Interclient2. I made these entries in jboss.jcml:

  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=InterBaseDB">
    <attribute name="PoolName">InterBaseDB</attribute>
    <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
l</attribute>
    <attribute name="Properties"></attribute>
    <attribute
name="URL">jdbc:interbase://localhost/e:/daten/datenbanken/betx.gdb</attribu
te>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">jboss</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">true</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
  </mbean>

 and get the following log-entry:

[InterBaseDB] XA Connection pool InterBaseDB bound to java:/InterBaseDB

Next I included the following lines in the jboss.xml from my project:

    <resource-managers>
      <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
        <res-name>IBResource</res-name>
        <res-jndi-name>InterBaseDB</res-jndi-name>
      </resource-manager>
....
        <session>
        <ejb-name>BetXBean</ejb-name>
        <jndi-name>betx/BetX</jndi-name>
        <configuration-name></configuration-name>
            <resource-ref>
              <res-ref-name>jdbc/InterBase</res-ref-name>
              <resource-name>IBResource</resource-name>
            </resource-ref>
        </session>

and in my session-beanI use the following code:

          InitialContext ctx = new InitialContext();
          System.out.println("Got context");

          DataSource ds =
(DataSource)ctx.lookup("java:comp/env/jdbc/InterBase");
          System.out.println("Got datasource");
          con = ds.getConnection();
          System.out.println("Got connection");

but when I execute it I get the following log-entries:

[InterBaseDB] Resource
'org.opentools.minerva.jdbc.xa.wrapper.XAResourceImpl@417b953d' enlisted for
'org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@46a0553d'.
[InterBaseDB] Pool InterBaseDB [1/1/10] gave out pooled object:
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@46a0553d
[BetXBean] Got context
[BetXBean] java.lang.ClassCastException:
org.opentools.minerva.jdbc.xa.XAPoolDataSource
[InterBaseDB] Pool InterBaseDB [0/1/10] returned object
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@46a0553d to the pool.

I am not an java-expert and I don't now anymore what more to try. Does
somebody recognise what I am doing wrong...

thanks a lot
Hajo



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to