3 Replies Latest reply on Oct 10, 2003 8:00 AM by tkeeber

    XDoclet/JBoss problems

    tkeeber Newbie

      Hi all,

      I'm trying to use XDoclet and Ant to build and complile my EJBs for JBoss. I have put my XDoclet tags into my EJb's. I'm using JBoss 3.2.1.

      However i'm having some problems when compiling,
      I get the error message below for every EJB i have!
      i'm oblivously missing something, but can't find what.

      Here's the error
      C:\EJBBuild_JBoss\aps\src\com\ims\aps\reference\sessions\MachineAccessBean.java:342: findByPrimaryKey(com.ims.aps.entities.reference.AttributeBeanPK
      ) in com.ims.aps.entities.reference.AttributeHome cannot be applied to (java.lang.String)
      [javac] Attribute attr = attributeHome.findByPrimaryKey(machineGroup
      AttributeVal.getAttributeCode());
      [javac]

      Here's a example of the XDoclet tags for this error:

      /**
      * XDoclet tags
      *
      * @ejb:bean name = "AttributeBean"
      * local-jndi-name="Attribute"
      * cmp_version="2.x"
      * schema="AttributeSchema"
      * view-type="local"
      * type="CMP"
      *
      * @ejb:home generate="local"
      * local-pattern="AttributeHome"
      * @ejb:interface generate="local"
      * local-pattern="Attribute"
      *
      * @ejb:transaction type="Required"
      *
      * @ejb:finder signature="java.util.Collection findAllAttribute()"
      * query="SELECT OBJECT(o) FROM AttributeSchema AS o ORDER BY o.attributeCode"
      * @ejb:finder signature="java.util.Collection findByType(String type)"
      * query="SELECT OBJECT(o) FROM AttributeSchema AS o WHERE o.attributeType=?1"
      * @ejb:finder signature="java.util.Collection findByType(String type)"
      * query="SELECT OBJECT(o) FROM AttributeSchema AS o WHERE o.attributeType=?1"
      *
      * @jboss:container-configuration name="IIOP CMP 2.x EntityBean"
      *
      *
      *
      * @jboss:cmp-field field-name="attributeCode" column-name="ATTRIBUTE_CODE"
      * @jboss:cmp-field field-name="description" column-name="DESCRIPTION"
      * @jboss:cmp-field field-name="attributeType" column-name="ATTRIBUTE_TYPE"
      * @jboss:cmp-field field-name="attributeGroup" column-name="ATTRIBUTE_GROUP"
      * @jboss:cmp-field field-name="valueUnit" column-name="VALUE_UNIT"
      * @jboss:cmp-field field-name="valueRange1" column-name="VALUE_RANGE1"
      * @jboss:cmp-field field-name="valueRange2" column-name="VALUE_RANGE2"
      * @jboss:cmp-field field-name="dimensionUnit" column-name="DIMENSION_UNIT"
      * @jboss:cmp-field field-name="dimension1Range1" column-name="DIMENSION1_RANGE1"
      * @jboss:cmp-field field-name="dimension1Range2" column-name="DIMENSION1_RANGE2"
      * @jboss:cmp-field field-name="dimension2Range1" column-name="DIMENSION2_RANGE1"
      * @jboss:cmp-field field-name="dimension2Range2" column-name="DIMENSION2_RANGE2"
      * @jboss:cmp-field field-name="dimension3Range1" column-name="DIMENSION3_RANGE1"
      * @jboss:cmp-field field-name="dimension3Range2" column-name="DIMENSION3_RANGE2"
      * @jboss:cmp-field field-name="adjective" column-name="ADJECTIVE"
      *
      * @jboss:create-table create="false"
      * @jboss:remove-table remove="false"
      *
      */

      Am i missing something?

      Thanks in advance for any help.

      Tom

        • 1. Re: XDoclet/JBoss problems
          Adrian Brock Master

          The method accepts an AccountBeanPK
          but you are passing a String

          Regards,
          Adrian

          • 2. Re: XDoclet/JBoss problems
            tkeeber Newbie

            Thanks for the reply Adrain,

            However, perphaps i didn't explain my question very well. I realised what the error was, but my question was really about whether there are XDoclet tags for compound keys which i was missing.

            As the tags are used to create the descriptiors and stub files for my EJBs i thought i must be missing something when defining the tags - thus getting this error.

            Any other ideas?

            thanks

            • 3. Re: XDoclet/JBoss problems
              tkeeber Newbie

              No worries, i've found what the problem was....

              According to the XDoclet website if the primary key is in the java.lang.* package then you don;t need to put in any @tags at the top of the class for the primary key.

              However, i've now put the
              @ejb:pk pattern="String"
              generate="false"

              tage in to my code and it removed all the compiler errors as stated above.

              Hope this helps anyone with the same problem