1 Reply Latest reply on Mar 24, 2003 2:02 PM by Adrian Brock

    missing primkey-field not caught during deployment of EJB

    tsangcn Newbie

      Hello,

      I am using JBoss 3.0.6. I have a CMP EJB with String as primary key. I have declared it in ejb-jar.xml as:

      ......
      <prim-key-class>java.lang.String</prim-key-class>
      ......

      But at first I forgot to put the line

      <primkey-field>keyID</primkey-field>

      So that means JBoss should not know which field is the primary key.
      But when I deploy the EJB, there are no errors.
      When I access the EJB, exception thrown saying that there is an error in the generated SQL.
      The DEBUG level of server.log showing that the generated SQL is

      SELECT FROM MY-TABLE

      Of course the root of the error is the missing of primary-field in ejb-jar.xml.
      But the second error is this mistake is not caught during deployment of the EJB.
      Is this the normal behavior? Or is there a bug in the deployment stage?

      Thanks
      CN