2 Replies Latest reply on Aug 6, 2004 6:08 AM by morenito9000

    Entity Deployer Error (finder method)

    morenito9000 Newbie

      Hi all,
      I defined a finder method findMalfLock() for an entity bean
      but when I try do deploy the .ear file I get this JBoss's Exception:

      2004-08-06 11:44:08,265 WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
      Bean : MalfEntity
      Method : public abstract MalfEntityLocal findMalfLock(String, Integer, boolean) throws FinderException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.
      
      2004-08-06 11:44:08,357 ERROR [org.jboss.deployment.MainDeployer] could not create deployment: file:/webdata/SPDS/jboss-3.2.3/server/xmalf/tmp/deploy/tmp42995XMALF.ear-contents/XMALF-EJB.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
      


      Here is ejb-jar.xml:

      <entity >
       <description><![CDATA[Entity CMP che mappa tabella MALF]]></description>
       <display-name>Malf Entity Bean</display-name>
      
       <ejb-name>MalfEntity</ejb-name>
      
       <local-home>server.entity.interfacce.MalfEntityLocalHome</local-home>
       <local>server.entity.interfacce.MalfEntityLocal</local>
      
       <ejb-class>server.entity.beans.MalfEntityBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>server.entity.primaryKey.MalfEntityPK</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>MalfEntity</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>prodotto</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>idMalf</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>stato</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>tipo</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>relOrig</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>sub</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[]]></description>
       <field-name>lockModif</field-name>
       </cmp-field>
      
       <resource-ref >
       <res-ref-name>jdbc/XmalfDB</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
      
       <query>
       <query-method>
       <method-name>findMalfLock</method-name>
       <method-params>
       <method-param>String</method-param>
       <method-param>Integer</method-param>
       <method-param>boolean</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(c) FROM MalfEntity c WHERE c.prodotto = ?1 AND c.idMalf = ?2 and c.lockModif = ?3]]></ejb-ql>
       </query>
       <!-- Write a file named ejb-finders-MalfEntityBean.xml if you want to define extra finders. -->
       </entity>
      


      Here is jbosscmp-jdbc.xml:

      <entity>
       <ejb-name>MalfEntity</ejb-name>
       <table-name>malf</table-name>
      
       <cmp-field>
       <field-name>prodotto</field-name>
       <column-name>prodotto</column-name>
       <not-null/>
      
       </cmp-field>
       <cmp-field>
       <field-name>idMalf</field-name>
       <column-name>id_malf</column-name>
       <not-null/>
      
       </cmp-field>
       <cmp-field>
       <field-name>stato</field-name>
       <column-name>stato</column-name>
       <not-null/>
      
       </cmp-field>
       <cmp-field>
       <field-name>tipo</field-name>
       <column-name>tipo</column-name>
       <not-null/>
      
       </cmp-field>
       <cmp-field>
       <field-name>relOrig</field-name>
       <column-name>rel_orig</column-name>
       <not-null/>
      
       </cmp-field>
       <cmp-field>
       <field-name>sub</field-name>
       <column-name>sub</column-name>
      
       </cmp-field>
       <cmp-field>
       <field-name>lockModif</field-name>
       <column-name>lock_modif</column-name>
      
       </cmp-field>
      
       <query>
       <query-method>
       <method-name>findMalfLock</method-name>
       <method-params>
       <method-param>String</method-param>
       <method-param>Integer</method-param>
       <method-param>boolean</method-param>
       </method-params>
       </query-method>
       <jboss-ql><![CDATA[SELECT OBJECT(c) FROM MalfEntity c WHERE c.prodotto = ?1 AND c.idMalf = ?2 and c.lockModif = ?3]]></jboss-ql>
       </query>
      
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->
       </entity>
      


      Here is jboss.xml:

      <entity>
       <ejb-name>MalfEntity</ejb-name>
       <local-jndi-name>ejb/MalfEntity</local-jndi-name>
       <configuration-name>XMALF CMP 2.x EntityBean</configuration-name>
       <resource-ref>
       <res-ref-name>jdbc/XmalfDB</res-ref-name>
       <jndi-name>java:/PostgresDS</jndi-name>
       </resource-ref>
      
       <method-attributes>
       </method-attributes>
      
       </entity>
      


      Many thanks in advance for any helps
      Moreno