5 Replies Latest reply on Dec 5, 2003 9:39 AM by raja05

    XDoclet doesn't generate ejb files

    petrus

      Hi
      I use JBOSS3.2.1, XDoclet 1.1.2, eclipse 2.1.1.
      I want to buid a very simple session EJB, but XDoclet will not generate the files (only the xml files, but with no ejb declared inside). the variables ant path are good, I tried many changes but it won't work.
      Here are part of the sources :



      ModelSessionBean.java (in directory ${src.ejb.home})
      -------------------------------------------------------

      package ejb;

      import java.rmi.RemoteException;

      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;

      /**
      * @ejb.bean name="ModelSession"
      * display-name="session bean facade"
      * type="stateless"
      * transaction-type="Container"
      * jndi-name="ejb/ModelSession"
      * view-type="remote"
      *
      * @ejb.home
      * @ejb.interface
      */
      public class ModelSessionBean implements SessionBean {

      /**
      * @ejb.interface-method view-type="remote"
      * @ejb.transaction type="NotSupported"
      */

      public boolean userExists(String UserName)
      throws RemoteException {
      System.out.println("USEREXIST");
      return true;
      }



      private SessionContext _context;

      public void ejbActivate() {
      }

      public void ejbPassivate() {
      }

      public void ejbRemove() {
      }

      public void setSessionContext(SessionContext ctx) {
      _context = ctx;
      }
      }



      part of build.xml
      --------------------------------------------------------


























      ....



























      Output of ant build
      -----------------------------------

      generate-xdoclet:
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] Generating EJB deployment descriptor (ejb-jar.xml).
      [ejbdoclet] (XDocletMain.start 47 ) Running
      [ejbdoclet] Generating jboss.xml.
      BUILD SUCCESSFUL
      Total time: 6 seconds



      -------------------------
      please help !!! I can give you more details if you ask.


      Px

        • 1. Re: XDoclet doesn't generate ejb files
          raja05

          You need to have


          in the ejbdoclet tag to render Session EJB information.

          -Raj

          • 2. Re: XDoclet doesn't generate ejb files
            petrus

            I tried it but it doesn't work either. Moreover, if I declare an entity bean, no files are generated either.
            thanks anyway.

            • 3. Re: XDoclet doesn't generate ejb files
              darranl

              It looks to me as if your bean is not being seen by XDoclet at all.

              I think I can remember a while back specifying the type of the bean in lower case and getting an error saying the type was invalid. (Should have been 'Stateless')

              • 4. Re: XDoclet doesn't generate ejb files
                petrus

                I found the problem, and of course that was a stupid one : my fileset was bad.
                but there is still something I don't understand.

                ${src.ejb.home} = /src/ejb
                ${src.home} = /src

                my ModelSessionBean.java is in /src/ejb/

                CASE 1 :
                -----------





                it works :)


                CASE 2 :
                ------------





                That doesn't work.


                Why don't they describe the same files ?


                px

                • 5. Re: XDoclet doesn't generate ejb files
                  raja05

                  Because ur package name is ejb and when u specify




                  it looks for a directory called ejb and a file called *Bean.java in it which it cannot find (as ur bean is in the ejb directory). If u wanted Xdoclet to use this, create a package called ejb under ur /src/ejb folder and place the file in there.