0 Replies Latest reply on Jul 4, 2005 8:13 PM by heder oliveira

    Local home interface does not have the method findByPrimaryK

    heder oliveira Newbie

      I have a problem with one of my CMP EJBs:

      jboss-4.0.0

      On deployment got the following Errors:

      ObjectName: jboss.j2ee:jndiName=LogOffline,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Local home interface does not have the method findByPrimaryKey(java.lang.Long)

      However my Local Home Interface does have the method.

      package logoffline.ejb.cmp;
      
      import java.sql.Timestamp;
      import java.util.Collection;
      
      import javax.ejb.CreateException;
      import javax.ejb.EJBLocalHome;
      import javax.ejb.FinderException;
      
      import logoffline.vo.VOLogOffline;
      
      /**
       *
       * @author hmo
       *
       */
      public interface LogOfflineHome extends EJBLocalHome {
      
       /**
       * Criar instância baseando-se em VO
       * @param voLogoffline
       * @return
       * @throws CreateException
       */
       public LogOffline create(VOLogOffline voLogoffline) throws CreateException;
      
       /**
       * Retorna todo o log
       * Atenção: pode gerar stack overflow
       * @return
       * @throws FinderException
       */
       public Collection findAll() throws FinderException;
      
       /**
       * Obter um log específico
       * @param dtQuando
       * @return
       * @throws FinderException
       */
       public LogOffline findByPrimaryKey(Long LID) throws FinderException;
      
       /** TODO: método para filtrar busca no log com data início e fim*/
      }


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC
      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
       <display-name>LogOffLine</display-name>
       <description>Manipular dados da TB_LOG_OFFLINE</description>
       <enterprise-beans>
       <entity>
       <display-name>LogOffline</display-name>
       <ejb-name>LogOffline</ejb-name>
       <local-home>logoffline.ejb.cmp.LogOfflineHome</local-home>
       <local>logoffline.ejb.cmp.LogOffline</local>
       <ejb-class>logoffline.ejb.cmp.LogOfflineBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.Long</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>TB_LOG_OFFLINE</abstract-schema-name>
       <cmp-field>
       <field-name>LID</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>dtQuando</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>dsMsg</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>nmApp</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>nmQtd</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>cdPrefeitura</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>cdEmpresa</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>nmVersao</field-name>
       </cmp-field>
       <primkey-field>LID</primkey-field>
       <query>
       <query-method>
       <method-name>findAll</method-name>
       <method-params/>
       </query-method>
       <ejb-ql>SELECT OBJECT(x) FROM TB_LOG_OFFLINE x</ejb-ql>
       </query>
       <!--
       <query>
       <query-method>
       <method-name>findByPrimaryKey</method-name>
       <method-params>
       <method-param>java.lang.Long</method-param>
       </method-params>
       </query-method>
       <ejb-ql>SELECT OBJECT(d) FROM TB_LOG_OFFLINE d where d.ID=?1</ejb-ql>
       </query>
       -->
       </entity>
       </enterprise-beans>
      
       <assembly-descriptor>
       <container-transaction>
       <method>
       <description />
       <ejb-name>LogOffline</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      </ejb-jar>