Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error compiling EJB-QL statement ''; FROM not found

 
chris richards
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Im getting this error from Jboss:

org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement ''; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: FROM not found)

I know its to do with having or not having empty ql sections, but i am not sure of the exact rules. There were no problems when running the app on an older version of Jboss (3.x)

Here is a section from the jbosscmp-jdbc.xml file.

...
<enterprise-beans>
<entity>
<ejb-name>ContactEJB</ejb-name>
<table-name>con</table-name>
<cmp-field>
<field-name>contactId</field-name>
<column-name>CONTACT_ID</column-name>
<not-null/>
</cmp-field>
.....
....

<query>
<query-method>
<method-name>ejbSelectBoss_declaredsql</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<declared-sql>
<select>
<distinct/>
<ejb-name>ContactEJB</ejb-name>
<alias>boss</alias>
</select>
<from><![CDATA[, contacts c]]></from>
<where><![CDATA[ LCASE(c.email) = {0} ]]></where>
</declared-sql>
</query>

<query>
<query-method>
<method-name>ejbSelectGeneric</method-name>
<method-params>
<method-param>java.lang.String</meth
od-param>
<method-param>java.lang.Object[]</me
thod-param>
</method-params>
</query-method>
<dynamic-ql/>
</query>
-->
<query>
<query-method>
<method-name>findAll_onfind</method-name>
<method-params/>
</query-method>
<jboss-ql><![CDATA[
SELECT OBJECT(g)
FROM contact g
ORDER BY g.contactId
]]></jboss-ql>
<read-ahead>
<strategy>on-find</strategy>
<page-size>4</page-size>
<eager-load-group>most</eager-load-group>
</read-ahead>
</query>
<query>
<query-method>
<method-name>findAll_onload</method-name>
<method-params/>
</query-method>
<jboss-ql><![CDATA[
SELECT OBJECT(g)
FROM contact g
ORDER BY g.contactId
]]></jboss-ql>
<read-ahead>
<strategy>on-load</strategy>
<page-size>4</page-size>
<eager-load-group>basic</eager-load-group>
</read-ahead>
</query>
<query>
<query-method>
<method-name>findAll_none</method-name>
<method-params/>
</query-method>
<jboss-ql><![CDATA[
SELECT OBJECT(g)
FROM contact g
ORDER BY g.contactId
]]></jboss-ql>
<read-ahead>
<strategy>on-find</strategy>
</read-ahead>
</query>
<query>
<query-method>
<method-name>findFour</method-name>
<method-params/>
</query-method>
<jboss-ql><![CDATA[
SELECT OBJECT(g)
FROM contact g
WHERE g.contactId < 4
ORDER BY g.contactId
]]></jboss-ql>
<read-ahead>
<strategy>on-find</strategy>
<page-size>1000</page-size>
<eager-load-group>basic</eager-load-group>
</read-ahead>
</query>
</entity>
<entity>


Any help on what i need to do to correct this would be greately appreciated.

Thanks
Chris
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to move this to the EJB forum. It is not a JBoss specific question.

Also, under the Add Reply button there is a "CODE" button that will add CODE tags so that the indentation of your xml will remain. Right now it is very difficult to read without indentation. Please try to repost it with the CODE tags.

Thanks

Mark
 
Ashish Tahasildar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have gone through your xml file as in query you have given wrong table name
<table-name>con</table-name>

<jboss-ql><![CDATA[
SELECT OBJECT(g)
FROM contact g
ORDER BY g.contactId
]]></jboss-ql>

As you have taken table name as con then in query put con instead of contact, may be the reason you were getting an error.
Hope this will solve your problem.

Regards,
Ashish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!