3 Replies Latest reply on May 14, 2003 4:34 AM by agnelo

    Step for defining a new datasource

    agnelo Newbie

      Hello Friends

      I am new to JBoss and have difficulty setting up a JDBC datasource for my BMP that I have developed. I have installed and running MySql as a service under windows 2000.
      I would appreciate if some body can mention the steps required to do this. I have copied the mysql-ds.xml from the examples/jca directory and made the necessary changes, but I guess that is not the only thing required.

      Please help

      Thanks
      Agnelo

        • 1. Re: Step for defining a new datasource
          Jon Barnett Master

          Did you put the JDBC driver for the database into the JBoss instance library? For example, if you are running the default instance, the library directory would be server/default/lib of your JBoss distribution. The JDBC driver file would be something like mysql-connector-java-3.0.7-stable-bin.jar, depending on your MySQL version.

          Is there any other problem you are experiencing? If so, provide logs of the error.

          • 2. Re: Step for defining a new datasource
            agnelo Newbie

            OK, below is the server error log. It gives a JNDI name not found exception


            15:49:34,738 ERROR [STDERR] Could not find datasource
            15:49:34,738 ERROR [STDERR] javax.naming.NameNotFoundException: MySqlDS not boun
            d
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
            Server.java:495)
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
            Server.java:503)
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingS
            erver.java:509)
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:282)
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:256)
            15:49:34,738 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:256)
            15:49:34,738 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:492)
            15:49:34,738 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:606)
            15:49:34,748 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:471)
            15:49:34,748 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialCon
            text.java:350)
            15:49:34,748 ERROR [STDERR] at AccountBean.getConnection(AccountBean.java:11
            4)
            15:49:34,748 ERROR [STDERR] at AccountBean.ejbHomeGetTotalBankValue(AccountB
            ean.java:78)
            15:49:34,748 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterc
            eptor.invokeHome(EntityContainer.java:1009)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationIn
            terceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
            15:49:34,748 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
            nnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.inv
            okeHome(AbstractInterceptor.java:88)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceIntercept
            or.invokeHome(EntityInstanceInterceptor.java:91)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.i
            nvokeHome(EntityLockInterceptor.java:61)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationIntercept
            or.invokeHome(EntityCreationInterceptor.java:28)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
            nvokeNext(AbstractTxInterceptor.java:88)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
            hTransactions(TxInterceptorCMT.java:243)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
            Home(TxInterceptorCMT.java:74)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
            okeHome(SecurityInterceptor.java:92)
            15:49:34,748 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
            me(LogInterceptor.java:120)
            15:49:34,758 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
            ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            15:49:34,758 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeH
            ome(EntityContainer.java:477)
            15:49:34,758 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
            :694)
            15:49:34,758 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,758 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
            her.invoke(ReflectedMBeanDispatcher.java:284)
            15:49:34,758 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
            eanServerImpl.java:549)
            15:49:34,758 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.
            invoke(JRMPInvoker.java:359)
            15:49:34,758 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,758 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(Unic
            astServerRef.java:241)
            15:49:34,758 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.j
            ava:152)
            15:49:34,758 ERROR [STDERR] at java.security.AccessController.doPrivileged(N
            ative Method)
            15:49:34,758 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Trans
            port.java:148)
            15:49:34,758 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMess
            ages(TCPTransport.java:465)
            15:49:34,758 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$Connection
            Handler.run(TCPTransport.java:706)
            15:49:34,758 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)
            15:49:34,758 ERROR [STDERR] javax.naming.NameNotFoundException: MySqlDS not boun
            d
            15:49:34,758 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
            Server.java:495)
            15:49:34,768 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
            Server.java:503)
            15:49:34,768 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingS
            erver.java:509)
            15:49:34,768 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:282)
            15:49:34,768 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:256)
            15:49:34,768 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
            er.java:256)
            15:49:34,768 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:492)
            15:49:34,768 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:606)
            15:49:34,768 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
            gContext.java:471)
            15:49:34,768 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialCon
            text.java:350)
            15:49:34,768 ERROR [STDERR] at AccountBean.getConnection(AccountBean.java:11
            4)
            15:49:34,768 ERROR [STDERR] at AccountBean.ejbHomeGetTotalBankValue(AccountB
            ean.java:78)
            15:49:34,768 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,768 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterc
            eptor.invokeHome(EntityContainer.java:1009)
            15:49:34,768 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationIn
            terceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
            15:49:34,768 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
            nnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
            15:49:34,768 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.inv
            okeHome(AbstractInterceptor.java:88)
            15:49:34,768 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceIntercept
            or.invokeHome(EntityInstanceInterceptor.java:91)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.i
            nvokeHome(EntityLockInterceptor.java:61)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationIntercept
            or.invokeHome(EntityCreationInterceptor.java:28)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
            nvokeNext(AbstractTxInterceptor.java:88)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
            hTransactions(TxInterceptorCMT.java:243)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
            Home(TxInterceptorCMT.java:74)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
            okeHome(SecurityInterceptor.java:92)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
            me(LogInterceptor.java:120)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
            ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeH
            ome(EntityContainer.java:477)
            15:49:34,778 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
            :694)
            15:49:34,778 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,778 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
            her.invoke(ReflectedMBeanDispatcher.java:284)
            15:49:34,778 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
            eanServerImpl.java:549)
            15:49:34,778 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.
            invoke(JRMPInvoker.java:359)
            15:49:34,778 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
            )
            15:49:34,778 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(Unic
            astServerRef.java:241)
            15:49:34,778 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.j
            ava:152)
            15:49:34,788 ERROR [STDERR] at java.security.AccessController.doPrivileged(N
            ative Method)
            15:49:34,788 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Trans
            port.java:148)
            15:49:34,788 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMess
            ages(TCPTransport.java:465)
            15:49:34,788 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$Connection
            Handler.run(TCPTransport.java:706)
            15:49:34,788 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

            • 3. Re: Step for defining a new datasource
              agnelo Newbie

              OK, I solved it. There was a mistake in the ejb-jar.xml file. it has been rectified now. But now it complains of the table not be available, when it is actually there..