1 Reply Latest reply on Aug 29, 2002 5:10 AM by Dominique Plante

    Can't Find Data Source

    Ed Brown Newbie

      My CMP entity bean uses MySQL. When it is deployed, I get an error stating that MySQL is not bound. I see instances of the MySQL service.

      I got the following mysql-service.xml from sourceforge:

      <!-- Include a login module configuration named MySqlDbRealm.
      Update your login-conf.xml, here is an example for a

      <application-policy name = "MySqlDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal"></module-option>
      <module-option name = "userName"></module-option>
      <module-option name = "password"></module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>


      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      <!--uncomment out this line if you are using the MySqlDbRealm above

      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost/EDS_DB</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String"></config-property>
      <config-property name="Password" type="java.lang.String"></config-property>

      <!--Below here are advanced properties -->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper

      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->

      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports

      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

      <!--make the rar deploy! hack till better deployment-->


      jbosscmp-jdbc.xml is as follows:







      The exception is as follows:

      org.jboss.deployment.DeploymentException: Error: can't find data source: java:/MySqlDS; - nested throwable: (javax.naming.NameNotFoundException: MySqlDS not bou
      nd) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:99)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManag


      javax.naming.NameNotFoundException: MySqlDS not bound


      Since I'm using EJBs, it's all in the same VM. Does anyone have any idea what is going wrong?

        • 1. Re: Can't Find Data Source
          Dominique Plante Newbie

          Not sure if you have solved the problem or not, but here's my suggestion from a little bit of experimenting....

          It looks like the version of mysql-service.xml you are showing is for JBoss v 3.0.2. I compared a MySQL data source service that worked in v3.0.0 and the main diference was with this line:

          <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

          towards the bottom. In a v3.0.0 things work well when it reads:
          <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager

          Hope this helps!