7 Replies Latest reply on Apr 5, 2004 3:09 PM by Adrian Brock

    Problems with setting up Multiple Datasources

    sthomasg Newbie

      I am having trouble configuring multiple datasources in Jboss 3.2.3. An extensive search of the Jboss forums and google revealed no answers, although I did find postings for others with the same problem.

      I have 2 Seperate MySQL databases, plus I have left Jboss's DefaultDS links to Hypersonic untouched. (seems that some of the services are making use of it)
      (I also left the /conf/jbosscmp-jdbc.xm untouched)


      The first datasource is called Standalone
      res-ref-name = jdbc/Standalone, so this should map to java:comp/env/jdbc/Standalone in a client bean's context.
      This will map to a physical connection: java:/ITmysql
      as configured in ../deploy/mysql-local-ds.xml (see below)


      The second datasource is: CurlDS - several CMP beans are referencing this from
      my own jbosscmp-jdbc in the deployed jar. (see below)
      reference is : java:/CurlDS the physical connection is configured in
      ../deply/mysql-ds.xml (see below)

      the Mysql J/Connector driver .jar file is happy and living well in /lib


      my config:

      // ***************** Deployment Documents ***********************

      *** ejb-jar.xml******* (Fragment)

      <session>
       . ............
       ........................
       <resource-ref>
       <description>datastore containing contacts</description>
       <res-ref-name>jdbc/Standalone</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       <res-sharing-scope>Shareable</res-sharing-scope>
       </resource-ref>
      
       </session>



      **** jboss.xml******** (Fragment)
      <session>
       ......
       .....
       <resource-ref>
       <res-ref-name>jdbc/Standalone</res-ref-name>
       <jndi-name>java:/ITmysql</jndi-name>
       </resource-ref>
       </session>




      here is where one of my cmp beans referenes the second DB....
      note that i removed the section.... (could this be the problem?)

      ***** jbosscmp-jdbc.xml ***** (Frament)
      <entity>
       <ejb-name>SequenceEJB</ejb-name>
       <datasource>java:/ITmysql</datasource>
       <datasource-mapping>mySQL</datasource-mapping>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <read-only>false</read-only>
       <table-name>KeySequence</table-name>
       .............
       .............




      ****************** End deployment Descriptors *********************

      ***************** Datasource Configs *******************************
      in jboss_home/......Server/myserver/deploy/

      I added:

      *** mysql-ds.xml**** for java:/CurlDS

      <datasources>
       <local-tx-datasource>
       <jndi-name>CurlDS</jndi-name>
       <connection-url>jdbc:mysql://192.168.18.23:3306/CML</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>mysql</user-name>
       <password>abc123</password>
      
       <!-- pooling -->
       <min-pool-size>0</min-pool-size>
       <max-pool-size>8</max-pool-size>
       <blocking-timeout-millis>4800</blocking-timeout-millis>
       <idle-timeout-minutes>8</idle-timeout-minutes>
       <!--
       <security-domain>CurlDbRealm</security-domain>
       -->
       </local-tx-datasource>
      
      </datasources>




      and *** mysql-local-ds.xml *** for java:/ITmysql

      <datasources>
       <local-tx-datasource>
       <jndi-name>ITmysql</jndi-name>
       <connection-url>jdbc:mysql://192.168.18.35:3306/CML</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>cado_usr</user-name>
       <password>MR-MC</password>
      
       <!-- pooling -->
       <min-pool-size>0</min-pool-size>
       <max-pool-size>8</max-pool-size>
       <blocking-timeout-millis>4800</blocking-timeout-millis>
       <idle-timeout-minutes>8</idle-timeout-minutes>
       <!--
       <security-domain>MySQLDbRealm</security-domain>
       -->
       </local-tx-datasource>
      
      </datasources>



      ********************** End DataSource Config ************************


      The Weird thing is ...my apps completely IGNORE these data sources!
      All attempts to find on a CMP, or hits to the datastore
      at a bean's environment (ex. To java:comp/env/jdbc/Standalone)...all hit the DefaultDS, instead of the datastores they are supposed to hit!


      For example: Here is a attempt to retrieve data via the
      java:comp/env/jdbc/Standalone datastore, in the Session bean outlined in my ejb-jar.xml fragment, above:

      2004-04-02 11:38:44,656 INFO [STDOUT] Contact Bean: SQL Exception
      2004-04-02 11:38:44,656 INFO [STDOUT] Table not found: ContactEntry in statement [Select conts.fname, conts.lname, conts.type, ce.*From 'ContactEntry' as ce, 'Contacts' as conts Where (conts.ckey = ce.contactkey) And (conts.customer_number = '033380') Order By ce.contactKey asc, ce.ckey asc]
      2004-04-02 11:38:44,656 ERROR [STDERR] java.sql.SQLException: Table not found: ContactEntry in statement [Select conts.fname, conts.lname, conts.type, ce.*From 'ContactEntry' as ce, 'Contacts' as conts Where (conts.ckey = ce.contactkey) And (conts.customer_number = '033380') Order By ce.contactKey asc, ce.ckey asc]
      2004-04-02 11:38:44,656 ERROR [STDERR] at org.hsqldb.Trace.getError(Unknown Source)
      2004-04-02 11:38:44,656 ERROR [STDERR] at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
      2004-04-02 11:38:44,656 ERROR [STDERR] at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
      2004-04-02 11:38:44,656 ERROR [STDERR] at org.hsqldb.jdbcConnection.execute(Unknown Source)
      2004-04-02 11:38:44,656 ERROR [STDERR] at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)



      The data hit goes to the Hsql database!!!



      And it gets WIERDER!:

      Take a look at that jboss.xml fragment again...
      then look at the results of the jndi-naming list function for that
      Session bean:


      +- env (class: org.jnp.interfaces.NamingContext)
       | +- jdbc (class: org.jnp.interfaces.NamingContext)
       | | +- Standalone[link -> java:/DefaultDS] (class: javax.naming.LinkRef)


      Standalone maps to java:/DefaultDS

      and NOT to java:/ITmysql, as specified in jboss.xml


      Does anyone know why this is? Do you see any obvious omissions in my XML docs?


      HELP! Or my company may force me to use <GASP!> .NET
      (sorry to use that nasty word)

      Thank you in advance for any help!

      Scott

        • 1. Re: Problems with setting up Multiple Datasources
          sthomasg Newbie

          the jbosscmp-jdbc.xml part was supposed to say:

          I removed the Section of jbosscmp-jdbc.xml.,

          that is, I am configuring my database's within each individual bean's tag in
          jbosscmp-jdbc.xm.


          sorry about that!

          Scott

          • 2. Re: Problems with setting up Multiple Datasources
            Adrian Brock Master

            Show the portion of the log where it says it deployed your datasources.

            Since you found jndi view, show where the datasources are bound.

            Regards,
            Adrian

            • 3. Re: Problems with setting up Multiple Datasources
              sthomasg Newbie

              Ok..thanks for looking at this!

              From the Server.log :

              2004-04-02 11:37:26,906 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/jboss/jboss-3.2.3/server/default/deploy/mysql-ds.xml
              2004-04-02 11:37:26,937 INFO [org.jboss.resource.connectionmanager.RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=CurlDS
              2004-04-02 11:37:26,937 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=CurlDS
              2004-04-02 11:37:26,937 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/jboss/jboss-3.2.3/server/default/deploy/mysql-ds.xml
              2004-04-02 11:37:26,937 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/jboss/jboss-3.2.3/server/default/deploy/mysql-local-ds.xml
              2004-04-02 11:37:27,062 INFO [org.jboss.resource.connectionmanager.RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=ITmysql
              2004-04-02 11:37:27,062 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=ITmysql
              2004-04-02 11:37:27,062 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/jboss/jboss-3.2.3/server/default/deploy/mysql-local-ds.xml




              .. *** Here is the Jaas stuff for Hsql and the jndi name binding for hsql
              2004-04-02 11:37:27,687 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.plugins.SecurityDomainContext@ef9f84 to map
              2004-04-02 11:37:27,703 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultDS'
              2004-04-02 11:37:27,703 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=DefaultDS



              **** Jndi bindings for the other datasources
              2004-04-02 11:37:28,218 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.CurlDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=CurlDS to JNDI name 'java:/CurlDS'
              2004-04-02 11:37:28,218 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=CurlDS
              2004-04-02 11:37:28,234 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.ITmysql] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=ITmysql to JNDI name 'java:/ITmysql'
              2004-04-02 11:37:28,234 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=ITmysql




              View from JndiView. List()

              here are the relevant parts from the Java: Namespace

              +- ITmysql (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
               +- CurlDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
               +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)



              Everything looks ok...



              • 4. Re: Problems with setting up Multiple Datasources
                Adrian Brock Master

                Yep, looks ok.

                Post your full ejb-jar.xml and jboss.xml. You probably have the tags in the wrong place.
                You might also try turning on dtd validation on the ejb deployer in conf/jboss-service.xml

                Regards,
                Adrian

                • 5. Re: Problems with setting up Multiple Datasources
                  sthomasg Newbie

                  Ok..


                  I have DTD validation and debugging turned on..everything seems ok. No DTD validation errors show in logs...


                  My Config xmls"

                  ****** ejb-jar.xml ******

                  <?xml version="1.0"?>
                  
                  <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                  
                  <ejb-jar>
                  <enterprise-beans>
                  
                   <entity>
                   <ejb-name>CustSalesEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSalesBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSales</abstract-schema-name>
                   <cmp-field><field-name>customerNumber</field-name></cmp-field>
                   <cmp-field><field-name>customerName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>upsCode</field-name></cmp-field>
                   <cmp-field><field-name>salesPerson</field-name></cmp-field>
                   <cmp-field><field-name>customerContact</field-name></cmp-field>
                   <cmp-field><field-name>customerPhone</field-name></cmp-field>
                   <cmp-field><field-name>apPerson</field-name></cmp-field>
                   <cmp-field><field-name>apNumber</field-name></cmp-field>
                   <cmp-field><field-name>custType</field-name></cmp-field>
                   <cmp-field><field-name>finChangeCode</field-name></cmp-field>
                   <cmp-field><field-name>statementCode</field-name></cmp-field>
                   <cmp-field><field-name>taxCode</field-name></cmp-field>
                   <cmp-field><field-name>creditLimit</field-name></cmp-field>
                   <cmp-field><field-name>arBalance</field-name></cmp-field>
                   <cmp-field><field-name>unallocatedCash</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentDate</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentAmount</field-name></cmp-field>
                   <cmp-field><field-name>lastBuyDate</field-name></cmp-field>
                   <cmp-field><field-name>openOrderAmount</field-name></cmp-field>
                   <cmp-field><field-name>highARBalance</field-name></cmp-field>
                   <cmp-field><field-name>messageCode1</field-name></cmp-field>
                   <cmp-field><field-name>messageCode2</field-name></cmp-field>
                   <cmp-field><field-name>mtdPayments</field-name></cmp-field>
                   <cmp-field><field-name>termsCode</field-name></cmp-field>
                   <cmp-field><field-name>sicCode</field-name></cmp-field>
                   <cmp-field><field-name>newCustomerSwitch</field-name></cmp-field>
                   <cmp-field><field-name>shipKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>customerNumber</primkey-field>
                   </entity>
                  
                  
                  
                   <entity>
                   <ejb-name>CustSoldEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSoldBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSold</abstract-schema-name>
                   <cmp-field><field-name>shipNumber</field-name></cmp-field>
                   <cmp-field><field-name>shipName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>priorYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>priorYearSales</field-name></cmp-field>
                   <cmp-field><field-name>priorYearCost</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearSales</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearCost</field-name></cmp-field>
                   <cmp-field><field-name>currentBalance</field-name></cmp-field>
                   <cmp-field><field-name>day30Balance</field-name></cmp-field>
                   <cmp-field><field-name>day60Balance</field-name></cmp-field>
                   <cmp-field><field-name>day90Balance</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidCurrentInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid30Day</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid60Day</field-name></cmp-field>
                   <cmp-field><field-name> totalPaid90Day</field-name></cmp-field>
                   <cmp-field><field-name>invoicesOutstanding</field-name></cmp-field>
                   <cmp-field><field-name>salesKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>shipNumber</primkey-field>
                   </entity>
                  
                  
                   <entity>
                   <!-- Key Server Entity -->
                   <ejb-name>SequenceEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.SequenceBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Sequence</abstract-schema-name>
                   <cmp-field><field-name>sequenceName</field-name></cmp-field>
                   <cmp-field><field-name>value</field-name></cmp-field>
                   <primkey-field>sequenceName</primkey-field>
                   </entity>
                  
                  
                  
                   <session>
                   <ejb-name>KeyServerEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.KeyServerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <env-entry>
                   <description>size of key cache for any given key. too large will waste keys!</description>
                   <env-entry-name>keyCacheBlockSize</env-entry-name>
                   <env-entry-type>java.lang.Integer</env-entry-type>
                   <env-entry-value>4</env-entry-value>
                   </env-entry>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/SequenceLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-link>SequenceEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- will change to internal priviledged id --> <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  
                  
                   <session>
                   <ejb-name>ContactsEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-class>com.spectrum.common.ejb.customer.ContactBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/KeyServerLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-link>KeyServerEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- will change to internal priviledged id -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   <resource-ref>
                   <description>datastore containing contacts</description>
                   <res-ref-name>jdbc/Standalone</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Container</res-auth>
                   <res-sharing-scope>Shareable</res-sharing-scope>
                   </resource-ref>
                  
                   </session>
                  
                  
                   <session>
                   <ejb-name>CustomerEJB</ejb-name>
                   <home>com.spectrum.core.ejb.customer.CustomerHome</home>
                   <remote>com.spectrum.core.ejb.customer.CustomerRemote</remote>
                   <local-home>com.spectrum.core.ejb.customer.CustomerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.customer.CustomerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.customer.CustomerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSalesLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-link>CustSalesEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSoldLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-link>CustSoldEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/ContactsLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-link>ContactsEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- will change to internal priviledged id --> <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  
                  </enterprise-beans>
                  
                  
                  <assembly-descriptor>
                   <!-- *************************** PERMISSIONS *********************************** -->
                  
                   <!-- ************** SECURITY ROLES ******************************** -->
                  
                   <!-- This one will go away soon -->
                   <security-role>
                   <description>
                   Open / No security
                   </description>
                   <role-name>everyone</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   Salesperson can READ most Customer info, Orders and Quotes, View Inventory
                   WRITES are more limited
                   </description>
                   <role-name>SalesPerson</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   SalesManager can READ all Customer info, Orders and Quotes, View Inventory
                   Has greater WRITE permissions on Customer, credit, orders, quotes, etc.
                   </description>
                   <role-name>SalesManager</role-name>
                   </security-role>
                  
                   <!-- ************** END SECURITY ROLES ***************************** -->
                  
                   <!-- ************** METHOD PERMISSIONS **************************** -->
                   <method-permission>
                   <role-name>SalesPerson</role-name>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getCustomerName</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getSalesSummary</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getContacts</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>createNewContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>deleteContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>modifyContact</method-name></method>
                   </method-permission>
                  
                   <method-permission>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getAccountSummary</method-name></method>
                   </method-permission>
                  
                   <!-- This one will go away soon -->
                   <method-permission>
                   <role-name>everyone</role-name>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   </method-permission>
                  
                  
                  <!-- ************************************ END PERMISSIONS ****************************** -->
                  
                  
                  <!-- *********************************** TRANSACTIONS ********************************** -->
                   <container-transaction>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   <trans-attribute>Supports</trans-attribute>
                   </container-transaction>
                  
                   <container-transaction>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>getNextKeyAfterIncrementingBy</method-name></method>
                   <trans-attribute>RequiresNew</trans-attribute>
                   </container-transaction>
                  
                  </assembly-descriptor>
                  
                  
                  </ejb-jar>
                  




                  ******* jboss.xml ****************

                  <?xml version="1.0"?>
                  
                  <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                  
                  <ejb-jar>
                  <enterprise-beans>
                  
                   <entity>
                   <ejb-name>CustSalesEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSalesBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSales</abstract-schema-name>
                   <cmp-field><field-name>customerNumber</field-name></cmp-field>
                   <cmp-field><field-name>customerName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>upsCode</field-name></cmp-field>
                   <cmp-field><field-name>salesPerson</field-name></cmp-field>
                   <cmp-field><field-name>customerContact</field-name></cmp-field>
                   <cmp-field><field-name>customerPhone</field-name></cmp-field>
                   <cmp-field><field-name>apPerson</field-name></cmp-field>
                   <cmp-field><field-name>apNumber</field-name></cmp-field>
                   <cmp-field><field-name>custType</field-name></cmp-field>
                   <cmp-field><field-name>finChangeCode</field-name></cmp-field>
                   <cmp-field><field-name>statementCode</field-name></cmp-field>
                   <cmp-field><field-name>taxCode</field-name></cmp-field>
                   <cmp-field><field-name>creditLimit</field-name></cmp-field>
                   <cmp-field><field-name>arBalance</field-name></cmp-field>
                   <cmp-field><field-name>unallocatedCash</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentDate</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentAmount</field-name></cmp-field>
                   <cmp-field><field-name>lastBuyDate</field-name></cmp-field>
                   <cmp-field><field-name>openOrderAmount</field-name></cmp-field>
                   <cmp-field><field-name>highARBalance</field-name></cmp-field>
                   <cmp-field><field-name>messageCode1</field-name></cmp-field>
                   <cmp-field><field-name>messageCode2</field-name></cmp-field>
                   <cmp-field><field-name>mtdPayments</field-name></cmp-field>
                   <cmp-field><field-name>termsCode</field-name></cmp-field>
                   <cmp-field><field-name>sicCode</field-name></cmp-field>
                   <cmp-field><field-name>newCustomerSwitch</field-name></cmp-field>
                   <cmp-field><field-name>shipKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>customerNumber</primkey-field>
                   </entity>
                  
                   <entity>
                   <ejb-name>CustSoldEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSoldBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSold</abstract-schema-name>
                   <cmp-field><field-name>shipNumber</field-name></cmp-field>
                   <cmp-field><field-name>shipName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>priorYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>priorYearSales</field-name></cmp-field>
                   <cmp-field><field-name>priorYearCost</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearSales</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearCost</field-name></cmp-field>
                   <cmp-field><field-name>currentBalance</field-name></cmp-field>
                   <cmp-field><field-name>day30Balance</field-name></cmp-field>
                   <cmp-field><field-name>day60Balance</field-name></cmp-field>
                   <cmp-field><field-name>day90Balance</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidCurrentInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid30Day</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid60Day</field-name></cmp-field>
                   <cmp-field><field-name> totalPaid90Day</field-name></cmp-field>
                   <cmp-field><field-name>invoicesOutstanding</field-name></cmp-field>
                   <cmp-field><field-name>salesKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>shipNumber</primkey-field>
                   </entity>
                  
                   <entity>
                   <!-- Key Server Entity -->
                   <ejb-name>SequenceEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.SequenceBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Sequence</abstract-schema-name>
                   <cmp-field><field-name>sequenceName</field-name></cmp-field>
                   <cmp-field><field-name>value</field-name></cmp-field>
                   <primkey-field>sequenceName</primkey-field>
                   </entity>
                  
                   <session>
                   <ejb-name>KeyServerEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.KeyServerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <env-entry>
                   <description>size of key cache for any given key. too large will waste keys!</description>
                   <env-entry-name>keyCacheBlockSize</env-entry-name>
                   <env-entry-type>java.lang.Integer</env-entry-type>
                   <env-entry-value>4</env-entry-value>
                   </env-entry>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/SequenceLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-link>SequenceEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  
                   <session>
                   <ejb-name>ContactsEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-class>com.spectrum.common.ejb.customer.ContactBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/KeyServerLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-link>KeyServerEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   <resource-ref>
                   <description>datastore containing contacts</description>
                   <res-ref-name>jdbc/Standalone</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Container</res-auth>
                   <res-sharing-scope>Shareable</res-sharing-scope>
                   </resource-ref>
                  
                   </session>
                  
                   <session>
                   <ejb-name>CustomerEJB</ejb-name>
                   <home>com.spectrum.core.ejb.customer.CustomerHome</home>
                   <remote>com.spectrum.core.ejb.customer.CustomerRemote</remote>
                   <local-home>com.spectrum.core.ejb.customer.CustomerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.customer.CustomerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.customer.CustomerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSalesLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-link>CustSalesEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSoldLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-link>CustSoldEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/ContactsLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-link>ContactsEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  </enterprise-beans>
                  
                  
                  <assembly-descriptor>
                   <!-- *************************** PERMISSIONS *********************************** -->
                  
                   <!-- ************** SECURITY ROLES ******************************** -->
                  
                   <!-- This one will go away soon -->
                   <security-role>
                   <description>
                   Open / No security
                   </description>
                   <role-name>everyone</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   Salesperson can READ most Customer info, Orders and Quotes, View Inventory
                   WRITES are more limited
                   </description>
                   <role-name>SalesPerson</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   SalesManager can READ all Customer info, Orders and Quotes, View Inventory
                   Has greater WRITE permissions on Customer, credit, orders, quotes, etc.
                   </description>
                   <role-name>SalesManager</role-name>
                   </security-role>
                  
                   <!-- ************** END SECURITY ROLES ***************************** -->
                  
                   <!-- ************** METHOD PERMISSIONS **************************** -->
                   <method-permission>
                   <role-name>SalesPerson</role-name>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getCustomerName</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getSalesSummary</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getContacts</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>createNewContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>deleteContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>modifyContact</method-name></method>
                   </method-permission>
                  
                   <method-permission>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getAccountSummary</method-name></method>
                   </method-permission>
                  
                   <!-- This one will go away soon -->
                   <method-permission>
                   <role-name>everyone</role-name>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   </method-permission>
                  
                  
                  <!-- ************************************ END PERMISSIONS ****************************** -->
                  
                  
                  <!-- *********************************** TRANSACTIONS ********************************** -->
                   <container-transaction>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   <trans-attribute>Supports</trans-attribute>
                   </container-transaction>
                  
                   <container-transaction>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>getNextKeyAfterIncrementingBy</method-name></method>
                   <trans-attribute>RequiresNew</trans-attribute>
                   </container-transaction>
                  
                  </assembly-descriptor>
                  
                  
                  </ejb-jar>
                  



                  and finally,
                  ************ jbosscmp-jdbc.xml ******************

                  <?xml version="1.0"?>
                  
                  <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                  
                  <ejb-jar>
                  <enterprise-beans>
                  
                   <entity>
                   <ejb-name>CustSalesEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSalesBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSales</abstract-schema-name>
                   <cmp-field><field-name>customerNumber</field-name></cmp-field>
                   <cmp-field><field-name>customerName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>upsCode</field-name></cmp-field>
                   <cmp-field><field-name>salesPerson</field-name></cmp-field>
                   <cmp-field><field-name>customerContact</field-name></cmp-field>
                   <cmp-field><field-name>customerPhone</field-name></cmp-field>
                   <cmp-field><field-name>apPerson</field-name></cmp-field>
                   <cmp-field><field-name>apNumber</field-name></cmp-field>
                   <cmp-field><field-name>custType</field-name></cmp-field>
                   <cmp-field><field-name>finChangeCode</field-name></cmp-field>
                   <cmp-field><field-name>statementCode</field-name></cmp-field>
                   <cmp-field><field-name>taxCode</field-name></cmp-field>
                   <cmp-field><field-name>creditLimit</field-name></cmp-field>
                   <cmp-field><field-name>arBalance</field-name></cmp-field>
                   <cmp-field><field-name>unallocatedCash</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentDate</field-name></cmp-field>
                   <cmp-field><field-name>lastPaymentAmount</field-name></cmp-field>
                   <cmp-field><field-name>lastBuyDate</field-name></cmp-field>
                   <cmp-field><field-name>openOrderAmount</field-name></cmp-field>
                   <cmp-field><field-name>highARBalance</field-name></cmp-field>
                   <cmp-field><field-name>messageCode1</field-name></cmp-field>
                   <cmp-field><field-name>messageCode2</field-name></cmp-field>
                   <cmp-field><field-name>mtdPayments</field-name></cmp-field>
                   <cmp-field><field-name>termsCode</field-name></cmp-field>
                   <cmp-field><field-name>sicCode</field-name></cmp-field>
                   <cmp-field><field-name>newCustomerSwitch</field-name></cmp-field>
                   <cmp-field><field-name>shipKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>customerNumber</primkey-field>
                   </entity>
                  
                   <entity>
                   <ejb-name>CustSoldEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-class>com.spectrum.cml.ejb.customer.CustSoldBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>CustSold</abstract-schema-name>
                   <cmp-field><field-name>shipNumber</field-name></cmp-field>
                   <cmp-field><field-name>shipName</field-name></cmp-field>
                   <cmp-field><field-name>address1</field-name></cmp-field>
                   <cmp-field><field-name>address2</field-name></cmp-field>
                   <cmp-field><field-name>address3</field-name></cmp-field>
                   <cmp-field><field-name>address4</field-name></cmp-field>
                   <cmp-field><field-name>postalCode</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>monthToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateQuantity</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateSales</field-name></cmp-field>
                   <cmp-field><field-name>yearToDateCost</field-name></cmp-field>
                   <cmp-field><field-name>priorYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>priorYearSales</field-name></cmp-field>
                   <cmp-field><field-name>priorYearCost</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearQuantity</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearSales</field-name></cmp-field>
                   <cmp-field><field-name>prior2ndYearCost</field-name></cmp-field>
                   <cmp-field><field-name>currentBalance</field-name></cmp-field>
                   <cmp-field><field-name>day30Balance</field-name></cmp-field>
                   <cmp-field><field-name>day60Balance</field-name></cmp-field>
                   <cmp-field><field-name>day90Balance</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaidCurrentInvoices</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid30Day</field-name></cmp-field>
                   <cmp-field><field-name>totalPaid60Day</field-name></cmp-field>
                   <cmp-field><field-name> totalPaid90Day</field-name></cmp-field>
                   <cmp-field><field-name>invoicesOutstanding</field-name></cmp-field>
                   <cmp-field><field-name>salesKey</field-name></cmp-field>
                   <cmp-field><field-name>recordType</field-name></cmp-field>
                   <primkey-field>shipNumber</primkey-field>
                   </entity>
                  
                   <entity>
                   <!-- Key Server Entity -->
                   <ejb-name>SequenceEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.SequenceBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Sequence</abstract-schema-name>
                   <cmp-field><field-name>sequenceName</field-name></cmp-field>
                   <cmp-field><field-name>value</field-name></cmp-field>
                   <primkey-field>sequenceName</primkey-field>
                   </entity>
                  
                   <session>
                   <ejb-name>KeyServerEJB</ejb-name>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.utils.KeyServerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <env-entry>
                   <description>size of key cache for any given key. too large will waste keys!</description>
                   <env-entry-name>keyCacheBlockSize</env-entry-name>
                   <env-entry-type>java.lang.Integer</env-entry-type>
                   <env-entry-value>4</env-entry-value>
                   </env-entry>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/SequenceLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.SequenceLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.SequenceLocal</local>
                   <ejb-link>SequenceEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  
                   <session>
                   <ejb-name>ContactsEJB</ejb-name>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-class>com.spectrum.common.ejb.customer.ContactBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/KeyServerLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.core.ejb.utils.KeyServerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.utils.KeyServerLocal</local>
                   <ejb-link>KeyServerEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   <resource-ref>
                   <description>datastore containing contacts</description>
                   <res-ref-name>jdbc/Standalone</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Container</res-auth>
                   <res-sharing-scope>Shareable</res-sharing-scope>
                   </resource-ref>
                  
                   </session>
                  
                   <session>
                   <ejb-name>CustomerEJB</ejb-name>
                   <home>com.spectrum.core.ejb.customer.CustomerHome</home>
                   <remote>com.spectrum.core.ejb.customer.CustomerRemote</remote>
                   <local-home>com.spectrum.core.ejb.customer.CustomerLocalHome</local-home>
                   <local>com.spectrum.core.ejb.customer.CustomerLocal</local>
                   <ejb-class>com.spectrum.core.ejb.customer.CustomerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSalesLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSalesLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSalesLocal</local>
                   <ejb-link>CustSalesEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/CustSoldLocalHome</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.CustSoldLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.CustSoldLocal</local>
                   <ejb-link>CustSoldEJB</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                   <ejb-ref-name>ejb/ContactsLocalHome</ejb-ref-name>
                   <ejb-ref-type>Session</ejb-ref-type>
                   <local-home>com.spectrum.common.ejb.customer.ContactsLocalHome</local-home>
                   <local>com.spectrum.common.ejb.customer.ContactsLocal</local>
                   <ejb-link>ContactsEJB</ejb-link>
                   </ejb-local-ref>
                   <!-- set to some other internal -->
                   <security-identity><run-as><role-name>everyone</role-name></run-as></security-identity>
                   </session>
                  </enterprise-beans>
                  
                  
                  <assembly-descriptor>
                   <!-- *************************** PERMISSIONS *********************************** -->
                  
                   <!-- ************** SECURITY ROLES ******************************** -->
                  
                   <!-- This one will go away soon -->
                   <security-role>
                   <description>
                   Open / No security
                   </description>
                   <role-name>everyone</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   Salesperson can READ most Customer info, Orders and Quotes, View Inventory
                   WRITES are more limited
                   </description>
                   <role-name>SalesPerson</role-name>
                   </security-role>
                   <security-role>
                   <description>
                   SalesManager can READ all Customer info, Orders and Quotes, View Inventory
                   Has greater WRITE permissions on Customer, credit, orders, quotes, etc.
                   </description>
                   <role-name>SalesManager</role-name>
                   </security-role>
                  
                   <!-- ************** END SECURITY ROLES ***************************** -->
                  
                   <!-- ************** METHOD PERMISSIONS **************************** -->
                   <method-permission>
                   <role-name>SalesPerson</role-name>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getCustomerName</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getSalesSummary</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setShippingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getContacts</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>createNewContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>deleteContact</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>modifyContact</method-name></method>
                   </method-permission>
                  
                   <method-permission>
                   <role-name>SalesManager</role-name>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>setBillingAddress</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>getAccountSummary</method-name></method>
                   </method-permission>
                  
                   <!-- This one will go away soon -->
                   <method-permission>
                   <role-name>everyone</role-name>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   </method-permission>
                  
                  
                  <!-- ************************************ END PERMISSIONS ****************************** -->
                  
                  
                  <!-- *********************************** TRANSACTIONS ********************************** -->
                   <container-transaction>
                   <method><ejb-name>CustSoldEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustSalesEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>CustomerEJB</ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>ContactsEJB </ejb-name><method-name>*</method-name></method>
                   <method><ejb-name>KeyServerEJB</ejb-name><method-name>*</method-name></method>
                   <trans-attribute>Supports</trans-attribute>
                   </container-transaction>
                  
                   <container-transaction>
                   <method><ejb-name>SequenceEJB</ejb-name><method-name>getNextKeyAfterIncrementingBy</method-name></method>
                   <trans-attribute>RequiresNew</trans-attribute>
                   </container-transaction>
                  
                  </assembly-descriptor>
                  
                  
                  </ejb-jar>
                  
                  


                  • 6. Re: Problems with setting up Multiple Datasources
                    sthomasg Newbie

                    ok, I'm really Not an idiot! Really! trust me!

                    I have no idea how I managed to post ejb-jar.xml 3 times in a row.....maybe when I previewed before posting.. lets try that again:


                    Jboss.xml:

                    <?xml version="1.0"?>
                    
                    <jboss>
                     <enterprise-beans>
                    
                     <entity>
                     <ejb-name>CustSoldEJB</ejb-name>
                     <local-jndi-name>ejb/CustSoldLocalHome</local-jndi-name>
                     </entity>
                    
                     <entity>
                     <ejb-name>CustSalesEJB</ejb-name>
                     <local-jndi-name>ejb/CustSalesLocalHome</local-jndi-name>
                     </entity>
                    
                     <entity>
                     <ejb-name>SequenceEJB</ejb-name>
                     <local-jndi-name>ejb/SequenceLocalHome</local-jndi-name>
                     </entity>
                    
                     <session>
                     <ejb-name>KeyServerEJB</ejb-name>
                     <local-jndi-name>ejb/KeyServerLocalHome</local-jndi-name>
                     <ejb-local-ref>
                     <ejb-ref-name>ejb/SequenceLocalHome</ejb-ref-name>
                     <local-jndi-name>ejb/SequenceLocalHome</local-jndi-name>
                     </ejb-local-ref>
                     </session>
                    
                    
                     <session>
                     <ejb-name>ContactsEJB</ejb-name>
                     <local-jndi-name>ejb/ContactsLocalHome</local-jndi-name>
                     <ejb-local-ref>
                     <ejb-ref-name>ejb/KeyServerLocalHome</ejb-ref-name>
                     <local-jndi-name>ejb/KeyServerLocalHome</local-jndi-name>
                     </ejb-local-ref>
                     <resource-ref>
                     <res-ref-name>jdbc/Standalone</res-ref-name>
                     <jndi-name>java:/ITmysql</jndi-name>
                     </resource-ref>
                     </session>
                    
                     <session>
                     <ejb-name>CustomerEJB</ejb-name>
                     <jndi-name>ejb/CustomerHome</jndi-name>
                     <local-jndi-name>ejb/CustomerLocalHome</local-jndi-name>
                     <ejb-local-ref>
                     <ejb-ref-name>ejb/CustSalesLocalHome</ejb-ref-name>
                     <local-jndi-name>ejb/CustSalesLocalHome</local-jndi-name>
                     </ejb-local-ref>
                     <ejb-local-ref>
                     <ejb-ref-name>ejb/CustSoldLocalHome</ejb-ref-name>
                     <local-jndi-name>ejb/CustSoldLocalHome</local-jndi-name>
                     </ejb-local-ref>
                     <ejb-local-ref>
                     <ejb-ref-name>ejb/ContactsLocalHome</ejb-ref-name>
                     <local-jndi-name>ejb/ContactsLocalHome</local-jndi-name>
                     </ejb-local-ref>
                     </session>
                    
                    
                    
                     </enterprise-beans>
                    </jboss>



                    jbosscmp-jdbc
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <!DOCTYPE jbosscmp-jdbc PUBLIC
                     "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
                     "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
                    
                    <jbosscmp-jdbc>
                    
                    <!--
                     <defaults>
                     <datasource>java:/jdbc/CurlDS</datasource>
                     <datasource-mapping>mySQL</datasource-mapping>
                     <create-table>false</create-table>
                     <remove-table>false</remove-table>
                     <read-only>false</read-only>
                     </defaults>
                    -->
                    
                     <enterprise-beans>
                     <entity>
                     <ejb-name>CustSalesEJB</ejb-name>
                     <datasource>java:/CurlDS</datasource>
                     <datasource-mapping>mySQL</datasource-mapping>
                     <create-table>false</create-table>
                     <remove-table>false</remove-table>
                     <read-only>false</read-only>
                     <table-name>CUST_SALES</table-name>
                     <cmp-field><field-name>customerNumber</field-name> <column-name>CUST_NUM</column-name></cmp-field>
                     <cmp-field><field-name>customerName</field-name> <column-name>CUST_NAME</column-name></cmp-field>
                     <cmp-field><field-name>address1</field-name> <column-name>CUST_ADDR1</column-name></cmp-field>
                     <cmp-field><field-name>address2</field-name> <column-name>CUST_ADDR2</column-name></cmp-field>
                     <cmp-field><field-name>address3</field-name> <column-name>CUST_ADDR3</column-name></cmp-field>
                     <cmp-field><field-name>address4</field-name> <column-name>CUST_ADDR4</column-name></cmp-field>
                     <cmp-field><field-name>postalCode</field-name> <column-name>CUST_POSTAL_CODE</column-name></cmp-field>
                     <cmp-field><field-name>upsCode</field-name> <column-name>UPS_CD</column-name></cmp-field>
                     <cmp-field><field-name>salesPerson</field-name> <column-name>SALES_PERSON</column-name></cmp-field>
                     <cmp-field><field-name>customerContact</field-name> <column-name>CUST_CONTACT</column-name></cmp-field>
                     <cmp-field><field-name>customerPhone</field-name> <column-name>CUST_PHONE</column-name></cmp-field>
                     <cmp-field><field-name>apPerson</field-name> <column-name>CUST_AP_PERSON</column-name></cmp-field>
                     <cmp-field><field-name>apNumber</field-name> <column-name>CUST_AP_NUMBER</column-name></cmp-field>
                     <cmp-field><field-name>custType</field-name> <column-name>CUST_TYPE</column-name></cmp-field>
                     <cmp-field><field-name>finChangeCode</field-name> <column-name>FIN_CHG_CD</column-name></cmp-field>
                     <cmp-field><field-name>statementCode</field-name> <column-name>STATEMENT_CD</column-name></cmp-field>
                     <cmp-field><field-name>taxCode</field-name> <column-name>TAX_CD</column-name></cmp-field>
                     <cmp-field><field-name>creditLimit</field-name> <column-name>CREDIT_LIMIT</column-name></cmp-field>
                     <cmp-field><field-name>arBalance</field-name> <column-name>AR_BALANCE</column-name></cmp-field>
                     <cmp-field><field-name>unallocatedCash</field-name> <column-name>UNALL_CASH</column-name></cmp-field>
                     <cmp-field><field-name>lastPaymentDate</field-name> <column-name>LAST_PAY_DTE</column-name></cmp-field>
                     <cmp-field><field-name>lastPaymentAmount</field-name><column-name>LAST_PAY_AMT</column-name></cmp-field>
                     <cmp-field><field-name>lastBuyDate</field-name> <column-name>LAST_BUY_DTE</column-name></cmp-field>
                     <cmp-field><field-name>openOrderAmount</field-name> <column-name>OPEN_ORDER_AMT</column-name></cmp-field>
                     <cmp-field><field-name>highARBalance</field-name> <column-name>HIGH_AR_BAL</column-name></cmp-field>
                     <cmp-field><field-name>messageCode1</field-name> <column-name>MESSAGE_CD1</column-name></cmp-field>
                     <cmp-field><field-name>messageCode2</field-name> <column-name>MESSAGE_CD2</column-name></cmp-field>
                     <cmp-field><field-name>mtdPayments</field-name> <column-name>MTD_PAYMENTS</column-name></cmp-field>
                     <cmp-field><field-name>termsCode</field-name> <column-name>TERMS_CD</column-name></cmp-field>
                     <cmp-field><field-name>sicCode</field-name> <column-name>SIC_CD</column-name></cmp-field>
                     <cmp-field><field-name>newCustomerSwitch</field-name><column-name>NEW_CUST_SW</column-name></cmp-field>
                     <cmp-field><field-name>shipKey</field-name> <column-name>CUST_SHIPKEY</column-name></cmp-field>
                     <cmp-field><field-name>recordType</field-name> <column-name>RTYPE</column-name></cmp-field>
                     </entity>
                    
                     <entity>
                    
                     <ejb-name>CustSoldEJB</ejb-name>
                     <datasource>java:/CurlDS</datasource>
                     <datasource-mapping>mySQL</datasource-mapping>
                     <create-table>false</create-table>
                     <remove-table>false</remove-table>
                     <read-only>false</read-only>
                     <table-name>CUST_SOLD</table-name>
                     <cmp-field><field-name>shipNumber</field-name> <column-name>SHIP_NUM</column-name></cmp-field>
                     <cmp-field><field-name>shipName</field-name> <column-name>SHIP_NAME</column-name></cmp-field>
                     <cmp-field><field-name>address1</field-name> <column-name>SHIP_ADDR1</column-name></cmp-field>
                     <cmp-field><field-name>address2</field-name> <column-name>SHIP_ADDR2</column-name></cmp-field>
                     <cmp-field><field-name>address3</field-name> <column-name>SHIP_ADDR3</column-name></cmp-field>
                     <cmp-field><field-name>address4</field-name> <column-name>SHIP_ADDR4</column-name></cmp-field>
                     <cmp-field><field-name>postalCode</field-name> <column-name>SHIP_POSTAL_CODE</column-name></cmp-field>
                     <cmp-field><field-name>monthToDateQuantity</field-name><column-name>MTD_KGS</column-name></cmp-field>
                     <cmp-field><field-name>monthToDateSales</field-name><column-name>MTD_SALES_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>monthToDateCost</field-name> <column-name>MTD_COST_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>yearToDateQuantity</field-name><column-name>YTD_KGS</column-name></cmp-field>
                     <cmp-field><field-name>yearToDateSales</field-name> <column-name>YTD_SALES_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>yearToDateCost</field-name> <column-name>YTD_COST_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>priorYearQuantity</field-name><column-name>PR_YR_KGS</column-name></cmp-field>
                     <cmp-field><field-name>priorYearSales</field-name> <column-name>PR_YR_SALES_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>priorYearCost</field-name> <column-name>PR_YR_COST_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>prior2ndYearQuantity</field-name><column-name>PR_YR2_KGS</column-name></cmp-field>
                     <cmp-field><field-name>prior2ndYearSales</field-name><column-name>PR_YR2_SALES_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>prior2ndYearCost</field-name><column-name>PR_YR2_COST_VALUE</column-name></cmp-field>
                     <cmp-field><field-name>currentBalance</field-name> <column-name>CURRENT_BAL</column-name></cmp-field>
                     <cmp-field><field-name>day30Balance</field-name> <column-name>DAY30_BAL</column-name></cmp-field>
                     <cmp-field><field-name>day60Balance</field-name> <column-name>DAY60_BAL</column-name></cmp-field>
                     <cmp-field><field-name>day90Balance</field-name> <column-name>DAY90_BAL</column-name></cmp-field>
                     <cmp-field><field-name>totalPaidInvoices</field-name><column-name>TOT_PD_INVOICES</column-name></cmp-field>
                     <cmp-field><field-name>totalPaidCurrentInvoices</field-name><column-name>TOT_PD_CUR</column-name></cmp-field>
                     <cmp-field><field-name>totalPaid30Day</field-name> <column-name>TOT_PD_30DAY</column-name></cmp-field>
                     <cmp-field><field-name>totalPaid60Day</field-name> <column-name>TOT_PD_60DAY</column-name></cmp-field>
                     <cmp-field><field-name> totalPaid90Day</field-name> <column-name>TOT_PD_90DAY</column-name></cmp-field>
                     <cmp-field><field-name>invoicesOutstanding</field-name><column-name>INVCS_OUTSTANDING</column-name></cmp-field>
                     <cmp-field><field-name>salesKey</field-name><column-name>CUST_SALESKEY</column-name></cmp-field>
                     <cmp-field><field-name>recordType</field-name><column-name>RTYPE</column-name></cmp-field>
                     </entity>
                    
                     <entity>
                     <ejb-name>SequenceEJB</ejb-name>
                     <datasource>java:/ITmysql</datasource>
                     <datasource-mapping>mySQL</datasource-mapping>
                     <create-table>false</create-table>
                     <remove-table>false</remove-table>
                     <read-only>false</read-only>
                     <table-name>KeySequence</table-name>
                     <cmp-field><field-name>sequenceName</field-name><column-name>Key_Name</column-name></cmp-field>
                     <cmp-field><field-name>value</field-name><column-name>Value</column-name></cmp-field>
                     </entity>
                    
                     </enterprise-beans>
                    
                    
                    </jbosscmp-jdbc>



                    • 7. Re: Problems with setting up Multiple Datasources
                      Adrian Brock Master

                      This works for me - even when the datasource doesn't exist.
                      I can't tell what is different to what you are doing.

                      ejb-jar.xml

                      <?xml version="1.0" encoding="UTF-8"?>
                      
                      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                      
                      
                      
                      <ejb-jar >
                      
                       <enterprise-beans>
                      
                       <message-driven >
                      
                       <ejb-name>test/mdb</ejb-name>
                      
                       <ejb-class>test.mdb.TestMDBBean</ejb-class>
                      
                       <transaction-type>Container</transaction-type>
                      
                       <message-driven-destination>
                      
                       <destination-type>javax.jms.Queue</destination-type>
                      
                       <subscription-durability>NonDurable</subscription-durability>
                      
                       </message-driven-destination>
                       <resource-ref>
                       <res-ref-name>standalone/test</res-ref-name>
                       <res-type>javax.sql.DataSource</res-type>
                       <res-auth>Container</res-auth>
                       <res-sharing-scope>Shareable</res-sharing-scope>
                       </resource-ref>
                      
                       </message-driven>
                      
                       <message-driven >
                      
                       <ejb-name>test/dlq</ejb-name>
                      
                       <ejb-class>test.mdb.TestMDBBean</ejb-class>
                      
                       <transaction-type>Container</transaction-type>
                      
                       <message-driven-destination>
                      
                       <destination-type>javax.jms.Queue</destination-type>
                      
                       <subscription-durability>NonDurable</subscription-durability>
                      
                       </message-driven-destination>
                      
                       </message-driven>
                      
                       </enterprise-beans>
                      
                       <assembly-descriptor >
                      
                       <container-transaction>
                      
                       <method>
                      
                       <ejb-name>test/mdb</ejb-name>
                      
                       <method-name>*</method-name>
                      
                       </method>
                      
                       <trans-attribute>Required</trans-attribute>
                      
                       </container-transaction>
                      
                       <container-transaction>
                      
                       <method>
                      
                       <ejb-name>test/dlq</ejb-name>
                      
                       <method-name>*</method-name>
                      
                       </method>
                      
                       <trans-attribute>Required</trans-attribute>
                      
                       </container-transaction>
                      
                       </assembly-descriptor>
                      
                      
                      
                      </ejb-jar>
                      
                      

                      jboss.xml
                      <?xml version="1.0" encoding="UTF-8"?>
                      
                      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
                      
                      
                      
                      <jboss>
                      
                       <invoker-proxy-bindings>
                       <invoker-proxy-binding>
                       <name>my-message-driven-bean</name>
                       <invoker-mbean>default</invoker-mbean>
                       <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
                       <proxy-factory-config>
                       <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
                       <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
                       <MaximumSize>15</MaximumSize>
                       <MaxMessages>1</MaxMessages>
                       <MDBConfig>
                       <ReconnectIntervalSec>10</ReconnectIntervalSec>
                       <DLQConfig>
                       <DestinationQueue>queue/DLQ</DestinationQueue>
                       <MaxTimesRedelivered>5</MaxTimesRedelivered>
                       <TimeToLive>0</TimeToLive>
                       <DLQUser>guest</DLQUser>
                       <DLQPassword>guest</DLQPassword>
                       </DLQConfig>
                       </MDBConfig>
                       </proxy-factory-config>
                       </invoker-proxy-binding>
                       <invoker-proxy-binding>
                       <name>dlq-message-driven-bean</name>
                       <invoker-mbean>default</invoker-mbean>
                       <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
                       <proxy-factory-config>
                       <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
                       <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
                       <MaximumSize>15</MaximumSize>
                       <MaxMessages>1</MaxMessages>
                       <MDBConfig>
                       <ReconnectIntervalSec>10</ReconnectIntervalSec>
                       <DLQConfig>
                       <DestinationQueue>queue/A</DestinationQueue>
                       <MaxTimesRedelivered>10</MaxTimesRedelivered>
                       <TimeToLive>0</TimeToLive>
                       <DLQUser>guest</DLQUser>
                       <DLQPassword>guest</DLQPassword>
                       </DLQConfig>
                       </MDBConfig>
                       </proxy-factory-config>
                       </invoker-proxy-binding>
                       </invoker-proxy-bindings>
                      
                      
                       <enterprise-beans>
                      
                      
                      
                       <message-driven>
                      
                       <ejb-name>test/mdb</ejb-name>
                      
                       <local-jndi-name>somethingelse</local-jndi-name>
                       <destination-jndi-name>queue/testQueue</destination-jndi-name>
                      
                       <invoker-bindings>
                       <invoker>
                       <invoker-proxy-binding-name>my-message-driven-bean</invoker-proxy-binding-name>
                       </invoker>
                       </invoker-bindings>
                       <resource-ref>
                       <res-ref-name>standalone/test</res-ref-name>
                       <jndi-name>java:/doesnotexist</jndi-name>
                       </resource-ref>
                       </message-driven>
                      
                       <message-driven>
                      
                       <ejb-name>test/dlq</ejb-name>
                      
                       <destination-jndi-name>queue/DLQ</destination-jndi-name>
                      
                       <invoker-bindings>
                       <invoker>
                       <invoker-proxy-binding-name>dlq-message-driven-bean</invoker-proxy-binding-name>
                       </invoker>
                       </invoker-bindings>
                       </message-driven>
                      
                      
                      
                       </enterprise-beans>
                      
                      
                      
                      </jboss>
                      
                      


                      Regards,
                      Adrian