Problem accessing a database from a bmp using JBoss 2.4.4
heitzeg Jul 16, 2002 2:33 AMI'm trying to access a table in MySQL from a BMP, but so far, I can't
quite figure out what I'm doing wrong.
I've replaced the default database configuration in jboss.jcml with
==================================================================== -->
<!-- MYSQL ============================================ -->
<mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
<attribute name="Drivers">org.gjt.mm.mysql.Driver</attribute>
</mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=SavingsAccountDB">
<attribute
name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</a
ttribute>
<attribute name="PoolName">SavingsAccountDB</attribute>
<attribute name="URL">jdbc:mysql://localhost/J2EETestDB</attribute>
<attribute name="">username</attribute>
<attribute name="">password</attribute>
</mbean>
<!-- End MYSQL ============================================ -->
It seems to startup fine with the following:
[INFO,JdbcProvider] Starting
[INFO,JdbcProvider] Started
[INFO,SavingsAccountDB] Starting
[INFO,SavingsAccountDB] XA Connection pool SavingsAccountDB bound to java:/SavingsAccountDB
[INFO,SavingsAccountDB] Started
Then I deploy my EJB with the following ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>Savings Account</description>
<display-name>Savings Account</display-name>
<enterprise-beans>
<entity>
<ejb-name>SavingsAccount</ejb-name>
<home>savingsaccount2.SavingsAccountHome</home>
<remote>savingsaccount2.SavingsAccount</remote>
<ejb-class>savingsaccount2.SavingsAccountBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<resource-ref>
<res-ref-name>jdbc/SavingsAccountDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
</ejb-jar>
unfortunately, when the ejb is deployed, I get the following warning:
[WARN,EntityContainer] No resource manager found for
jdbc/SavingsAccountDB
When I try to run the client, I eventually get the following error:
[ERROR,SavingsAccount] TRANSACTION ROLLBACK EXCEPTION:
javax.transaction.TransactionRolledbackException: Unable to connect to database.
jdbc not bound; nested exception is:
javax.ejb.EJBException: Unable to connect to database. jdbc not bound at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.ja
va:166)
Can someone please point me in the right direction.
Thanks alot!