Thanks Tim!

I appreciate your help.   Here is what my jboss.jcml JDBC section now looks
like, after following your suggestion.

<!-- JDBC -->
 <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=mySQLDB">
   <attribute name="DataSourceClass">
org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
   <attribute name="PoolName">mySQLDS</attribute>
   <attribute name="URL">jdbc:mysql://165.121.243.05/test</attribute>
   <attribute name="JDBCUser" />
   <attribute name="Password" />
   </mbean>

The problem is that when I start JBOSS now, it hangs when the following
appears on the log....

[InstantDB] Starting
[InstantDB] XA Connection pool InstantDB bound to java:/InstantDB

Is there somewhere besides jboss.jcml that I must look?
my CMP beans continue to work but my BMP bean test is now giving the
following message...

[ShipBean] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
       javax.ejb.EJBException
[ShipBean] javax.naming.NameNotFoundException: jdbc not bound
[ShipBean]      at
org.jnp.server.NamingServer.getBinding(NamingServer.java:474)
[ShipBean]      at
org.jnp.server.NamingServer.getBinding(NamingServer.java:482)
[ShipBean]      at
org.jnp.server.NamingServer.getObject(NamingServer.java:488)
[ShipBean]      at org.jnp.server.NamingServer.lookup(NamingServer.java:254)
[ShipBean]      at org.jnp.server.NamingServer.lookup(NamingServer.java:257)

I must still be missing something.  Here is the java code that I am using

Connection con = null;
       PreparedStatement ps = null;
       try {
         con = this.getConnection();
         ps = con.prepareStatement(
          "insert into Ship (id, name, capacity, tonnage) " +
          "values (?,?,?,?)");
         ps.setInt(1, id);
         ps.setString(2, name);
         ps.setInt(3, capacity);
         ps.setDouble(4, tonnage);
.......
// here is the connection method....maybe the problem is here....
private Connection getConnection() throws SQLException {
     try {
       Context jndiCntx = new InitialContext();
       DataSource ds =
           (DataSource)jndiCntx.lookup("java:comp/env/jdbc/mySQLDB");
       return ds.getConnection();
     }
     catch (NamingException ne) {
       throw new EJBException(ne);
     }
   }

Thanks again for your help!

Reply via email to