users@glassfish.java.net

Re: EJB-QL error on Glassfish2.1

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Wed, 22 Apr 2009 22:24:08 +0200

Ranbir Mazumdar wrote:
> 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".

These statements use Weblogic-specific extension of the EJB-QL.

> First, am I correct in assuming that the deployer is complaining about
> the "upper" function?
> And if so, is there a work-around?
>

There are at least two forum threads that deal with this kind of
problem. These threads are linked here (though I doubt that a
work-around for your problem exists):

http://wiki.glassfish.java.net/Wiki.jsp?page=M2GWlsEJBQLExtensions

> Ranbir

--
Wolfram Rittmeyer