4 Replies Latest reply on Nov 19, 2003 10:14 PM by Jon Barnett

    Learning by example.

    John Anderson Newbie

      I am new to JBoss, the JBoss IDE, CMP and XDoclet. I'm not new, to servlets and jsp and other aspects of j2ee. (Then again, I'm not that good either).

      I read from a shell fortune once that programmers become good programmers by studying the source code of excellent programmers.

      Well, I'm in the market for some excellent practice material to study. Namely I'm looking for a simple project utilizing CMP in the JBoss IDE.

      Coding the actual class implementations aren't that difficult because the container pretty much handles the work, but I'm really having trouble with xDoclet tags and deployment descriptors.

      Does anyone know of or have a good example of a JBoss IDE project that utilizes CMP and XDoclet to create the LocalInterface, LocalHomeInterface and deployment descriptors? This would be most helpful.

      I've read and undestand the JBoss IDE tutorial. I've also completed the EJB-CMP/CMR Introduction Tutorial from IBM/DeveloperWorks by Hightower. Plus I've read and kind of understand the JBoss CMP Tutorial.

      I think I need to see it in front of me to fully grasp the concepts.

      Any direction given would be a great help.

      Thanks in advance.

        • 1. Re: Learning by example.
          Vishal Sharma Expert

          You might want to try this www.tusc.com.au/tutorial/html/index.html this doesn't uses jboss ide, but uses xdoclet.


          • 2. Re: Learning by example.
            Jon Barnett Master

            You could try the XPetstore project as that seems to be the starting point for most people. I'm not quite sure how good the code is having never really played with it.

            Usually the rest of the XDoclet stuff can be gleaned from the XDoclet documentation. There are a few small holes in the documentation though so just be warned about it. You end up having to read the XTDs packed in the XDoclet modules or from the source material to see if the tags are really supported.

            The interface generation is pretty straight forward. You can read http://www.amitysolutions.com.au/documents/JBossJNDI-technote.xml for some XDoclet example fragments although the note is aimed more at showing how the EJB/resource references work in JBoss.

            Hope that gets you a start.

            • 3. Re: Learning by example.
              John Anderson Newbie

              Thanks for all of your help, but unfortunately I never really needed a tutorial after all. I just stared at it, and hacked around with it untill I pretty much got it figured out. However, I'm still going to take a look at the resources you guys mentioned because there is probably some good info in them.

              I do have one snag though. In the "datasource" field of META-INF/jbosscmp-jdbc.xml I am assuming that the fully qualified connection string should be supplied. For example:


              Is this the way that it's supposed to be, or is this "datasource" field for a predefined name. For example. Do I use a "nickname" for my datasource in the jbosscmp-jdbc.xml file, and map that nickname to a datasource somewhere else in the configuration?

              • 4. Re: Learning by example.
                Jon Barnett Master

                should refer to the JNDI name of the datasource. See the default jbosscmp-jdbc.xml for an example. The DefaultDS is defined in your hsqldb-ds.xml.