users@glassfish.java.net

EJB-QL error on Glassfish2.1

From: Ranbir Mazumdar <Ranbir.Mazumdar_at_Sun.COM>
Date: Wed, 22 Apr 2009 12:55:35 -0500

Hi All,

Any help is appreciated. I am trying to migrate from Weblogic 10 to
Glassfish 2.1

The problem we're running into is that GlassFish doesn't seem to
recognize an EJB QL function such as UPPER in our queries, whereas the
same queries work well under WebLogic and WebSphere.
 
Here's an example from my GlassFish domain's log when I try to deploy
our application:

    ;_RequestID=bef395be-7bba-40a4-978b-d5c4c295d21d;|"DPL8011: autodeployment failure while deploying the application : Fatal Error from EJB Compiler -- JDO74025: JDOCodeGenerator: Caught an Exception validating CMP bean 'Company' in application 'expertus-payment' module 'expertus-payment-ejb': JDO75006: Invalid EJBQL query
    Bean: Company
    Method: ca.expertus.payment.core.entity.CompanyLocal findByName(java.lang.String)
    EJBQL: SELECT OBJECT(o) FROM CompanyEJB o WHERE upper(o.companyName) = ?1
    Error: column(47): JDO75202: Syntax error unexpected token '('.

There are several other such finder methods with EJB QL queries that
fail validation, and they all fail at the opening parentheses that
immediately follows "upper".
 
First, am I correct in assuming that the deployer is complaining about
the "upper" function?
And if so, is there a work-around?

Ranbir