When using a Spring baseclass as superclass for your EJB (e.g. AbstractStatelessSessionBean), XDoclet doesn't recognize such a class to be an EJB, so it is simply ignored by the "ejbdoclet" task (i.e. no code generation).

Two possible ways to fix this:

  • explicitly implement the EJB interface in your EJB:

    public class MySessionBean
    extends AbstractStatelessSessionBean
    implements javax.ejb.SessionBean

  • add Spring to XDoclet's classpath, so XDoclet is able to recognize that your class actually implements an EJB interface:

    <taskdef name="ejbdoclet"
    classpath="[XDoclet and Spring libs]"/>

Since the first solution introduces redundant code to your class, I usually take the second approach.

In Maven, add the following code to your pom.xml: