4 Replies Latest reply on Jan 2, 2002 7:56 PM by Denis St Flour

    Error: can't find data source CMP

    Denis St Flour Newbie

      I am trying to deploy an appliation using CMP with jboss-3.0.0alpha using MSSQL 7. The exception included below occurs on deployment. The datasource name being jsoccer and its definition is also included below. Help !!


      <?xml version="1.0" encoding="UTF-8"?>

      <!-- =====================================================================-->
      <!-- mssqlds-service.xml -->
      <!-- JBoss v3.0alpha (november 23, 2001) ATINAV thin driver Configuration
      -->
      <!-- ====================================================================
      -->
      <!-- -->
      <!-- -->
      <!-- =====================================================================
      -->




      <!-- ====================================================================
      -->
      <!-- JDBC - Initialize the databases -->
      <!-- to ConnectionFactoryLoader -->
      <!-- ====================================================================
      -->


      ConnectionURL=jdbc:AvenirDriver://localhost:1433/dbname;uid=username;pwd=password
      DriverClass=net.avenir.jdbc2.Driver

      jsoccer
      java:/TransactionManager
      <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva
      JDBC LocalTransaction ResourceAdapter</mbean-ref>
      <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
      #
      #Wed Aug 15 16:17:29 EDT 2001
      BlockingTimeoutMillis=50000
      IdleTimeoutMinutes=30
      MaxSize=10
      CleanupIntervalMinutes=10
      MinSize=0
      MaxIdleTimeoutPercent=1.0


      org.jboss.resource.security.ManyToOnePrincipalMapping

      userName=username
      password=password




      ************************************************************************



      org.jboss.ejb.DeploymentException: Error: can't find data source: jsoccer
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.init(JDBCStoreManag
      .java:113)
      at org.jboss.ejb.plugins.CMPPersistenceManager.init(CMPPersistenceMana
      r.java:141)
      at org.jboss.ejb.EntityContainer.init(EntityContainer.java:313)
      at org.jboss.ejb.Application.start(Application.java:201)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      23)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:46

      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.jav
      444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      23)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Unknown Source)
      [17:37:07,301,J2eeDeployer#Default] Starting soccer.ear failed!
      javax.management.RuntimeMBeanException: RuntimeException thrown in operation d
      loy
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      40)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      23)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:46

      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.jav
      444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
      23)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Unknown Source)
      [17:37:07,362,J2eeDeployer#Default] Module soccer.ear is not running
      [17:37:07,372,J2eeDeployer#Default] Destroying application soccer.ear
      [17:37:07,382,J2eeDeployer#Default] Destroyed
      [17:37:07,382,AutoDeployer] Deployment failed:file:/C:/JavaPrograms/jboss-3.0.
      lpha/deploy/soccer.ear

        • 1. Re: Error: can't find data source CMP
          Armin Newbie

          First, you need to make sure that the datasource was created properly. Check your log file. Or, http://hostname:8082 and go to JNDIView and hit the list button. This will show you if the ds was mapped to JNDI. Lastly, your cmp descriptor should declare the ds name in the form java:/dsname

          • 2. Re: Error: can't find data source CMP
            Denis St Flour Newbie

            I have followed the procedure that was outlined in your reply. The list does not show the data source name under JNDI view. The question is where is the ds to JNDI mapping defined. Is that done through a properties file.

            • 3. Re: Error: can't find data source CMP
              David Jencks Master

              The ConnectionFactory is bound into jndi in the java: namespace under the value specified in the jndi-name attribute in your ConnectionFactoryLoader mbean configuration. You can map it locally for your ejb's in their private namespace in one of the dd's, I think ejb-jar.xml (could be one of the jboss ones, I can't remember)

              If it's not showing up in jndiview, look at the server log to find out what went wrong when it tried to start.

              • 4. Re: Error: can't find data source CMP
                Denis St Flour Newbie

                I have found the source of the problem. Thanks for your responses. I was using the wrong tag in mssqlds-service.xml. In 3.o beta the depends optional-attribute-name tag must be substitited with mbean-ref name. The file should be as follows

                <?xml version="1.0" encoding="UTF-8"?>

                <!-- =====================================================================-->
                <!-- mssqlds-service.xml -->
                <!-- JBoss v3.0alpha (november 23, 2001) ATINAV thin driver Configuration
                -->
                <!-- tested against MS SQL 2000 -->
                <!-- ====================================================================
                -->
                <!-- -->
                <!-- please put jdbc driver (in this case TaveConn25C.jar) under
                jboss_home/lib/ext -->
                <!-- please put this file (mssqlds-service.xml) under jboss_home/deploy
                -->
                <!-- -->
                <!-- =====================================================================
                -->




                <!-- ====================================================================
                -->
                <!-- JDBC - Initialize the databases -->
                <!-- to ConnectionFactoryLoader -->
                <!-- ====================================================================
                -->


                ConnectionURL=jdbc:AvenirDriver://localhost:1433/soccer;uid=username;pwd=password
                DriverClass=net.avenir.jdbc2.Driver

                SoccerDS
                java:/TransactionManager

                <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
                <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
                #
                #Wed Aug 15 16:17:29 EDT 2001
                MinSize=0
                MaxSize=10
                BlockingTimeoutMillis=5000
                IdleTimeoutMinutes=30
                CleanupIntervalMinutes=10
                MaxIdleTimeoutPercent=1.0




                org.jboss.resource.security.ManyToOnePrincipalMapping

                userName=username
                password=password