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"
    classname="xdoclet.modules.ejb.EjbDocletTask"
    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:



...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xdoclet-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-remoting</artifactId>
<version>1.2.8</version>
</dependency>
</dependencies>
<executions>
...
</executions>
</plugin>
...