tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: No such property <primarykey> defined on bean class <class name>
Date Thu, 02 Apr 2009 14:40:22 GMT
Hi Sandro!
If you take a look at the OpenEJB source code, looking for the error message you get, you
will find this piece of code in the Cmp2Generator class:
        // for each of the defined cmp fields, we need to locate the getter method 
        // for the name and retrieve the type.  This a) verifies that we have at least 
        // a getter defined and b) that we know the field return type.  The created CmpField

        // list will feed into the generation process. 
        for (String cmpFieldName : cmpFields) {
            Method getter = getterMethod(cmpFieldName);
            if (getter == null) {
                throw new IllegalArgumentException("No such property " + cmpFieldName + "
defined on bean class " + beanClassName);
            // if this is an abstract method, then it's one we have to generate 
            if (Modifier.isAbstract(getter.getModifiers())) {

                Type type = Type.getType(getter.getReturnType());
                CmpField cmpField = new CmpField(cmpFieldName, type, getter); 
                this.cmpFields.put(cmpFieldName, cmpField);

So, it sounds like you have a cmp-field in your EJB for which there is no corresponding getter-method.
Compiling the code may succeed despite this kind of errors, so you should double-check the
name(s) of cmp-field(s) and the names of corresponding getter method(s).
Good luck!
 Ivan A Krizsan

View raw message