This worked with an older cvs version, now (with the latest version from 
cvs) i get the follwing error (the last file being generated is attached):

[ejbdoclet] Generating Local interface for 
'br.com.sicredi.cobranca.servidor.ejb.PracaCobrancaEJB'.
[ejbdoclet] (TemplateEngine.invokeMethod         490 ) Invoking method 
failed: xdoclet.modules.ejb.intf.InterfaceTagsHandler.extendsFrom, 
line=10 of template file: 
jar:file:/home/emersonc/eclipse/workspace/Fontes/lib_build/xdoclet-ejb-module.jar!/xdoclet/modules/ejb/intf/resources/local.xdt
[ejbdoclet] java.lang.reflect.InvocationTargetException
[ejbdoclet]     at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown 
Source)
[ejbdoclet]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet]     at java.lang.reflect.Method.invoke(Method.java:324)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:584)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:483)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.invokeContentMethod(TemplateEngine.java:563)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:428)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:324)
[ejbdoclet]     at 
xdoclet.template.TemplateEngine.start(TemplateEngine.java:373)
[ejbdoclet]     at 
xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:559)
[ejbdoclet]     at 
xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:765)
[ejbdoclet]     at 
xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:665)
[ejbdoclet]     at 
xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:592)
[ejbdoclet]     at xdoclet.TemplateSubTask.execute(TemplateSubTask.java:484)
[ejbdoclet]     at xdoclet.XDocletMain.start(XDocletMain.java:46)
[ejbdoclet]     at xdoclet.DocletTask.start(DocletTask.java:458)
[ejbdoclet]     at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:68)
[ejbdoclet]     at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
[ejbdoclet]     at org.apache.tools.ant.Task.perform(Task.java:317)
[ejbdoclet]     at org.apache.tools.ant.Target.execute(Target.java:309)
[ejbdoclet]     at org.apache.tools.ant.Target.performTasks(Target.java:334)
[ejbdoclet]     at 
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[ejbdoclet]     at 
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
[ejbdoclet]     at org.apache.tools.ant.Main.runBuild(Main.java:610)
[ejbdoclet]     at org.apache.tools.ant.Main.start(Main.java:196)
[ejbdoclet]     at org.apache.tools.ant.Main.main(Main.java:235)
[ejbdoclet] Caused by: java.lang.NullPointerException
[ejbdoclet]     at 
xdoclet.modules.ejb.EjbTagsHandler.extendsFromFor(EjbTagsHandler.java:831)
[ejbdoclet]     at 
xdoclet.modules.ejb.intf.InterfaceTagsHandler.extendsFrom(InterfaceTagsHandler.java:560)
[ejbdoclet]     ... 26 more
[ejbdoclet] (XDocletMain.start                   51  ) Running XDoclet 
failed.
[ejbdoclet] (XDocletMain.start                   52  ) <<Running XDoclet 
failed.>>
[ejbdoclet] xdoclet.template.TemplateException: Invoking method in class 
xdoclet.modules.ejb.intf.InterfaceTagsHandler failed: extendsFrom, 
line=10 of template file: 
jar:file:/home/emersonc/eclipse/workspace/Fontes/lib_build/xdoclet-ejb-module.jar!/xdoclet/modules/ejb/intf/resources/local.xdt,
 
exception: null

-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Emerson Cargnin          |
| Analista de Sistemas Sr. |
| Tel : (051) 3358-4959    |
| SICREDI Servi�os         |
| Porto Alegre - Brasil    |
|xxxxxxxxxxxxxxxxxxxxxxxxxx|
package br.com.sicredi.cobranca.servidor.ejb;

import java.util.ArrayList;
import java.util.Collection;

import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.FinderException;

import br.com.sicredi.cadastro.servidor.ejb.BancoLocal;
import br.com.sicredi.cadastro.servidor.ejb.MunicipioLocal;
import br.com.sicredi.cadastro.servidor.ejb.PACLocal;
import br.com.sicredi.cobranca.ambos.vo.FiltroPracaVO;
import br.com.sicredi.fw.servidor.ejb.FWEntityEJB;
import br.com.sicredi.fw.servidor.keygen.Key;

/** 
 * @author Andriei Ramos Duarte
 * 
 * @ejb:bean
 *          type="CMP"
 *          cmp-version="2.x"
 *          name="PracaCobranca"
 *          jndi-name="local/PracaCobranca"
 *          view-type="local"
 *          schema="PracasCobranca"
 *          primkey-field="oid"
 *  
 * @ejb:permission 
 *          role-name="All"
 * 
 * @ejb:pk 
 *          class="java.lang.Long" 
 *          generate="false"
 * 
 * @ejb:home 
 *          generate="local"
 * 
 * @ejb:interface 
 *          generate="local"
 * 
 * @ejb:finder
 *    signature="java.util.Collection findAll()"
 *    unchecked="true"
 *    query="select OBJECT(b) from PracasCobranca b"
 *    result-type-mapping="Local"
 * 
 * @ejb:select
 *    signature="java.util.Set ejbSelectGeneric(java.lang.String jbossql, 
java.lang.Object[] arguments)"
 *    query=""   
 *        result-type-mapping="Local"   
 *
 * @jboss:query signature="java.util.Set ejbSelectGeneric(java.lang.String jbossql, 
java.lang.Object[] arguments)" dynamic="true"
 *
 * @jboss:table-name 
 *          table-name="PRACA_COBRANCA"
 * 
 * @jboss:create-table 
 *          create="true"
 * 
 * @jboss:remove-table 
 *          remove="false"
 */
public abstract class PracaCobrancaEJB extends FWEntityEJB implements EntityBean { 
//implements PracaCobrancaInterface

    private EntityContext ctx;
    /**
     * Get the Bank
     * 
     * @return a BancoLocal with the Bank
     * 
     * @ejb:interface-method
     * @ejb:relation  
     *          name="Banco-PracaCobranca"
     *          role-name="uma-PracaCobranca-tem-um-Banco" 
     *                  target-multiple="yes"
     *          target-ejb="Banco" 
     *          target-role-name="um-Banco-para-uma-PracaCobranca"
     * 
     * @jboss:relation
     *          related-pk-field="oid"
     *          fk-column="ID_BANCO"
     * 
     * @jboss:column-name name="ID_BANCO"
     * @jboss:sql-type type="NUMBER(32) "
     * @jboss:jdbc-type type="BIGINT"
     */
    public abstract BancoLocal getBanco();

    /**
     * Set the Bank
     * 
     * @param newBanco a BancoLocal with new Banco to set
     * 
     * @ejb:interface-method
     */
    public abstract void setBanco(BancoLocal newBanco);

    /**
     * Get PAC from PracaCobranca
     * 
     * @return a PACLocal with the PAC from PracaCobranca
     * 
     * @ejb:interface-method
     * @ejb:relation  
     *          name="PAC-PracaCobranca"
     *          role-name="uma-PAC-tem-uma-PracaCobranca" 
     *          target-multiple="yes"
     *                  target-ejb="PAC"
     *          target-role-name="uma-PracaCobranca-tem-uma-PAC"
     * @jboss:relation
     *           related-pk-field="oid"
     *           fk-column="ID_PAC"
     * @jboss:column-name name="ID_PAC"
     * @jboss:sql-type type="NUMBER(32)"
     * @jboss:jdbc-type type="BIGINT"
     */
    public abstract PACLocal getPAC();

    /**
     * Set the PAC
     * 
     * @param newPAC a PACLocal with new PAC to set
     * 
     * @ejb:interface-method
     */
    public abstract void setPAC(PACLocal newPAC);

    /**
     * Get the Municipy
     * 
     * @return a MunicipioLocal with the Municipy
     * 
     * @ejb:interface-method 
     * @ejb:relation  
     *          name="Municipio-PracaCobranca"
     *          role-name="uma-PracaCobranca-para-um-Municipio" 
     *          
     * @jboss:relation
     *           related-pk-field="oid"
     *           fk-column="ID_MUNICIPIO"
     * @jboss:column-name name="ID_MUNICIPIO"
     * @jboss:sql-type type="NUMBER(32)"
     * @jboss:jdbc-type type="BIGINT"
     */
    public abstract MunicipioLocal getMunicipio();

    /**
     * Set the Municipy
     * 
     * @param newMunicipy a MunicipioLocal with new Municipy to set
     * 
     * @ejb:interface-method 
     */
    public abstract void setMunicipio(MunicipioLocal newMunicipio);

    /**
     * Get the Praca Situation
     * 
     * @return a Integer with the Praca Situation value
     * 
     * @ejb:persistent-field
     * @ejb:interface-method
     * 
     * @jboss:column-name name="SIT_PRACA"
     * @jboss:sql-type type="NUMBER(2)"
     * @jboss:jdbc-type type="INTEGER"
     */
    public abstract Integer getSitPraca();

    /**
     * Set the Praca Situation
     * 
     * @param newSitPraca a Integer with new Praca Situation to set
     * 
     * @ejb:interface-method
     */
    public abstract void setSitPraca(Integer newSitPraca);

    /**
     * Get the Object ID value
     *
     * @return a Long with Object ID value
     *
     * @ejb:pk-field
     * @ejb:interface-method
     * @ejb:persistent-field
     * 
     * @jboss:column-name name="ID"
     * @jboss:sql-type type="NUMBER(32)"
     * @jboss:jdbc-type type="BIGINT"
     */
    public abstract Long getOid();

    /**
     * Set the Object ID value
     *
     * @param newOid a Long with Object ID value
     *
     * @ejb:interface-method
     */
    public abstract void setOid(Long newOid);

    /**
     * Create a new EJB
     *
     * @return a Long with Object ID value
     *
     * @ejb:create-method
     */
    public Long ejbCreate() throws CreateException {
      Key key = new Key();
      this.setOid(key.getGeneratedKey());
        return this.getOid();

    }

    /**
     * Create a new EJB
     *
     * @param newOid a Long with the Object ID value
     * @return a Long with Object ID value
     *
     * @ejb:create-method
     * @ejb:permission unchecked="true"
     */
    public Long ejbCreate(Long newOid) throws CreateException {
        this.setOid(newOid);
        return getOid();
    }

    public void ejbPostCreate() {}

    public void ejbPostCreate(Long l) {}

    //Metodos para dynamic-ql

    public abstract java.util.Set ejbSelectGeneric(String jbossql, Object[] arguments) 
throws javax.ejb.FinderException;

    /**
     * @ejb.home-method
     */

    public Collection ejbHomeFindByFiltro(FiltroPracaVO filtro) throws FinderException 
{

        StringBuffer query = new StringBuffer();

        query.append("SELECT object(p)");
        query.append(" FROM PracasCobranca p");
        
        ArrayList args = new ArrayList();
        int cont = 1;
        if (filtro.getOidUf() != null) {
            query.append(" AND p.municipio.uF.oid = ?" + cont);
            args.add(filtro.getOidUf());
            cont++;
        }
        if (filtro.getOidMunicipio() != null) {
            query.append(" AND p.municipio.oid = ?" + cont);
            args.add(filtro.getOidMunicipio());
            cont++;
        }
        if (filtro.getOidBanco() != null) {
            query.append(" AND p.banco.oid = ?" + cont);
            args.add(filtro.getOidBanco());
            cont++;
        }
        if (filtro.getOidAgencia() != null) {
            query.append(" AND p.pAC.agencia.oid = ?" + cont);
            //                  query.append(" OR p.agencia.oid = " + 
filtro.getOidAgencia().toString()+')');
            args.add(filtro.getOidAgencia());
            cont++;
        }
        if (filtro.getSituacao() != null) {
            query.append(" AND p.sitPraca = ?" + cont);
            args.add(filtro.getSituacao());
            cont++;
        }
        if (filtro.getCep() != null) {
            query.append(" AND (p.municipio.faixaCEP.numInicio <= ?" + cont);
            query.append(" AND p.municipio.faixaCEP.numFim >= ?" + cont + ")"); 
            args.add(filtro.getCep());
            cont++;
        }

        int i = -1;
        if ((i = query.indexOf("AND")) > -1)
            query.replace(i, i + 3, "WHERE");

        return ejbSelectGeneric(query.toString(), args.toArray());
    }

    public void setEntityContext(EntityContext ctx) {
        super.setEntityContext(ctx);
        this.ctx = ctx;
    }

} // end PracaCobrancaEJB

Reply via email to