Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jboss-ql error - Encountered "select" at line 2, column 40  RSS feed

 
Chuck Beam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are in the process of converting from WebLogic to JBoss.
I am getting an error while trying to deploy my entity beans.

The finder query is giving the following error:
2009-09-01 14:02:32,410 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=pwExtractCfgEJB21.jar
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement for EJB 'ExtractConfig': select object(e) from ExtractConfig e where e.customerName like CONCAT('%',CONCAT(?1,'%'))
and e.version IN(select max(ec2.version) from ExtractConfig ec2 where ec2.watchId = e.watchId); - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "select" at line 2, column 40.
Was expecting one of:
"ABS" ...
"LENGTH" ...
"LOCATE" ...
"SQRT" ...
"MOD" ...
"(" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<NUMERIC_VALUED_PARAMETER> ...
<NUMERIC_VALUED_PATH> ...
)

The query does a self join to my table - ExtractConfig - to retrieve the latest row base on a column called version, hence the predicate clause "e.version IN(select max(ec2.version) from ExtractConfig ec2 where ec2.watchId = e.watchId)".

Below is the query definition from the ejb-jar.xml:
<query>
<query-method>
<method-name>findByCustomerName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select object(e) from ExtractConfig e where e.customerName like CONCAT('%',CONCAT(?1,'%'))
and e.version IN(select max(ec2.version) from ExtractConfig ec2 where ec2.watchId = e.watchId)</ejb-ql>
</query>

I understand the ejb-ql is container specific.

Can someone help me rewrite this query for JBoss?

Thanks!!!
Chuck
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!