Search code examples
jakarta-eeejbfinderjdoql

Help understanding JDOQL query elements for CMP 1.1 finder


I'm a relative Java EE lightweight, tasked with moving an old app from OC4j 10.x (JEE 1.1) into Glassfish 3.1 (JEE 1.4). I'm attempting to understand what this deployment error means and how I should go about updating my application to address it.

Caught java.lang.RuntimeException while processing CMP bean [FMSCatPval] for
application [FMS_nb_14]; module [FMS_nb_14-ejb.jar]: JDO74024: Missing or invalid
definition of JDOQL query elements for CMP 1.1 finder FMSCatPval.findByModel(int).

Here's the related EJB definition in ejb-jar.xml:

<entity>
    <display-name>FMSCatPval</display-name>
    <ejb-name>FMSCatPval</ejb-name>
    <home>com.fms.ejbs.pval.CatPvalHome</home>
    <remote>com.fms.ejbs.pval.CatPval</remote>
    <ejb-class>com.fms.ejbs.pval.CatPvalEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>com.fms.ejbs.pval.CatPvalKey</prim-key-class>
    <reentrant>false</reentrant>
    <cmp-version>1.x</cmp-version>
    <cmp-field><field-name>pval</field-name></cmp-field>
    <cmp-field><field-name>model_num</field-name></cmp-field>
    <cmp-field><field-name>step</field-name></cmp-field>
    <cmp-field><field-name>cntl_cat</field-name></cmp-field>
    <cmp-field><field-name>chiSquare</field-name></cmp-field>
</entity>

I've found some similar postings online, but no resolutions that pushed me over the hump. I think what I need is to add something like this to the entity declaration:

<finder>
    <name>findByModel</name>
    <query>model_num = {0}</query>
</finder>

But I'm not certain. I assume I should be able to find something in the old code base that I could translate to the specific content, unless perhaps it was implicitly using primary keys or somesuch.

Any pointers would be most appreciated.


Solution

  • We ended up going with a "slash and burn" approach, recreating all of the EJBs from scratch and reintegrating them with the rest of the code base. It looked like there was no other good way to get from where we were to where we wanted to be.