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 the entries in
jboss.jcml 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>IBResoure</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>IBResoure</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");
//DataSource ds = (DataSource)ctx.lookup("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:
[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