6 Replies Latest reply on Jun 14, 2004 3:45 PM by mrking

    Chapter 3 of the tusc tutorial

    msloan21

      After reading through the 28 pages of the original thread and seeing the question asked, but not really answered, I thought it best to ask again in a new thread.

      As the title states, I am in chapter 3 of the tusc tutorial - creating the DAO class. Per the tutorial, I have created the DAO interface in the dao package and modified the session bean class with the @ejb.dao tag. I have also modified xdoclet.xml by adding the dao tag, as well as updating the jboss tag for Hypersonic.

      When I add ejb to the MyStoreMgr module and generate EJB classes, the StoreAccessDAO class is not being generated in the ejbsrc directory. I have removed the bean from the module and deleted the ejbsrc directory and tried again, didn't work. I have also wiped everything clean and started over and that didn't work.

      Anyone have any ideas of what I might be doing wrong?

        • 1. Re: Chapter 3 of the tusc tutorial
          msloan21

          forgot to add code that might help in identifing what I am missing.

          The StoreAccessBean class:

          package com.tonkadawg.session;
          
          import javax.ejb.SessionBean;
          
          /**
           * @ejb.bean name="StoreAccess"
           * jndi-name="StoreAccessBean"
           * type="Stateless"
           * @ejb.dao class="com.tonkadawg.session.StoreAccessDAO"
           * impl-class="com.tonkadawg.dao.StoreAccessDAOImpl"
           *
           *--
           * This is needed for JOnAS.
           * If you are not using JOnAS you can safely remove the tags below.
           * @jonas.bean ejb-name="StoreAccess"
           * jndi-name="StoreAccessBean"
           *
           *--
           **/
          
          public abstract class StoreAccessBean implements SessionBean {
          
          
          }
          


          From xdoclet.xml:
          <dataobject/>
          <valueobject/>
          <utilobject cacheHomes="true" includeGUID="true"/>
          <dao pattern="{0}" destDir="${ejbsrc.dir}"/>
          
          <remoteinterface/>
          <localinterface/>
          <homeinterface />
          <localhomeinterface/>
          
          <!-- .... -->
          <jboss
           version="3.0"
           unauthenticatedPrincipal="nobody"
           xmlencoding="UTF-8"
           destdir="${ejb.dd.dir}"
           validatexml="false"
           datasource="java:/DefaultDS"
           datasourcemapping="Hypersonic SQL"
           preferredrelationmapping="foreign-key"
          />
          


          Thanks again!

          • 2. Re: Chapter 3 of the tusc tutorial

            What is the tusc tutorial?

            • 3. Re: Chapter 3 of the tusc tutorial
              msloan21
              • 4. Re: Chapter 3 of the tusc tutorial
                khem

                hi,

                in xdoclet.xml, try :

                <dao pattern="{0}" destdir="${project.dir}/${ejbsrc.dir}"/>


                instead of :

                <dao pattern="{0}" destDir="${ejbsrc.dir}"/>


                hope it helps,

                regards

                • 5. Re: Chapter 3 of the tusc tutorial
                  mrking

                  Hi there,

                  I was confused about this too. I think that the tutorial was written for an older version of Lomboz, which used an eGenerate.xml file. The newer version I've been using (and presumably you too) does not use this file, it uses xdoclets.xml instead.

                  Xdoclets.xml, rather than listing files through a pattern, lists them explicitly. So, to modify it to generate DAO files, *DO NOT* add the pair with the pattern.

                  Because there's no longer a pattern in the xdoclets.xml file, the dao tag can now just be



                  instead of the longer version shown in the tutorial.

                  Well, after that it worked for me...at least until Chapter 6 :-)

                  -- Matt.

                  • 6. Re: Chapter 3 of the tusc tutorial
                    mrking

                    Hi there,

                    OOPS didn't like the tags - here's a repost.

                    I was confused about this too. I think that the tutorial was written for an older version of Lomboz, which used an eGenerate.xml file. The newer version I've been using (and presumably you too) does not use this file, it uses xdoclets.xml instead.

                    Xdoclets.xml, rather than listing files through a pattern, lists them explicitly. So, to modify it to generate DAO files, *DO NOT* add the

                    <fileset> ... </fileset>
                    that's in the tutorial; all your classes should already have been added automatically.

                    Because there's no longer a pattern in the xdoclets.xml file, the dao tag can now just be

                    <dao />


                    instead of the longer version shown in the tutorial.

                    Well, after that it worked for me...at least until Chapter 6 :-)

                    -- Matt.