5 Replies Latest reply on Nov 26, 2003 1:56 AM by pvamstel

    Jboss mySQL deployment issues

    el_pinjo

      Hi,

      I tried to setup a datasource to mySQL, deployed a bean which should make use of the mySQL datasource.
      But instead of making use of the mySQL datasource it tries to use the defaultDS datasource.

      I'm using jboss 3.0.8 on win2k.

      My datasource config is as follows:

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

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->




      <!-- attribute name="SecurityDomainJndiName">MySqlDbRealm</attribute-->

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


      PeopleAdminDS



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/peopleadmin</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">root</config-property>
      <config-property name="Password" type="java.lang.String"></config-property>
      <!-- -->




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




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


      0
      50
      5000
      15
      <!--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
      reauthentication)-->
      ByContainer



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

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

      java:/TransactionManager
      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer




      =====================================

      My deployment descriptor:

      <![CDATA[The Entity bean represents a Person with BMP]]>
      <display-name>Person bean</display-name>

      <ejb-name>peopleadmin/Person</ejb-name>

      net.heuveling.peopleadmin.ejb.PersonHome
      net.heuveling.peopleadmin.ejb.Person

      <ejb-class>net.heuveling.peopleadmin.ejb.PersonBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False

      <resource-ref>
      <res-ref-name>jdbc/PeopleAdminDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>



      ======================================

      I do the datasource lookup as follows:
      DataSource my_datasource = (DataSource) my_context.lookup(
      "java:comp/env/jdbc/PeopleAdminDS");