facebook

XDoclet generates empty Remote interface [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #198021 Reply

    ErikEngerd
    Member

    Hi,

    I have a session bean with one method tagged with

    @ejb.interface-method view-type = “remote”

    When running xdoclet from my eclipse workbench, a remote interface is generated that does not contain any methods. The XDoclet output does not show any errors. As usual, I cannot get XDoclet to give me more information. I have already set the “verbose” property in the ejbdoclet configuration to “true”.

    What is wrong?

    Cheers
    Erik

    Session bean source file:

    /*
    * Created on Aug 13, 2003
    *
    * To change the template for this generated file go to
    * Window&Preferences&Java&Code Generation&Code and Comments
    */
    package mybeans.session;

    import javax.ejb.CreateException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import javax.sql.DataSource;

    import mybeans.interfaces.HelloWorld;
    import mybeans.interfaces.HelloWorldHome;

    /**
    * @author Erik
    *
    * To change the template for this generated type comment go to
    * Window&Preferences&Java&Code Generation&Code and Comments
    */

    /**
    * XDoclet-based stateless session bean. The class must be declared
    * <code>public</code>, according to the EJB specification.<br>
    *
    * To generate code:
    * <br>
    * <ul>
    * <li> Add Standard EJB module to XDoclet project properties
    * <li> Customize XDoclet configuration
    * <li> Run XDoclet
    * </ul>
    * <br>
    * Please see the included XDoclet Overview
    * and the XDoclet Reference in the help system for details
    *
    * @ejb.bean name = “StatefulSession”
    * type = “Stateful”
    * display-name = “StatefulSessionBean”
    * description = “StatefulSessionBean EJB”
    * view-type = “remote”
    * jndi-name = “ejb/StatefulSessionBeanHome”
    */
    public class StatefulSessionBean implements SessionBean {

    /** The SessionContext */
    private SessionContext context;

    /**
    * An <code>ejbCreate</code> method as required by the EJB specification. <br>
    *
    * The container calls the instance’s <code>ejbCreate</code> method whose
    * signature matches the signature of the <code>create</code> method invoked
    * by the client. The input parameters sent from the client are passed to
    * the <code>ejbCreate</code> method. Each session bean class must have at
    * least one <code>ejbCreate</code> method. The number and signatures
    * of a session bean’s <code>create</code> methods are specific to each
    * session bean class.
    *
    * @throws CreateException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    *
    * @ejb.create-method
    */
    public void ejbCreate(String arg) throws CreateException {

    }

    /**
    * The <code>ejbActivate()</code> method as required by the EJB specification.<br>
    *
    * The activate method is called when the instance is activated from its
    * passive” state. The instance should acquire any resource that it has
    * released earlier in the <code>ejbPassivate()</code> method. <br>
    *
    * This method is called with no transaction context.
    *
    * @throws EJBException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    */
    public void ejbActivate() throws EJBException {
    System.out.println(“ejbActivate() called”);
    }

    /**
    * The <code>ejbPassivate()</code> method as required by the EJB specification.<br>
    *
    * The activate method is called when the instance is activated from
    * its “passive” state. The instance should acquire any resource that
    * it has released earlier in the <code>ejbActivate()</code> method. <br>
    *
    * This method is called with no transaction context.
    *
    * @throws EJBException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    */
    public void ejbPassivate() throws EJBException {
    System.out.println(“ejbPassivate() called”);
    }

    /**
    * The <code>ejbRemove()</code> method as required by the EJB specification.<br>
    *
    * A container invokes this method before it ends the life of the
    * session object. This happens as a result of a client’s invoking
    * a remove operation, or when a container decides to terminate the
    * session object after a timeout. <br>
    *
    * This method is called with no transaction context.
    *
    * @throws EJBException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    */
    public void ejbRemove() throws EJBException {
    System.out.println(“ejbRemove() called”);
    }

    /**
    * Set the associated session context. The container calls this method
    * after the instance creation. <br>
    *
    * The enterprise bean instance should store the reference to the context
    * object in an instance variable. <br>
    *
    * This method is called with no transaction context.
    *
    * @throws EJBException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    */
    public void setSessionContext(SessionContext newContext)
    throws EJBException {
    System.out.println(“Setting session context.”);
    context = newContext;
    }

    /*
    * An example business method
    *
    * @ejb.interface-method view-type = “remote”
    *
    * @throws EJBException Thrown if the instance could not perform
    * the function requested by the container because of an system-level error.
    */
    public void blabla(int i) throws EJBException {
    }

    }

    Generated remote interface:

    /*
    * Generated by XDoclet – Do not edit!
    */
    package mybeans.interfaces;

    /**
    * Remote interface for StatefulSession.
    * @xdoclet-generated at ${TODAY}
    * @copyright The XDoclet Team
    * @author XDoclet
    * @version ${version}
    */
    public interface StatefulSession
    extends javax.ejb.EJBObject
    {

    }

    #198022 Reply

    ErikEngerd
    Member

    Hi,

    I already know what’s wrong. I accidentally removed one asterisk so
    that the javadoc style comment ‘/** … */’ was replaced by ‘/* … */’ causing xdoclet to skip it.

    Nevertheless, an additional verbosity level in xdoclet would be nice. For instance, it could give some additional information for every method it encounters.

    Cheers
    Erik

    #198026 Reply

    Scott Anderson
    Participant

    Erik,

    I’m glad you figured this out and are off and running again.

    Nevertheless, an additional verbosity level in xdoclet would be nice.

    I agree completely. The place to ask for the feature is at http://xdoclet.sourceforge.net, although I’ve got to think they’ve already got an enhancement request to this effect. If they don’t, they should.

    –Scott
    MyEclipse Support

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: XDoclet generates empty Remote interface [Closed]

You must be logged in to post in the forum log in