3 Replies Latest reply on Jul 2, 2004 3:51 AM by aloubyansky

    JBoss ignores Xdoclet taged finder functions in Home interfa

    christianrudiger

      I am generating a finder method via XDoclet, and inhert it into two other classes.
      The ejb-jar.xml is generated correctly, but when i tra to deploy my package i am getting an
      EJB spec violation warning. The XDoclet-Tags and the Warnings as well as a part of ejb-jar.xml are appended.
      Can anyone help me with this? I am nearly gettin' mad about this.

      regards Christian


      /**
      * @ejb.bean name="DeviceRecord" type="CMP" description="abstract db-representation
      * of a network device" primkey-field="id" view-type="local" cmp-version="2.x"
      * schema="DeviceRecord" local-jndi-name="DeviceRecordLocal"
      *
      * @ejb.persistence table-name="core_devices"
      *
      * @ejb.finder
      * signature="java.util.Collection findAllDevices( )"
      * query="SELECT * Object(p) FROM DeviceRecord AS p"
      * view-type="local"
      * method-intf="LocalHome"
      * result-type-mapping="Local"
      *
      * @jboss.entity-command name="get-generated-keys"
      *
      */
      public abstract class DeviceBean implements EntityBean {

      ...


      /**
      *
      * @ejb.bean name="FTPDeviceRecord" type="CMP" description="db-representation
      * of a network device" primkey-field="id" view-type="local" cmp-version="2.x"
      * schema="FTPDeviceRecord" local-jndi-name="FTPDeviceRecordLocal"
      *
      * @ejb.home local-extends="javax.ejb.EJBLocalHome"
      *
      * @ejb.interface local-extends="vmdb.db.interfaces.DeviceRecordLocal"
      *
      * @ejb.persistence table-name="ftp_devices"
      *
      * @jboss.entity-command name="get-generated-keys"
      */
      public abstract class FTPDeviceBean extends DeviceBean {
      ...


      /**
      *
      * @ejb.bean name="FTAMDeviceRecord" type="CMP" description="db-representation
      * of a network FTAM device" primkey-field="id" view-type="local" cmp-version="2.x"
      * schema="FTAMDeviceRecord" local-jndi-name="FTAMDeviceRecordLocal"
      *
      * @ejb.persistence table-name="ftam_devices"
      *
      * @ejb.home local-extends="javax.ejb.EJBLocalHome"
      *
      * @ejb.interface local-extends="vmdb.db.interfaces.DeviceRecordLocal"
      *
      * @jboss.entity-command name="get-generated-keys"
      *
      */
      public abstract class FTAMDeviceBean extends DeviceBean {
      ...


      Bean : FTAMDeviceRecord
      Method : public abstract Collection findAllFTAMDevices() throws FinderException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

      11:35:29,390 WARN [verifier] EJB spec violation:
      Bean : FTPDeviceRecord
      Method : public abstract Collection findAllFTPDevices() throws FinderException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

      11:35:29,437 WARN [verifier] EJB spec violation:
      Bean : DeviceRecord
      Method : public abstract Collection findAllDevices() throws FinderException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.


      <ejb-jar >
      <![CDATA[No Description.]]>
      <display-name>Generated by XDoclet</display-name>
      <enterprise-beans>

      <![CDATA[db-representation of a network FTAM device]]>
      <ejb-name>FTAMDeviceRecord</ejb-name>

      ...


      <query-method>
      <method-name>findAllDevices</method-name>
      <method-params>
      <method-param></method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT * Object(p) FROM DeviceRecord AS p]]></ejb-ql>




      <![CDATA[db-representation of a network device]]>
      <ejb-name>FTPDeviceRecord</ejb-name>

      ...


      <query-method>
      <method-name>findAllDevices</method-name>
      <method-params>
      <method-param></method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT * Object(p) FROM DeviceRecord AS p]]></ejb-ql>




      <![CDATA[abstract db-representation of a network device]]>
      <ejb-name>DeviceRecord</ejb-name>

      ...


      <query-method>
      <method-name>findAllDevices</method-name>
      <method-params>
      <method-param></method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT * Object(p) FROM DeviceRecord AS p]]></ejb-ql>


        • 1. Re: JBoss ignores Xdoclet taged finder functions in Home int
          aloubyansky

          Home interfaces should declare the finders or inherit from superinterfaces.

          • 2. Re: JBoss ignores Xdoclet taged finder functions in Home int
            christianrudiger

            Thank you,
            by now the interfaces and the eyb-jar.xml file are correct. I have added
            the correct XDoclet header below.
            But I am afraid the deployment problem is not fixed yet.
            I have deleted the tmp-directory. regenerated my sources and descriptors,
            rebuild my source, packaged my jar, controled whether it contains the correct files and tried to deploy it.
            ... but it didnt work.
            The strange thing about the errormessage is that it referres to finders which are no longer in the code (findAllFTAMDevices(), findAllFTPdevices() ).
            I had them in there, but deleted them a few hours ago to find the source of another deployment error. A plaintext search on the build and sourcefiles
            affirmed me, that there is no longer a findAllFTAMDevices() or findAllFTPDevices() method.

            Any idea what mystc thing has infected my JBoss?

            regards Christian

            /**
             * @ejb.bean name="DeviceRecord" type="CMP" description="abstract db-representation
             * of a network device" primkey-field="id" view-type="local" cmp-version="2.x"
             * schema="DeviceRecord" local-jndi-name="DeviceRecordLocal"
             *
             * @ejb.persistence table-name="core_devices"
             *
             * @ejb.finder
             * signature="java.util.Collection findAllDevices( )"
             * query="SELECT * Object(p) FROM DeviceRecord AS p"
             * view-type="local"
             * method-intf="LocalHome"
             * result-type-mapping="Local"
             *
             * @jboss.entity-command name="get-generated-keys"
             */
            public abstract class DeviceBean implements EntityBean {
            ...
            
            /**
             *
             * @ejb.bean name="FTPDeviceRecord" type="CMP" description="db-representation
             * of a network device" primkey-field="id" view-type="local" cmp-version="2.x"
             * schema="FTPDeviceRecord" local-jndi-name="FTPDeviceRecordLocal"
             *
             * @ejb.home local-extends="javax.ejb.EJBLocalHome"
             *
             * @ejb.interface local-extends="vmdb.db.interfaces.DeviceRecordLocal"
             *
             * @ejb.finder signature="java.util.Collection findAllDevices( )"
             *
             * @ejb.persistence table-name="ftp_devices"
             *
             * @jboss.entity-command name="get-generated-keys"
             */
            public abstract class FTPDeviceBean extends DeviceBean {
            ...
            
            /**
             *
             * @ejb.bean name="FTAMDeviceRecord" type="CMP" description="db-representation
             * of a network FTAM device" primkey-field="id" view-type="local" cmp-version="2.x"
             * schema="FTAMDeviceRecord" local-jndi-name="FTAMDeviceRecordLocal"
             *
             * @ejb.persistence table-name="ftam_devices"
             *
             * @ejb.home local-extends="javax.ejb.EJBLocalHome"
             *
             * @ejb.finder signature="java.util.Collection findAllDevices( )"
             *
             * @ejb.interface local-extends="vmdb.db.interfaces.DeviceRecordLocal"
             *
             * @jboss.entity-command name="get-generated-keys"
             */
            public abstract class FTAMDeviceBean extends DeviceBean {
            ...
            


            Bean : FTAMDeviceRecord
            Method : public abstract Collection findAllFTAMDevices() throws FinderException
            Section: 10.5.6
            Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

            15:52:26,515 WARN [verifier] EJB spec violation:
            Bean : FTPDeviceRecord
            Method : public abstract Collection findAllFTPDevices() throws FinderException
            Section: 10.5.6
            Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

            15:52:26,546 WARN [verifier] EJB spec violation:
            Bean : DeviceRecord
            Method : public abstract Collection findAllDevices() throws FinderException
            Section: 10.5.6
            Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

            • 3. Re: JBoss ignores Xdoclet taged finder functions in Home int
              aloubyansky

              If you deploy the up-to-date home interfaces then perhaps there old once somewhere in JBoss classpath.