11 Replies Latest reply on May 9, 2005 7:03 PM by gustavoorsi

    lomboz & xdoclet & jboss

    ellandill

      I've did some exercises from tutorial about lomboz & jboss
      got error
      Env: eclipse 3.0M7+lobmoz+xdoclet tags

      Error in jboss.xml for Bean StoreAccess: ejb-ref ejb/CustomerLocal found in jboss.xml but not in ejb-jar.xml

      ejb-jar.xml:


      <![CDATA[]]>
      <ejb-name>StoreAccess</ejb-name>
      com.store.session.StoreAccessHome
      com.store.session.StoreAccess
      <local-home>com.store.session.StoreAccessLocalHome</local-home>
      com.store.session.StoreAccessLocal
      <ejb-class>com.store.session.StoreAccessSession</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <ejb-local-ref >
      <ejb-ref-name>CustomerLocal</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.store.bmp.CustomerLocalHome</local-home>
      com.store.bmp.CustomerLocal
      <ejb-link>Customer</ejb-link>
      </ejb-local-ref>

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


      <!-- Entity Beans -->

      <![CDATA[]]>
      <ejb-name>Customer</ejb-name>
      com.store.bmp.CustomerHome
      com.store.bmp.Customer
      <local-home>com.store.bmp.CustomerLocalHome</local-home>
      com.store.bmp.CustomerLocal

      <ejb-class>com.store.bmp.CustomerBMP</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>com.store.bmp.CustomerPK</prim-key-class>
      False

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




      jboss.xml
      <enterprise-beans>


      <ejb-name>Customer</ejb-name>
      <jndi-name>CustomerBean</jndi-name>
      <local-jndi-name>CustomerLocal</local-jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <jndi-name>java:/DefaultDS</jndi-name>
      </resource-ref>




      <ejb-name>StoreAccess</ejb-name>
      <jndi-name>StoreAccessBean</jndi-name>
      <local-jndi-name>StoreAccessLocal</local-jndi-name>
      <ejb-ref>
      <ejb-ref-name>ejb/CustomerLocal</ejb-ref-name>
      <jndi-name>CustomerLocal</jndi-name>
      </ejb-ref>
      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <jndi-name>java:/DefaultDS</jndi-name>
      </resource-ref>



      </enterprise-beans>

        • 1. Re: lomboz & xdoclet & jboss
          mav

          I also have the same problem, i've evean try like the tuturial says after generaing class do rename de <ejb-local-ref> & </ejb-local-ref>, but i've the same error.
          Any one can help me out?

          • 2. Re: lomboz & xdoclet & jboss
            achirinosc

            After changing the jboss.xml with the ejb-local-ref tag, change the following in ejb-jar.xml :


            <ejb-local-ref >
            <ejb-ref-name>CustomerLocal</ejb-ref-name>
            <ejb-ref-type>Entity</ejb-ref-type>
            <local-home>au.com.tusc.bmp.CustomerLocalHome</local-home>
            au.com.tusc.bmp.CustomerLocal
            <ejb-link>Customer</ejb-link>
            </ejb-local-ref>

            with :


            <ejb-local-ref >
            <ejb-ref-name>ejb/CustomerLocal</ejb-ref-name>
            <ejb-ref-type>Entity</ejb-ref-type>
            <local-home>au.com.tusc.bmp.CustomerLocalHome</local-home>
            au.com.tusc.bmp.CustomerLocal
            <ejb-link>Customer</ejb-link>
            </ejb-local-ref>

            That solve the error, I've still haven't test the client

            • 3. Re: lomboz & xdoclet & jboss
              anil.saldhana

              Have you folks taken a look at JBossIDE?

              Its awesome!

              • 4. Re: lomboz & xdoclet & jboss
                achirinosc

                The tag for the StoreAccessBean is incorrect, replace the tag

                @ejb.ejb-ref ejb-name="Customer" view-type="local" ref-name="ManagerLocal"

                with

                @ejb.ejb-ref ejb-name="Customer" view-type="local" ref-name="ejb/ManagerLocal"

                or with

                @ejb.ejb-ref ejb-name="Customer" view-type="local"


                That solve the error
                [/url]

                • 5. Re: lomboz & xdoclet & jboss

                   

                  "achirinosc" wrote:

                  @ejb.ejb-ref ejb-name="Customer" view-type="local"

                  That solve the error
                  [/url]

                  This solves the problem with the different ejb-ref-names in ejb-jar.xml and jboss.xml.

                  However, you still have to edit the ejb-jar.xml file, replacing
                  <ejb-ref>
                  ...
                  </ejb-ref>

                  by
                  <ejb-local-ref>
                  ...
                  </ejb-local-ref>

                  I'm really asking myself when this bug will finally be solved. I believe it's around for quite some time now and it shouldn't be too complicated to fix it. Taking into account that the tusc tutorial is done by about everybody who would like to use lomboz with JBoss one really has to wonder...

                  • 6. Re: lomboz & xdoclet & jboss

                     

                    "niesar" wrote:

                    However, you still have to edit the ejb-jar.xml file, replacing

                    Oh oh, what am I saying here.

                    You need to edit jboss.xml, of course!

                    • 7. Re: lomboz & xdoclet & jboss
                      achirinosc

                      If you are using JBoss 3.2.X, for the jboss.xml file to be generated correctly, we need to change:

                      @jboss.ejb-ref-jndi ref-name="CustomerLocal" jndi-name="CustomerLocal"

                      with:

                      @jboss.ejb-local-ref ref-name="CustomerLocal" jndi-name="CustomerLocal"

                      for this to work, we have to edit the xdoclet.xml in the project and replace the following

                      <jboss
                      version="3.0"
                      unauthenticatedPrincipal="nobody"
                      xmlencoding="UTF-8"
                      destdir="${ejb.dd.dir}"
                      validatexml="false"
                      datasource="java:/DefaultDS"
                      datasourcemapping="Hypersonic SQL"
                      preferredrelationmapping="foreign-key"
                      />

                      with

                      <jboss
                      version="3.2"
                      unauthenticatedPrincipal="nobody"
                      xmlencoding="UTF-8"
                      destdir="${ejb.dd.dir}"
                      validatexml="false"
                      datasource="java:/DefaultDS"
                      datasourcemapping="Hypersonic SQL"
                      preferredrelationmapping="foreign-key"
                      />

                      That solve the hole error! :-)

                      • 8. Re: lomboz & xdoclet & jboss

                        Okiee...

                        I'm trying to solve this problem of <ejb-local-ref> and JNDI lookup problems for tutorial
                        i published nearly 2 yrs back using JBoss-3.2.1

                        Here it goes.....
                        As can be seen by the dtds of jboss.xml for JBoss-3.21 under docs/dtds directory...
                        it states that you don't need <ejb-local-ref>.. as
                        Snippet from jboss.xml dtd for JBoss.-3.21.

                        <enterprise-beans>
                         <entity>
                         <ejb-name />
                         <jndi-name />
                         <local-jndi-name />
                         <read-only>
                         <configuration-name>
                         <security-proxy> --------------- no <ejb-local-ref> tag defined here...
                         <ejb-ref>
                         <resource-ref>
                         <res-ref-name />
                         <resource-name />
                         </resource-ref>
                         <resource-env-ref>
                         <clustered />
                         <cluster-config>
                         </entity>
                         <session>
                         <ejb-name />
                         <jndi-name />
                         <local-jndi-name />
                         <configuration-name>
                         <security-proxy> ---------------- no <ejb-local-ref> tag defined here...
                         <ejb-ref>
                         <resource-ref>
                         <res-ref-name />
                         <resource-name />
                         </resource-ref>
                         <resource-env-ref>
                         <clustered />
                         <cluster-config>
                         </session>

                        Similar is the case for MDB's as well.

                        So what that mean is that the following tags are not needed as shown in tutorial
                        at various places as there is a bug in JBoss-3.2.1 for this part of jboss.xml file.
                        Since Item, Supplier, Customer, Manager, DeliverItem, RequestItem are
                        invoked by SessionFacades in same JVM we don't need
                        <ejb-ref>

                        tag so we need only
                        <ejb-local-ref>
                        tag only.
                        But in JBoss-3.2.1 it is not needed as shown above in the snippet code
                        from jboss.xml [/i] dtd and it works fine without that.

                        Note : It wont be a good design at all to invoke call from Session Facade on BMP/CMP beans using
                        <ejb-ref>
                        tag if they are in same JVM. As the overhead of calls will be very high. 
                        So lets remove those tags which we don't need at all. And leave rest of the tags
                        This is from StoreAccessBean.java after all the 8 chapters are completed.
                        /**
                         * @ejb.bean name="StoreAccess"
                         * jndi-name="StoreAccessBean"
                         * type="Stateless"
                         * @ejb.dao class="au.com.tusc.session.StoreAccessDAO"
                         * impl-class="au.com.tusc.dao.StoreAccessDAOImpl"
                         * @ejb.resource-ref res-ref-name="jdbc/DefaultDS"
                         * res-type="javax.sql.Datasource"
                         * res-auth="Container"
                         * @jboss.resource-ref res-ref-name="jdbc/DefaultDS"
                         * jndi-name="java:/DefaultDS"
                         * @ejb.ejb-ref ejb-name="Customer"
                         * view-type="local"
                         * ref-name="ejb/CustomerLocal"
                         * @ejb.ejb-ref ejb-name="Manager"
                         * view-type="local"
                         * ref-name="ejb/ManagerLocal"
                         * @ejb.ejb-ref ejb-name="Item"
                         * view-type="local"
                         * ref-name="ejb/ItemLocal"
                         * @ejb.ejb-ref ejb-name="Supplier"
                         * view-type="local"
                         * ref-name="ejb/SupplierLocal"
                         **/

                        Note : there is no @jboss.ejb-ref-jndi tag shown above ... remove these ones shown below from StroAcessBean.java.

                        @jboss.ejb-ref-jndi ref-name="CustomerLocal"
                         jndi-name="CustomerLocal"
                        @jboss.ejb-ref-jndi ref-name="ItemLocal"
                         jndi-name="ItemLocal"
                        @jboss.ejb-ref-jndi ref-name="SupplierLocal"
                         jndi-name="SupplierLocal"
                        @jboss.ejb-ref-jndi ref-name="ManagerLocall"
                         jndi-name="ItemLocal"



                        NOTE : - This is a mistake in the tutorial :-(
                        Now in of JBoss-4.0. you will need these tags in StoreAccessBean.java as shown below
                        @jboss.ejb-local-ref ref-name=?ejb/SupplierLocal? jndi-name=?SupplierLocal?
                        @jboss.ejb-local-ref ref-name=?ejb/ManagerLocal? jndi-name=?ManagerLocal?
                        @jboss.ejb-local-ref ref-name=?ejb/ItemLocal? jndi-name=?SupplierLocal?
                        @jboss.ejb-local-ref ref-name=?ejb/CustomerLocal? jndi-name=?CustomerLocal?
                        


                        No changes are required in Chapter ? 4.

                        Changes in Chapter 5.
                        Two changes here... in Customer and Manager bean
                        /**
                         * @ejb.bean name="Customer"
                         * jndi-name="CustomerBean"
                         * type="BMP"
                         * view-type="local"
                         * @ejb.dao class="au.com.tusc.bmp.CustomerDAO"
                         * impl-class="au.com.tusc.dao.CustomerDAOImpl"
                         * @ejb.resource-ref res-ref-name="jdbc/DefaultDS"
                         * res-type="javax.sql.Datasource"
                         * res-auth="Container"
                         * @jboss.resource-ref res-ref-name="jdbc/DefaultDS"
                         * jndi-name="java:/DefaultDS"
                         * @ejb.util generate="logical"
                        **/
                        

                        1. view-type=?local for @ejb.bean has been added so that doesn't generate the remote interface (Don't get confused here i'm not referring to Remote interface of Bean here ..;-) )
                        2 .
                        @ejb.util generate="logical"

                        this is being added so that it generates only logical names for lookup not physical names, as beans are in same JVM so we don't need any physical names.

                        Similarly for Manager Bean as well.
                        /**
                         * @ejb.bean name="Manager"
                         * jndi-name="ManagerBean"
                         * type="BMP"
                         * view-type="local"
                         * @ejb.dao class="au.com.tusc.bmp.ManagerDAO"
                         * impl-class="au.com.tusc.dao.ManagerDAOImpl"
                         * @ejb.resource-ref res-ref-name="jdbc/DefaultDS"
                         * res-type="javax.sql.Datasource"
                         * res-auth="Container"
                         * @jboss.resource-ref res-ref-name="jdbc/DefaultDS"
                         * jndi-name="java:/DefaultDS"
                         * @ejb.util generate="logical"
                        **/
                        

                        Chapter 6.
                        Same as two changes in Chapter 5 in Item Bean and Supplier Bean.
                        1. @ejb.bean view-type=?local?
                        2. @ejb.util generate physical=?true?
                        

                        In Item Bean
                        /**
                         * @ejb.bean name="Item"
                         * jndi-name="ItemBean"
                         * type="CMP"
                         * primkey-field="itemID"
                         * schema="MyStoreItem"
                         * cmp-version="2.x"
                         * view-type="local"
                         * @ejb.persistence
                         * table-name="Item"
                         * @ejb.finder
                         * query="SELECT OBJECT(a) FROM MyStoreItem as a"
                         * signature="java.util.Collection findAll()"
                         * @ejb.finder
                         * query="SELECT OBJECT(b) FROM MyStoreItem b where b.supplierID = ?1"
                         * signature="java.util.Collection findSupplierID(java.lang.String supplierID)"
                         * @ejb.finder
                         * query="SELECT OBJECT(c) FROM MyStoreItem c where c.quantity = 0"
                         * signature="java.util.Collection findByOutOfStock()"
                        * @ejb.util generate="logical"
                        **/
                        

                        Supplier Bean
                        /**
                         * @ejb.bean name="Supplier"
                         * jndi-name="SupplierBean"
                         * type="CMP"
                         * primkey-field="supplierID"
                         * schema="MyStoreSupplier"
                         * cmp-version="2.x"
                         * view-type="local"
                         * @ejb.persistence
                         * table-name="Supplier"
                         * @ejb.finder
                         * query="SELECT OBJECT(a) FROM MyStoreSupplier as a"
                         * signature="java.util.Collection findAll()"
                         * @ejb.finder
                         * query="SELECT Object(b) FROM MyStoreSupplier as b where b.userID = ?1"
                         * signature="au.com.tusc.cmp.SupplierLocal findUserID(java.lang.String userID)"
                         * @ejb.util generate="logical"
                         **/
                        


                        Chapter 7.
                        Only change here is that
                         @jboss.ejb-ref-jndi ref-name="ItemLocal"
                         jndi-name="ItemLocal"
                        

                        is being removed from DeliverItemsBean as it is not needed in this version of JBoss-3.2.1 as shown below
                        /**
                         * @ejb.bean name="DeliverItems"
                         * acknowledge-mode="Auto-acknowledge"
                         * destination-type="javax.jms.Queue"
                         * subscription-durability="NonDurable"
                         * transaction-type="Bean"
                         * @ejb.ejb-ref
                         * ejb-name="StoreAccess"
                         * view-type="remote"
                         * ref-name="StoreAccess"
                         * @ejb.ejb-ref
                         * ejb-name="Item"
                         * view-type="local"
                         * ref-name="ejb/ItemLocal"
                         * @jboss.ejb-ref-jndi ref-name="StoreAccess"
                         * jndi-name="StoreAccessBean"
                         * @jboss.destination-jndi-name
                         * name="queue/DelMdbQueue"
                         **/
                        

                        But with JBoss-4.0 you will need this tag
                        @jboss.ejb-local-ref ref-name=?ejb/ItemLocal? jndi-name=?ItemLocal?
                        


                        Similarly in RequestItem Bean
                        /**
                         * @ejb.bean name="RequestItems"
                         * acknowledge-mode="Auto-acknowledge"
                         * destination-type="javax.jms.Queue"
                         * subscription-durability="NonDurable"
                         * transaction-type="Bean"
                         * @ejb.ejb-ref
                         * ejb-name="StoreAccess"
                         * view-type="remote"
                         * ref-name="StoreAccess"
                         * @ejb.ejb-ref
                         * ejb-name="Supplier"
                         * view-type="local"
                         * ref-name="ejb/SupplierLocal"
                         * @jboss.ejb-ref-jndi ref-name="StoreAccess"
                         * jndi-name="StoreAccessBean"
                         * @jboss.destination-jndi-name
                         * name="queue/MdbQueue"
                         **/
                        


                        You will have to add this tag shown below with JBoss-4.0
                        @jboss.ejb-local-ref ref-name=?ejb/SupplierLocal? jndi-name=?SupplierLocal?
                        


                        No Change is required for chapter 9 as it uses Local interfaces of StoreAccessBean, which is being generated along with remote ones

                        Also this is how
                        ejb-jar.xml
                        looks like finally.
                        <?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 >
                         <description>[CDATA[No Description.]]</description>
                         <display-name>Generated by XDoclet</display-name>
                         <enterprise-beans>
                         <!-- Session Beans -->
                         <session >
                         <description>[CDATA[]]</description>
                         <ejb-name>StoreAccessState</ejb-name>
                         <home>au.com.tusc.sessionState.StoreAccessStateHome</home>
                         <remote>au.com.tusc.sessionState.StoreAccessState</remote>
                         <ejb-class>au.com.tusc.sessionState.StoreAccessStateSession</ejb-class>
                         <session-type>Stateful</session-type>
                         <transaction-type>Container</transaction-type>
                         <resource-ref >
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <res-type>javax.sql.Datasource</res-type>
                         <res-auth>Container</res-auth>
                         </resource-ref>
                         </session>
                         <session >
                         <description>[CDATA[]]</description>
                         <ejb-name>StoreAccess</ejb-name>
                         <home>au.com.tusc.session.StoreAccessHome</home>
                         <remote>au.com.tusc.session.StoreAccess</remote>
                         <local-home>au.com.tusc.session.StoreAccessLocalHome</local-home>
                         <local>au.com.tusc.session.StoreAccessLocal</local>
                         <ejb-class>au.com.tusc.session.StoreAccessSession</ejb-class>
                         <session-type>Stateless</session-type>
                         <transaction-type>Container</transaction-type>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/CustomerLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.bmp.CustomerLocalHome</local-home>
                         <local>au.com.tusc.bmp.CustomerLocal</local>
                         <ejb-link>Customer</ejb-link>
                         </ejb-local-ref>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/ManagerLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.bmp.ManagerLocalHome</local-home>
                         <local>au.com.tusc.bmp.ManagerLocal</local>
                         <ejb-link>Manager</ejb-link>
                         </ejb-local-ref>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/ItemLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.cmp.ItemLocalHome</local-home>
                         <local>au.com.tusc.cmp.ItemLocal</local>
                         <ejb-link>Item</ejb-link>
                         </ejb-local-ref>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/SupplierLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.cmp.SupplierLocalHome</local-home>
                         <local>au.com.tusc.cmp.SupplierLocal</local>
                         <ejb-link>Supplier</ejb-link>
                         </ejb-local-ref>
                         <resource-ref >
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <res-type>javax.sql.Datasource</res-type>
                         <res-auth>Container</res-auth>
                         </resource-ref>
                         </session>
                         <!--
                         To add session beans that you have deployment descriptor info for, add
                         a file to your XDoclet merge directory called session-beans.xml that contains
                         the <session></session> markup for those beans.
                         -->
                         <!-- Entity Beans -->
                         <entity >
                         <description>[CDATA[]]</description>
                         <ejb-name>Item</ejb-name>
                         <local-home>au.com.tusc.cmp.ItemLocalHome</local-home>
                         <local>au.com.tusc.cmp.ItemLocal</local>
                         <ejb-class>au.com.tusc.cmp.ItemCMP</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>MyStoreItem</abstract-schema-name>
                         <cmp-field >
                         <description>[CDATA[Returns the itemID]]</description>
                         <field-name>itemID</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the supplierID]]</description>
                         <field-name>supplierID</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the description]]</description>
                         <field-name>description</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the quantity]]</description>
                         <field-name>quantity</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the price]]</description>
                         <field-name>price</field-name>
                         </cmp-field>
                         <primkey-field>itemID</primkey-field>
                        
                         <query>
                         <query-method>
                         <method-name>findAll</method-name>
                         <method-params>
                         </method-params>
                         </query-method>
                         <ejb-ql>[CDATA[SELECT OBJECT(a) FROM MyStoreItem as a]]</ejb-ql>
                         </query>
                         <query>
                         <query-method>
                         <method-name>findSupplierID</method-name>
                         <method-params>
                         <method-param>java.lang.String</method-param>
                         </method-params>
                         </query-method>
                         <ejb-ql>[CDATA[SELECT OBJECT(b) FROM MyStoreItem b where b.supplierID = ?1]]</ejb-ql>
                         </query>
                         <query>
                         <query-method>
                         <method-name>findByOutOfStock</method-name>
                         <method-params>
                         </method-params>
                         </query-method>
                         <ejb-ql>[CDATA[SELECT OBJECT(c) FROM MyStoreItem c where c.quantity = 0]]</ejb-ql>
                         </query>
                         <!-- Write a file named ejb-finders-ItemBean.xml if you want to define extra finders. -->
                         </entity>
                         <entity >
                         <description>[CDATA[]]</description>
                         <ejb-name>Supplier</ejb-name>
                         <local-home>au.com.tusc.cmp.SupplierLocalHome</local-home>
                         <local>au.com.tusc.cmp.SupplierLocal</local>
                         <ejb-class>au.com.tusc.cmp.SupplierCMP</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>MyStoreSupplier</abstract-schema-name>
                         <cmp-field >
                         <description>[CDATA[Returns the supplierID]]</description>
                         <field-name>supplierID</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the userID]]</description>
                         <field-name>userID</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the firstName]]</description>
                         <field-name>firstName</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the lastName]]</description>
                         <field-name>lastName</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the address]]</description>
                         <field-name>address</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the message]]</description>
                         <field-name>message</field-name>
                         </cmp-field>
                         <cmp-field >
                         <description>[CDATA[Returns the creditLimit]]</description>
                         <field-name>creditLimit</field-name>
                         </cmp-field>
                         <primkey-field>supplierID</primkey-field>
                         <query>
                         <query-method>
                         <method-name>findAll</method-name>
                         <method-params>
                         </method-params>
                         </query-method>
                         <ejb-ql>[CDATA[SELECT OBJECT(a) FROM MyStoreSupplier as a]]</ejb-ql>
                         </query>
                         <query>
                         <query-method>
                         <method-name>findUserID</method-name>
                         <method-params>
                         <method-param>java.lang.String</method-param>
                         </method-params>
                         </query-method>
                         <ejb-ql>[CDATA[SELECT Object(b) FROM MyStoreSupplier as b where b.userID = ?1]]</ejb-ql>
                         </query>
                         <!-- Write a file named ejb-finders-SupplierBean.xml if you want to define extra finders. -->
                         </entity>
                         <entity >
                         <description>[CDATA[]]</description>
                         <ejb-name>Manager</ejb-name>
                         <local-home>au.com.tusc.bmp.ManagerLocalHome</local-home>
                         <local>au.com.tusc.bmp.ManagerLocal</local>
                         <ejb-class>au.com.tusc.bmp.ManagerBMP</ejb-class>
                         <persistence-type>Bean</persistence-type>
                         <prim-key-class>au.com.tusc.bmp.ManagerPK</prim-key-class>
                         <reentrant>False</reentrant>
                         <resource-ref >
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <res-type>javax.sql.Datasource</res-type>
                         <res-auth>Container</res-auth>
                         </resource-ref>
                         </entity>
                         <entity >
                         <description>[CDATA[]]</description>
                         <ejb-name>Customer</ejb-name>
                         <local-home>au.com.tusc.bmp.CustomerLocalHome</local-home>
                         <local>au.com.tusc.bmp.CustomerLocal</local>
                         <ejb-class>au.com.tusc.bmp.CustomerBMP</ejb-class>
                         <persistence-type>Bean</persistence-type>
                         <prim-key-class>au.com.tusc.bmp.CustomerPK</prim-key-class>
                         <reentrant>False</reentrant>
                         <resource-ref >
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <res-type>javax.sql.Datasource</res-type>
                         <res-auth>Container</res-auth>
                         </resource-ref>
                         </entity>
                         <!--
                         To add entity beans that you have deployment descriptor info for, add
                         a file to your XDoclet merge directory called entity-beans.xml that contains
                         the <entity></entity> markup for those beans.
                         -->
                         <!-- Message Driven Beans -->
                         <message-driven >
                         <description>[CDATA[]]</description>
                         <ejb-name>RequestItems</ejb-name>
                         <ejb-class>au.com.tusc.mdb.RequestItemsBean</ejb-class>
                         <transaction-type>Bean</transaction-type>
                         <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
                         <message-driven-destination>
                         <destination-type>javax.jms.Queue</destination-type>
                         <subscription-durability>NonDurable</subscription-durability>
                         </message-driven-destination>
                         <ejb-ref >
                         <ejb-ref-name>ejb/StoreAccess</ejb-ref-name>
                         <ejb-ref-type>Session</ejb-ref-type>
                         <home>au.com.tusc.session.StoreAccessHome</home>
                         <remote>au.com.tusc.session.StoreAccess</remote>
                         <ejb-link>StoreAccess</ejb-link>
                         </ejb-ref>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/SupplierLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.cmp.SupplierLocalHome</local-home>
                         <local>au.com.tusc.cmp.SupplierLocal</local>
                         <ejb-link>Supplier</ejb-link>
                         </ejb-local-ref>
                         </message-driven>
                         <message-driven >
                         <description>[CDATA[]]</description>
                         <ejb-name>DeliverItems</ejb-name>
                         <ejb-class>au.com.tusc.mdb.DeliverItemsBean</ejb-class>
                         <transaction-type>Bean</transaction-type>
                         <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
                         <message-driven-destination>
                         <destination-type>javax.jms.Queue</destination-type>
                         <subscription-durability>NonDurable</subscription-durability>
                         </message-driven-destination>
                         <ejb-ref >
                         <ejb-ref-name>ejb/StoreAccess</ejb-ref-name>
                         <ejb-ref-type>Session</ejb-ref-type>
                         <home>au.com.tusc.session.StoreAccessHome</home>
                         <remote>au.com.tusc.session.StoreAccess</remote>
                         <ejb-link>StoreAccess</ejb-link>
                         </ejb-ref>
                         <ejb-local-ref >
                         <ejb-ref-name>ejb/ItemLocal</ejb-ref-name>
                         <ejb-ref-type>Entity</ejb-ref-type>
                         <local-home>au.com.tusc.cmp.ItemLocalHome</local-home>
                         <local>au.com.tusc.cmp.ItemLocal</local>
                         <ejb-link>Item</ejb-link>
                         </ejb-local-ref>
                         </message-driven>
                         </enterprise-beans>
                         <!-- Relationships -->
                         <!-- Assembly Descriptor -->
                         <assembly-descriptor >
                         <!-- finder transactions -->
                         </assembly-descriptor>
                        </ejb-jar>
                        


                        And finally
                        jboss.xml
                        looks like this
                        <?xml version="1.0" encoding="UTF-8"?>
                        <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
                        <jboss>
                         <unauthenticated-principal>nobody</unauthenticated-principal>
                         <enterprise-beans>
                         <!--
                         To add beans that you have deployment descriptor info for, add
                         a file to your XDoclet merge directory called jboss-beans.xml that contains
                         the <session></session>, <entity></entity> and <message-driven></message-driven>
                         markup for those beans.
                         -->
                         <entity>
                         <ejb-name>Item</ejb-name>
                         <local-jndi-name>ItemLocal</local-jndi-name>
                         </entity>
                         <entity>
                         <ejb-name>Supplier</ejb-name>
                         <local-jndi-name>SupplierLocal</local-jndi-name>
                         </entity>
                         <entity>
                         <ejb-name>Manager</ejb-name>
                         <local-jndi-name>ManagerLocal</local-jndi-name>
                         <resource-ref>
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <jndi-name>java:/DefaultDS</jndi-name>
                         </resource-ref>
                         </entity>
                         <entity>
                         <ejb-name>Customer</ejb-name>
                         <local-jndi-name>CustomerLocal</local-jndi-name>
                         <resource-ref>
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <jndi-name>java:/DefaultDS</jndi-name>
                         </resource-ref>
                         </entity>
                         <session>
                         <ejb-name>StoreAccessState</ejb-name>
                         <jndi-name>StoreAccessStateBean</jndi-name>
                         <local-jndi-name>StoreAccessStateLocal</local-jndi-name>
                         <resource-ref>
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <jndi-name>java:/DefaultDS</jndi-name>
                         </resource-ref>
                         </session>
                         <session>
                         <ejb-name>StoreAccess</ejb-name>
                         <jndi-name>StoreAccessBean</jndi-name>
                         <local-jndi-name>StoreAccessLocal</local-jndi-name>
                         <resource-ref>
                         <res-ref-name>jdbc/DefaultDS</res-ref-name>
                         <jndi-name>java:/DefaultDS</jndi-name>
                         </resource-ref>
                         </session>
                         <message-driven>
                         <ejb-name>RequestItems</ejb-name>
                         <destination-jndi-name>queue/MdbQueue</destination-jndi-name>
                         <ejb-ref>
                         <ejb-ref-name>ejb/StoreAccess</ejb-ref-name>
                         <jndi-name>StoreAccessBean</jndi-name>
                         </ejb-ref>
                         </message-driven>
                         <message-driven>
                         <ejb-name>DeliverItems</ejb-name>
                         <destination-jndi-name>queue/DelMdbQueue</destination-jndi-name>
                         <ejb-ref>
                         <ejb-ref-name>ejb/StoreAccess</ejb-ref-name>
                         <jndi-name>StoreAccessBean</jndi-name>
                         </ejb-ref>
                         </message-driven>
                         </enterprise-beans>
                         <resource-managers>
                         </resource-managers>
                        </jboss>
                        


                        And this how JNDIView looks like after deploying the MyStoreMgr.jar
                        Some bits has been removed in this snippet.



                        java:comp namespace of the StoreAccess bean:
                        +- env (class: org.jnp.interfaces.NamingContext)
                        | +- jdbc (class: org.jnp.interfaces.NamingContext)
                        | | +- DefaultDS[link -> java:/DefaultDS] (class: javax.naming.LinkRef)
                        | +- ejb (class: org.jnp.interfaces.NamingContext)
                        | | +- SupplierLocal[link -> SupplierLocal] (class: javax.naming.LinkRef)
                        | | +- CustomerLocal[link -> CustomerLocal] (class: javax.naming.LinkRef)
                        | | +- ManagerLocal[link -> ManagerLocal] (class: javax.naming.LinkRef)
                        | | +- ItemLocal[link -> ItemLocal] (class: javax.naming.LinkRef)

                        java:comp namespace of the RequestItems bean:
                        +- UserTransaction (class: javax.transaction.UserTransaction)
                        +- env (class: org.jnp.interfaces.NamingContext)
                        | +- ejb (class: org.jnp.interfaces.NamingContext)
                        | | +- SupplierLocal[link -> SupplierLocal] (class: javax.naming.LinkRef)
                        | | +- StoreAccess[link -> StoreAccessBean] (class: javax.naming.LinkRef)

                        Global JNDI Namespace
                        org.jboss.mq.SpyXAConnectionFactory)
                        +- queue (class: org.jnp.interfaces.NamingContext)
                        | +- D (class: org.jboss.mq.SpyQueue)
                        | +- C (class: org.jboss.mq.SpyQueue)
                        | +- B (class: org.jboss.mq.SpyQueue)
                        | +- A (class: org.jboss.mq.SpyQueue)
                        | +- DelMdbQueue (class: org.jboss.mq.SpyQueue)
                        | +- testQueue (class: org.jboss.mq.SpyQueue)
                        | +- ex (class: org.jboss.mq.SpyQueue)
                        | +- DLQ (class: org.jboss.mq.SpyQueue)
                        | +- MdbQueue (class: org.jboss.mq.SpyQueue)
                        +- StoreAccessLocal (proxy: $Proxy222 implements interface au.com.tusc.session.StoreAccessLocalHome)
                        +- ItemLocal (proxy: $Proxy218 implements interface au.com.tusc.cmp.ItemLocalHome)
                        +- RMIConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                        +- SupplierLocal (proxy: $Proxy219 implements interface au.com.tusc.cmp.SupplierLocalHome)
                        org.jboss.mq.SpyXAConnectionFactory)
                        +- topic (class: org.jnp.interfaces.NamingContext)
                        | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
                        | +- testTopic (class: org.jboss.mq.SpyTopic)
                        | +- securedTopic (class: org.jboss.mq.SpyTopic)
                        +- StoreAccessStateBean (proxy: $Proxy223 implements interface au.com.tusc.sessionState.StoreAccessStateHome,interface javax.ejb.Handle)
                        +- ManagerLocal (proxy: $Proxy220 implements interface au.com.tusc.bmp.ManagerLocalHome)
                        +- ejb (class: org.jnp.interfaces.NamingContext)
                        | +- mgmt (class: org.jnp.interfaces.NamingContext)
                        | | +- MEJB (proxy: $Proxy42 implements interface javax.management.j2ee.ManagementHome,interface javax.ejb.Handle)
                        +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
                        +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                        +- CustomerLocal (proxy: $Proxy221 implements interface au.com.tusc.bmp.CustomerLocalHome)
                        +- RMIXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                        +- OIL2XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                        +- HASessionState (class: org.jnp.interfaces.NamingContext)
                        | +- Default (class: org.jboss.ha.hasessionstate.server.HASessionStateImpl)
                        +- UIL2XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                        +- invokers (class: org.jnp.interfaces.NamingContext)
                        | +- localhost.localdomain (class: +- StoreAccessBean (proxy: $Proxy224 implements interface au.com.tusc.session.StoreAccessHome,interface javax.ejb.Handle)
                        +- UILConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                        +- jetty (class: org.jnp.interfaces.NamingContext)
                        | +- CMPState (proxy: $Proxy39 implements interface org.mortbay.j2ee.session.interfaces.CMPStateHome,interface javax.ejb.Handle)
                        +- jmx (class: org.jnp.interfaces.NamingContext)
                        | +- invoker (class: org.jnp.interfaces.NamingContext)
                        | | +- RMIAdaptor (proxy: $Proxy31 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor)
                        | +- rmi (class: org.jnp.interfaces.NamingContext)
                        | | +- RMIAdaptor (class:



                        • 9. Re: lomboz & xdoclet & jboss
                          mrobin21

                          I resolved it by hacking the JBOSS XDoclet definition (in the jboss_xml.xdt file in the plugins\sf.net.xdoclet_1.2.1\xdoclet-jboss-module-1.2.1.jar JAR)

                          The steps to make these changes:
                          1. Unpack the jar file into a temporary directory (e.g., c:\data\temp).
                          2. Edit the file jboss_xml.xdt as below.
                          3. Repack the jar file (ensuring the META-INF directory is also packed): jar ?cvf xdoclet-jboss-module-1.2.1.jar META-INF xdoclet
                          4. Put the file into the C:\data\eclipse\plugins\sf.net.xdoclet_1.2.1 folder, overwriting the existing one.

                          Changes to the jboss_xml.xdt file:
                          ---------------------------------------
                          In the section headed:

                          <XDtConfig:ifConfigParamGreaterOrEquals paramName="Version" value="3.2">


                          Change the code within the <ejb-local-ref> tagset to read:
                           <ejb-ref-name><XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="ref-name"/></ejb-ref-name>
                           <local-jndi-name>ejb/<XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="jndi-name"/></local-jndi-name>
                          


                          In the section headed:
                          <XDtClass:forAllClassTags tagName="jboss:ejb-ref-jndi">


                          Change the code within the <ejb-ref> tagset to read:
                           <ejb-ref-name><XDtClass:classTagValue tagName="jboss:ejb-ref-jndi" paramName="ref-name"/></ejb-ref-name>
                           <jndi-name>ejb/<XDtClass:classTagValue tagName="jboss:ejb-ref-jndi" paramName="jndi-name"/></jndi-name>
                          


                          Immediately after the close tag for the above section:
                          </XDtClass:forAllClassTags>


                          Insert this new code:
                           <XDtConfig:ifConfigParamGreaterOrEquals paramName="Version" value="3.2">
                           <XDtClass:forAllClassTags tagName="jboss:ejb-local-ref">
                           <ejb-local-ref>
                           <ejb-ref-name><XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="ref-name"/></ejb-ref-name>
                           <local-jndi-name>ejb/<XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="jndi-name"/></local-jndi-name>
                           </ejb-local-ref>
                           </XDtClass:forAllClassTags>
                           </XDtConfig:ifConfigParamGreaterOrEquals>
                          


                          Further down in the section headed:
                          <XDtClass:forAllClassTags tagName="jboss:ejb-ref-jndi">


                          Change the code within the <ejb-ref> tagset to read:
                           <ejb-ref-name><XDtClass:classTagValue tagName="jboss:ejb-ref-jndi" paramName="ref-name"/></ejb-ref-name>
                           <jndi-name>ejb/<XDtClass:classTagValue tagName="jboss:ejb-ref-jndi" paramName="jndi-name"/></jndi-name>
                          


                          Just after the close tag for the above section:
                          </XDtClass:forAllClassTags>


                          Insert this code:
                           <XDtConfig:ifConfigParamGreaterOrEquals paramName="Version" value="3.2">
                           <XDtClass:forAllClassTags tagName="jboss:ejb-local-ref">
                           <ejb-local-ref>
                           <ejb-ref-name><XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="ref-name"/></ejb-ref-name>
                           <local-jndi-name>ejb/<XDtClass:classTagValue tagName="jboss:ejb-local-ref" paramName="jndi-name"/></local-jndi-name>
                           </ejb-local-ref>
                           </XDtClass:forAllClassTags>
                           </XDtConfig:ifConfigParamGreaterOrEquals>
                          


                          If all this is too hard, I have done this and can make the corrections available to you. Strictly on the basis of NO WARRANTY - YOUR RISK.

                          • 10. Re: lomboz & xdoclet & jboss
                            gustavoorsi

                            Problema con MDBs:
                            Cree el Message-DrivenBean "RequestItemsBean", luego lo agrego al EJBModule correspondiente pero cuando genero las clases no crea el paquete "au.com.tusc.mdb" ni sus beans correspondientes. Revise el archivo beans.xml donde figuran todos los beans que tengo y su tipo y me di cuenta de que para el message driven bean figura como Entity:


                            au.com.tusc.mdb.DeliverItemsBean
                            Entity


                            Ademas, sin motivo aparente cuando genere las clases se me borro la mitad del archivo xdoclet.xml (el cual tuve que reescribir manualmente)


                            Si alguien sabe como solucionar esto, por favor reponda.

                            Saludos

                            Gustavo

                            • 11. Re: lomboz & xdoclet & jboss
                              gustavoorsi

                              MDBs problem:
                              I've created the mdb "RequestItemsBean", i added to "MyStoreMgr" module and then generated the classes, but nor "au.com.tusc.mdb" package was created neither the classes.
                              I checked out the "beans.xml" file and i found out that the MDB type is "Entity" instead of the type for a Message driven bean (i dont really know what type should it be, i guess it should be "Message-driven" or something like that).


                              au.com.tusc.mdb.DeliverItemsBean
                              Entity


                              Besides, with no reason, when a generated the EJB Classes half of the xdoclet.xml file was deleted (and i had to populated myself).

                              So, if you know what is this problem about, please answer.

                              Gustavo