3 Replies Latest reply on Apr 19, 2002 3:32 AM by ionel

    jdbc can't bind to jndi

      Hi,

      I'm trying to test a CMP2 ejb but when i start the client, i get the following error in the jboss server :


      16:53:57,341 ERROR [JRMPInvoker] operation failed
      javax.ejb.FinderException: Find failed: java.sql.SQLException: Table not found: PERSONNE in statement [SELECT DISTINCT t1_p.IdPersonne FROM Personne t1_p WHERE t1_p.Nom = 'gardais']
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:144)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:395)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:318)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:634)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1051)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:222)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:136)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:80)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:469)
      at org.jboss.ejb.Container.invoke(Container.java:682)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:364)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:152)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
      at java.lang.Thread.run(Thread.java:484)


      I think it is because the bean can't find the datasource name.
      actually, when i deploy the mysql-service.xml file, there is no infos displayed in the server window such as "bound connection to JNDI name java:/BaseTestDS" like when the Hypersonic database is set.

      here is the mysql-service.xml file i use

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- $Id: mysql-service-1.1.xml,v 1.1 2002/01/14 00:06:00 d_jencks Exp $ -->





      ConnectionURL=jdbc:mysql://localhost:3306/BaseTest
      DriverClass=org.gjt.mm.mysql.Driver
      UserName=gardais
      Password=ioio

      BaseTestDS
      java:/TransactionManager

      <mbean-ref name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
      <mbean-ref name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>


      BlockingTimeoutMillis=500000
      IdleTimeoutMinutes=30
      MaxSize=10
      CleanupIntervalMinutes=10
      MinSize=0
      MaxIdleTimeoutPercent=1.0


      org.jboss.resource.security.ManyToOnePrincipalMapping


      UserName=gardais
      <!--
      Password=ioio
      -->




      I have tried to change the ResourceAdapterName from JCA:service=RAR... to jboss.jca:service=RAR...
      and the following line too but nothing works either.

      I use the latest mm.mysql jdbc driver, i've also changed the classpath archive name to 2.0.11 to match the package name.

      As you may wonder, the Personne table exist in the BaseTest database. I also tryed to create an uppercase PERSONNE table but the error remains.

      when i change the jndi name of the datasource and i modifie the jbosscmp-jdbc.xml to match it, i get "can't find JNDI java:/BaseTestDS"

      why does the binding is not done ?

      Does anyone get the same problem ?

      thanks,
      ionel