You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Rakesh Midha (JIRA)" <ji...@apache.org> on 2006/11/27 14:00:21 UTC
[jira] Commented: (GERONIMO-1079) Better error for missing
primkey-field
[ http://issues.apache.org/jira/browse/GERONIMO-1079?page=comments#action_12453581 ]
Rakesh Midha commented on GERONIMO-1079:
----------------------------------------
Looks like this problem is fixed in OpenEJB
If my primary key class is java.lang.Integer
I get failure with following message
Error: Unable to distribute myphonebook-ejb.jar: Could not deploy
module
Invalid primary key class: ejbName=MyPhonebookBean pkClass=class
java.lang.String
If my primary key class is any other class with non-static field
Error: Unable to distribute myphonebook-ejb.jar: Could not deploy module
caused by EJB [MyPhonebookBean] is misconfigured: could not find CMP
fields for following pk fields: [ABC] [XYZ]
The reason being a
If primary key class is provided and primary key name is not provided, deployer consider it as a compound key. Compound key with no non-static field is invalid primary key hence Invalid primary key class in case of java.lang.Integer. In other cases where compound key contains non-static field "could not found fields for following pk fields" for all the non-static fields.
I think this is working as required. Please confirm and close this JIRA.
> Better error for missing primkey-field
> --------------------------------------
>
> Key: GERONIMO-1079
> URL: http://issues.apache.org/jira/browse/GERONIMO-1079
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: deployment, OpenEJB
> Affects Versions: 1.0-M5
> Reporter: Aaron Mulder
> Assigned To: Rakesh Midha
> Priority: Critical
> Fix For: Verification Required
>
>
> I forgot the primkey-field for my CMP entity, and I got this:
> Error: Unable to distribute LoadMagus.ear: Could not deploy module
> caused by EJB [TestRunMachine] is misconfigured: could not find CMP
> fields for following pk fields: [TYPE] [MAX_VALUE] [MIN_VALUE]
> Now, I don't know where it got TYPE, MAX_VALUE, and MIN_VALUE from -- those are not fields on my EJB or the table or anything. I did have a prim-key-class set to java.lang.Integer, so perhaps it picked up the static fields on java.lang.Integer (if so why? I wouldn't have thought statics were relevant). It would be better if the error said "missing primkey-field or prim-key-class does not have properties matching CMP field names" or something like that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira