[Beginners Corner] - Error compiling EJB-QL statement ''; at startup
by baroquew
I am posting my questions in the Beginners Corner as it is what I am: a beginner in Jboss and alike. Problem is, I have to carry on the development of an existing project.
I have currently: a server (jboss 4.0.1sp1) on which a version of the project is running and two development platforms (none of which is guaranteed to be the one used to generate the version used on the server). I set up one of those platform exactly as the server (jboss 4.0.1sp1, postgresql-8.0.309.jdbc2ee, jre 1.5.0).
This being said i can begin my question:
on the platform i set up, on launching my application, i get:
16:23:10,853 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: FROM not found
| 16:23:10,853 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.parse(EJBQLParser.java:39)
16:23:10,900 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=ContactsEntityLocal,service=EJB
| org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement ''; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: FROM not found)
| at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:52)
16:23:10,932 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ContactsEntityLocal,service=EJB
| org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement ''; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: FROM not found)
| at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:52)
as error messages.
I have had those error messages for almost every single bean in the project (in different occasions), and more generally speaking, my finder functions seem to cause troubles (findAll and findByPrimaryKey namely). I managed to debug a few files without really knowing how (I checked on many forums but never really found a solution, i just got ideas where to look from there), until I decided to compare the ejb-jar.xml and jbosscmp-jdbc.xml (among others) between my development platform and the .ear file on the server. And they are the same, so I really wonder where my problems are coming from.
Here is my ejb-jar.xml fragment about that bean
<entity >
| <description><![CDATA[Description for ContactsEntity]]></description>
| <display-name>Name for ContactsEntity</display-name>
|
| <ejb-name>ContactsEntity</ejb-name>
|
| <local-home>com.opticall.dod.server.interfaces.ContactsEntityLocalHome</local-home>
| <local>com.opticall.dod.server.interfaces.ContactsEntityLocal</local>
|
| <ejb-class>com.opticall.dod.server.ejb.ContactsEntityCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>False</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>ContactsEntity</abstract-schema-name>
| <cmp-field >
| <description><![CDATA[Getter for CMP Field lastname]]></description>
| <field-name>lastname</field-name>
| </cmp-field>
| <cmp-field >
| <description><![CDATA[Getter for CMP Field firstname]]></description>
| <field-name>firstname</field-name>
| </cmp-field>
| <cmp-field >
| <description><![CDATA[Getter for CMP Field phonenumber]]></description>
| <field-name>phonenumber</field-name>
| </cmp-field>
| <cmp-field >
| <description><![CDATA[Getter for CMP Field username]]></description>
| <field-name>username</field-name>
| </cmp-field>
| <cmp-field >
| <description><![CDATA[Getter for CMP Field contactid]]></description>
| <field-name>contactid</field-name>
| </cmp-field>
| <primkey-field>contactid</primkey-field>
|
| <resource-ref >
| <res-ref-name>jdbc/DoDServerDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
|
| <query>
| <query-method>
| <method-name>findAll</method-name>
| <method-params>
| </method-params>
| </query-method>
| <ejb-ql/>
| </query>
| <query>
| <query-method>
| <method-name>findMyContacts</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>int</method-param>
| <method-param>int</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ContactsEntity o WHERE ((o.username LIKE ?1) OR (o.username LIKE ?4)) OFFSET ?3 LIMIT ?2]]></ejb-ql>
| </query>
| <query>
| <query-method>
| <method-name>findByLetter</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| <method-param>int</method-param>
| <method-param>int</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ContactsEntity o WHERE (((o.username LIKE ?1) OR (o.username LIKE ?5)) AND (o.lastname = ?2%)) ORDER BY o.lastname OFFSET ?4 LIMIT ?3]]></ejb-ql>
| </query>
| <query>
| <query-method>
| <method-name>findNumberOfContactsByLetter</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT COUNT (o.lastname) FROM ContactsEntity o WHERE ((o.username = ?1) AND (o.lastname = ?2%))]]></ejb-ql>
| </query>
| <query>
| <query-method>
| <method-name>findNumberOfContacts</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT COUNT (o.lastname) FROM ContactsEntity o WHERE (o.username = ?1)]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-ContactsEntityBean.xml if you want to define extra finders. -->
|
| </entity>
and the jbosscmp-jdbc.xml fragment:
<entity>
| <ejb-name>ContactsEntity</ejb-name>
| <datasource>java:DoDServerDS</datasource>
| <datasource-mapping>PostgreSQL 7.2</datasource-mapping>
| <create-table>false</create-table>
| <remove-table>false</remove-table>
| <table-name>dodserver_contacts</table-name>
|
| <cmp-field>
| <field-name>lastname</field-name>
|
| </cmp-field>
| <cmp-field>
| <field-name>firstname</field-name>
|
| </cmp-field>
| <cmp-field>
| <field-name>phonenumber</field-name>
|
| </cmp-field>
| <cmp-field>
| <field-name>username</field-name>
|
| </cmp-field>
| <cmp-field>
| <field-name>contactid</field-name>
|
| </cmp-field>
|
| <query>
| <query-method>
| <method-name>findMyContacts</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>int</method-param>
| <method-param>int</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <jboss-ql><![CDATA[SELECT OBJECT(o) FROM ContactsEntity o WHERE ((o.username LIKE ?1) OR (o.username LIKE ?4)) ORDER BY o.lastname OFFSET ?3 LIMIT ?2]]></jboss-ql>
| </query>
| <query>
| <query-method>
| <method-name>findByLetter</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| <method-param>int</method-param>
| <method-param>int</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <jboss-ql><![CDATA[SELECT OBJECT(o) FROM ContactsEntity o WHERE (((o.username LIKE ?1) OR (o.username LIKE ?5)) AND (o.lastname LIKE CONCAT(?2,'%'))) ORDER BY o.lastname OFFSET ?4 LIMIT ?3]]></jboss-ql>
| </query>
| <query>
| <query-method>
| <method-name>findNumberOfContactsByLetter</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <jboss-ql><![CDATA[SELECT COUNT (o.lastname) FROM ContactsEntity o WHERE ((o.username LIKE ?1) AND (o.lastname LIKE CONCAT (?2,'%')))]]></jboss-ql>
| </query>
| <query>
| <query-method>
| <method-name>findNumberOfContacts</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <jboss-ql><![CDATA[SELECT COUNT (o.lastname) FROM ContactsEntity o WHERE (o.username LIKE ?1)]]></jboss-ql>
| </query>
|
| <!-- jboss 3.2 features -->
| <!-- optimistic locking does not express the exclusions needed -->
| </entity>
It's the way things are both on the up-and-running server and on the dev machine. Except that on the dev machine, it doesn't work. I tried adding (or not) the findAll to the jbosscmp-jdbc.xml, filling it in (or not) with the appropriate query code, but nothing.
If you have any input, that would be very appreciated, even if you see something obvious, don't hesitate!
Thank you
baro
(using eclipse 3.1.2, jbosside 1.6.0GA and xdoclet 4.0)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079670#4079670
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079670
17Â years, 2Â months
[JBoss Seam] - Multiple injection of the same type
by braddm7
Hello
I have been struggling for two days but still do not find the answer. Imagine the following scenario:
--- EJB ----
...
@Stateful
@Scope(SESSION)
@Name("testDataBindingManager")
public class TestDataBindingAction implements TestDataBinding {
@In(value="suppAddress", required=false) private TestAddress suppAddress;
@In(value="buyAddress", required=false) private TestAddress buyAddress;
...
--- EJB Entity ----
@Entity
@Name("address")
public class TestAddress {
...
--- EJB Entity ----
--- A Part of Facelet ----
<h:form id="supplierAddressForm">
ID : <h:inputText value="#{suppAddress.id}" />
City : <h:inputText value="#{suppAddress.cityName}" />
TEST : <h:commandButton value="Add New Supplier Address" action="#{testDataBindingManager.addNewSupplierAddress}" />
</h:form>
<h:form id="buyerAddressForm">
ID : <h:inputText value="#{buyAddress.id}" />
City : <h:inputText value="#{buyAddress.cityName}" />
GO : <h:commandButton value="Add New Buyer Address" action="#{testDataBindingManager.addNewSupplierAddress}" />
</h:form>
...
Here both @In properties of type TestAddress are neither being injected. In the case I use only one with the exact same name as the entity @Name("address") works fine.
Please give me a clue how to make it work with both being injected in case not at the same time and another case not at the same time(if possible).
I am really stuck :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079668#4079668
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079668
17Â years, 2Â months
[JBoss Portal] - Re: Enterprise Integration
by sohil.shahï¼ jboss.com
To add to Thomas' comment and CMS Watch's evaluation.
Their argument on Enterprise Integration clearly shows they have no idea about features of JBoss Portal.
Here is a technical rebuttal to their argument:
anonymous wrote :
| Enterprise Application Integration combines separate applications into a co-operating federation of applications.
|
JBoss Portal provides a JSR-168 portlet container which clearly gives you the tool that you need to expose your J2EE applications as portlets and federate them like mentioned above. The Identity Management Module's pluggability and SSO integration helps federate the security aspect of these applications as well.
anonymous wrote :
| Portals that support complex workflows depend upon queuing services, identity management (particularly for role management), and business rule engines to coordinate multi-step processing.
|
JBoss Portal integrates well with the JBoss JEMS stack which provides various tools for
workflow/business rules - JBPM and Drools. In fact the CMS workflow is built using JBPM
Identity Management - JBoss Portal's pluggable Identity Module and support of SSO frameworks
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079666#4079666
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079666
17Â years, 2Â months
[Beginners Corner] - Which is better for scheduled batch jobs: Inside JBoss conta
by jfrankman
I have a fairly complicated program that downloads files from a remote FTP website, decrypts the files, and processes the files and sends the processed files into an digital image repository.
My questions are:
Is it generally better to move batch/scheduled processes to run inside the JBoss container, or is it better to keep processes like this outside the JBoss container?
How much and what types of scheduled batch processes should be run inside JBoss?
The approach I am considering is to use a JMS Queue to trigger the batch process and then have a scheduled job send a message to the Queue every couple hours or so. Is this a common way of scheduling and triggering batch processes in JBoss?
More background on my questions:
On our test server I opted to configure and schedule everything to run outside JBoss as a cron job. It works, but getting the classpath correct and getting the Java call to work inside CRON makes me wonder if it is better to have this run inside the JBoss container.
My understanding is that applications servers are much more that just platforms for Web apps, but 99% of application development documentation for JBoss revolves around web apps. How much and what types of scheduled batch processes should be run inside JBoss?
If I do opt for JBoss, the approach I am considering is to use a JMS Queue to trigger the batch process and then have a scheduled job send a message to the Queue every couple hours or so. Is this a common way of scheduling and triggering batch processes in JBoss?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079662#4079662
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079662
17Â years, 2Â months