You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by langlois yan <la...@yahoo.fr> on 2006/04/19 21:28:19 UTC

Re : [m2] Xdoclet fails

Hi,

If you want your EJB to implement AbstractStatelessSessionBean (from spring framework) you have to declare spring as a dependency of your xdoclet plugin. Your POM must look like that :

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xdoclet-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>xdoclet</goal>
            </goals>
            <configuration>
              <tasks>
                <ejbdoclet
                  destDir="${project.build.directory}/generated-sources/xdoclet"
                  excludedtags="@version,@author"
                  force="true"
                  verbose="true">
                  <fileset dir="${basedir}/src/main/java" includes="**/*Bean.java"/>
                  <remoteinterface/>
                  <homeinterface/>
                  <localinterface/>
                  <localhomeinterface/>
                </ejbdoclet>
              </tasks>
            </configuration>
          </execution>
        </executions>
        <dependencies>
             <dependency>
                       <groupId>org.springframework</groupId>
                       <arctefactId>spring</arctefactId>
                       <version>1.2.6</version> <!-- for example -->
             </dependency>
        </dependencies>
</plugin>



Yan.

----- Message d'origine ----
De : J-F Daune <da...@daune-consult.com>
À : Maven Users List <us...@maven.apache.org>
Envoyé le : Mercredi, 19 Avril 2006, 5h51mn 31s
Objet : Re: [m2] Xdoclet fails


> Ok.
>
> You're telling xdoclet to generate local/remote/home/localhome interfaces.
> Did you specify @ejb.home etc. too in the *Bean.java sources?
>
> -- Kenney
>
>   

Kenney,

thank you for your time.

Here is the class:

package be.banksys.tams.logic;

import javax.ejb.CreateException;

import org.springframework.ejb.support.AbstractStatelessSessionBean;

/**
 * @ejb.bean
 *   name="TestService"
 *   description="Test service"
 *   local-jndi-name="ejb/local/tams/TestService"
 *   jndi-name="ejb/tams/TestService"
 *   type="Stateless"
 *   view-type="both"
 * @ejb.interface
 *   extends="javax.ejb.EJBObject"
 *   local-extends="javax.ejb.EJBLocalObject, 
be.banksys.tams.logic.TestService"
 * @ejb.home
 *   extends="javax.ejb.EJBHome"
 *   local-extends="javax.ejb.EJBLocalHome"
 */
public class TestServiceBean extends AbstractStatelessSessionBean 
implements TestService {

    private TestService delegate;

    /**
     * @ejb.interface-method
     *   view-type="both"
     */
    public String echo(String s) {
        return delegate.echo(s);
    }

    protected void onEjbCreate() throws CreateException {
        delegate = (TestService ) getBeanFactory().getBean("testService");
    }
  
}

>> For info, here is the log:
>>
>> [INFO] [xdoclet:xdoclet {execution: default}]
>> [INFO] Initializing DocletTasks!!!
>> [INFO] Executing tasks
>> 19-avr.-2006 16:24:05 xdoclet.XDocletMain start
>> INFO: Running <remoteinterface/>
>> 19-avr.-2006 16:24:05 xdoclet.XDocletMain start
>> INFO: Running <homeinterface/>
>> 19-avr.-2006 16:24:05 xdoclet.XDocletMain start
>> INFO: Running <localinterface/>
>> 19-avr.-2006 16:24:05 xdoclet.XDocletMain start
>> INFO: Running <localhomeinterface/>
>> INFO:    Some classes refer to other classes that were not found among
>> the sourc
>> es or on the classpath.
>>          (Perhaps the referred class doesn't exist? Hasn't been
>> generated yet?)
>>          The referring classes do not import any fully qualified classes
>> matchin
>> g these classes.
>>          However, since no packages are imported, xjavadoc has assumed
>> that the
>> referred classes
>>          belong to the same package as the referring class. The classes are:
>> F:\common\projects\m2\logic\ejb\src\main\java\be\banksys\tams\logic\TestServiceB
>> ean.java --> TestService qualified to be.banksys.tams.logic.TestService
>> [INFO] Executed tasks
>>
>>     
>>> On Wed, 19 Apr 2006, J-F Daune wrote:
>>>
>>> I don't know what the output is you get, but I think you have to add
>>> an <mkdir dir="${project.build.directory}/generated-sources/xdoclet"/>
>>> before the ejbdoclet tag.
>>>
>>> I'm hoping to streamline this in future versions.
>>>
>>> -- Kenney
>>>
>>>
>>>       
>>>> Hi,
>>>>
>>>> I am starting with M2, and am trying to use XDoclet to generate EJB stuff.
>>>>
>>>> I followed instructions found on this mailing list, and declare this:
>>>>
>>>>  <build>
>>>>    <plugins>
>>>>      <plugin>
>>>>        <groupId>org.apache.maven.plugins</groupId>
>>>>        <artifactId>maven-ejb-plugin</artifactId>
>>>>        <configuration>
>>>>           <generateClient>true</generateClient>
>>>>        </configuration>
>>>>      </plugin>
>>>>
>>>>      <plugin>
>>>>        <groupId>org.codehaus.mojo</groupId>
>>>>        <artifactId>xdoclet-maven-plugin</artifactId>
>>>>        <executions>
>>>>          <execution>
>>>>            <phase>generate-sources</phase>
>>>>            <goals>
>>>>              <goal>xdoclet</goal>
>>>>            </goals>
>>>>            <configuration>
>>>>              <tasks>
>>>>                <ejbdoclet
>>>>
>>>> destDir="${project.build.directory}/generated-sources/xdoclet"
>>>>                  excludedtags="@version,@author"
>>>>                  force="true"
>>>>                  verbose="true">
>>>>                  <fileset dir="${basedir}/src/main/java"
>>>> includes="**/*Bean.java"/>
>>>>                  <remoteinterface/>
>>>>                  <homeinterface/>
>>>>                  <localinterface/>
>>>>                  <localhomeinterface/>
>>>>                </ejbdoclet>
>>>>              </tasks>
>>>>            </configuration>
>>>>          </execution>
>>>>        </executions>
>>>>      </plugin>
>>>>    </plugins>
>>>>  </build>
>>>>
>>>>
>>>> I have a TestServiceBean.java declaring ejb.bean and one
>>>> ejb.interface-method.
>>>>
>>>> Unfortunately, when invoking mvn package, no code is generated.
>>>>
>>>> Any help is welcome, as for me, everything has been configured correctly.
>>>>
>>>> Cheers,
>>>>
>>>> J-F
>>>>
>>>> ---------------------------------------------------------------------
>>>>         


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org