Bugs item #543408, was opened at 2002-04-13 10:10
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=543408&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Patrick Charbonnier (pch)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: Error compiling ejbql in JBboss cvs HEAD

Initial Comment:
 Hi All,
I get the follow error when I deploy to JBoss (cvs HEAD)
the same beans works perfectly on JBoss beta1
Can somebody know why?
thank in advance

Patrick

14:48:46,659 INFO [EjbModule] Starting
14:48:46,660 DEBUG [EjbModule] Application.start(),
start container:
org.jboss.ejb.StatelessSessionContainer@720434
14:48:46,660 DEBUG [StatelessSessionContainer] Begin
java:comp/env for EJB: PrimaryKeyGenerator
14:48:46,661 DEBUG [StatelessSessionContainer] TCL:
java.net.URLClassLoader@6580e1
14:48:46,663 DEBUG [StatelessSessionContainer] End
java:comp/env for EJB: PrimaryKeyGenerator
14:48:46,713 DEBUG [ProxyFactory] Bound
PrimaryKeyGenerator to PrimaryKeyGenerator
14:48:46,714 DEBUG [CachedConnectionInterceptor] start
called in CachedConnectionInterceptor
14:48:46,714 DEBUG [EjbModule] Application.start(),
start container: org.jboss.ejb.EntityContainer@323274
14:48:46,715 DEBUG [EntityContainer] Begin
java:comp/env for EJB: VatCodeBean
14:48:46,715 DEBUG [EntityContainer] TCL:
java.net.URLClassLoader@4ab854
14:48:46,718 DEBUG [EntityContainer] End java:comp/env
for EJB: VatCodeBean
14:48:46,776 DEBUG [BaseLocalContainerInvoker] Bound
Local VatCodeBean to local/VatCodeBean
14:48:46,778 DEBUG [VatCodeBean] Table not create as
requested: vatcode
14:48:46,779 DEBUG [findByPrimaryKey] SQL: SELECT id
FROM vatcode WHERE id=?
14:48:46,781 DEBUG [VatCodeBean] Added findByPrimaryKey
query command for local home interface
14:48:46,784 DEBUG [findByPercentage] EJB-QL: SELECT
OBJECT(o) FROM VatCodeBean o WHERE o.percentage=?1
14:48:46,854 ERROR [EntityContainer] Exception in
service lifecyle operation: start
org.jboss.deployment.DeploymentException: Error
compiling ejbql; - nested throwable is:
org.jboss.ejb.plugins.cmp.ejbql.ParseException:
Encountered "o.percentage" at line 1, column 45.
Was expecting one of:
"NOT" ...
"(" ...
<COLLECTION_VALUED_PATH> ...
<STRING_VALUED_PATH> ...
"CONCAT" ...
"SUBSTRING" ...
<BOOLEAN_VALUED_PATH> ...
<DATETIME_VALUED_PATH> ...
<ENTITY_VALUED_PATH> ...
<IDENTIFICATION_VARIABLE> ...
<NUMERIC_VALUED_PATH> ...
"LENGTH" ...
"LOCATE" ...
"ABS" ...
"SQRT" ...
"+" ...
"-" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<NUMERIC_VALUED_PARAMETER> ...

The bean query
<!-- findByPercentage-->
<query>
<query-method>
<method-name>findByPercentage</method-name>
<method-params>
<method-param>java.math.BigDecimal</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(o) FROM VatCodeBean o WHERE
o.percentage=?1</ejb-ql>
</query>

----------------------------------------------------------------------

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-04-15 13:18

Message:
Logged In: YES 
user_id=251431

The problem is percentage is a BigDecimal.

EJB-QL only understands simple types (short, int, long, 
float, double, String, bool, Date).  

This may work with JBossQl.  Try putting this in your 
jbosscmp-jdbc.xml file:

<query>
   <query-method>
      <method-name>findByPercentage</method-name>
      <method-params>
         <method-param>java.math.BigDecimal</method-param>
      </method-params>
   </query-method>
   <jboss-ql>
      SELECT OBJECT(o) 
      FROM VatCodeBean o 
      WHERE o.percentage=?1
   </jboss-ql>
</query>

Keep the stuff in the ejb-jar.xml file.  This is an 
override.

I'm closing this as it is not a bug.  If the JbossQL 
doesn't work, post to the user list or forum and I'll try 
to help you.

----------------------------------------------------------------------

Comment By: Patrick Charbonnier (pch)
Date: 2002-04-15 10:30

Message:
Logged In: YES 
user_id=102271

Sorry for the while but i was testing...
with just one beans if you add the findByPercentage
if JBoss HEAD you get the errors if you remove it compile.
With and without (findByPercentage)work fine with jboss tab 
Rel_3_0_0_4

the localhome declariation of findbypercentatge is:

 public Collection findByPercentage(BigDecimal percentage) 
throws FinderException;

the CMP declaration:

<cmp-field>
        <field-name>id</field-name>
</cmp-field>
<cmp-field>
        <field-name>code</field-name>
</cmp-field>
<cmp-field>
        <field-name>description</field-name>
</cmp-field>
<cmp-field>
        <field-name>percentage</field-name>
</cmp-field>
<cmp-field>
        <field-name>cmpVatCodePrefix</field-name>
</cmp-field>
<cmp-field>
        <field-name>cmpVatCodeSuffix</field-name>
</cmp-field>

in attachment 
all the declaration files

rgds,
pch

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-04-14 14:02

Message:
Logged In: YES 
user_id=251431

I'm closing this, as there has been no response.

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-04-13 11:18

Message:
Logged In: YES 
user_id=251431

I am sure that this is a problem with your code.  I have 
many test cases that look like this. 

Are you positive that 'percentage' is a cmp field?  If so, 
is percentage an numeric or string valued cmp field?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=543408&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to