Tutorial - Access a database [message #788509] |
Wed, 01 February 2012 17:29  |
Eclipse User |
|
|
|
Hello,
I am new to EGL and am trying the tutorials. I have gotten to the lesson "Access a database with EGL RichUI" and completed through lesson 8. I am getting an error reported as the following:
Failure: An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService
Detail 1:
Detail 2:
Detail 3: java.lang.NoClassDefFoundError:paymentRec
In the Problems window I can see that there are many errors in the SQLService.java code and it all points to a description of "paymentRec cannot be resolved to a type".
Can anyone explain how to fix this issue? Otherwise I can't go any further.
Thanks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Tutorial - Access a database [message #789442 is a reply to message #789117] |
Thu, 02 February 2012 20:23   |
Eclipse User |
|
|
|
Bernard Harris wrote on Thu, 02 February 2012 11:15One thing I noticed, while copying in the code for the SQLService.egl, is I couldn't see any SQL statement when using Ctrl+1 on the "get" statement in getAllPayments(), whereas I could see the SQL statements in addPayment, editPayment, and deletePayment.
Hi Bernard,
Hope you can finally get the tutorial run successfully, and feel free to ask here if having any problems.
For your problem of Ctrl + 1 cannot generate the SQL statements, we have a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=369021) opened for this, and it will be resolved soon.
Rocky
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Tutorial - Access a database [message #836575 is a reply to message #836539] |
Wed, 04 April 2012 12:48   |
Eclipse User |
|
|
|
Hi!
After changing the line as following, the problem fixed. But I don't know why some programmer pass the compilation even without putting the interface name there.
call SQLService.getAllPayments() using new HttpProxy("services.SQLService") returning to updateAll onException serviceExceptionHandler;
Back to the formatter error. The source is as following. What is wrong with formatters = [ formatCategory ] ? This has no problem when we use version 0.7
columns =[
new DataGridColumn{name = "category", displayName = "Type",
width = 90, formatters = [ formatCategory ]},
new DataGridColumn{name = "description", displayName = "Description",
width = 120},
new DataGridColumn{name = "amount", displayName = "Amount due",
width = 90, alignment = DataGridLib.ALIGN_RIGHT}
],
|
|
|
Re: Tutorial - Access a database [message #836625 is a reply to message #836575] |
Wed, 04 April 2012 14:04   |
Eclipse User |
|
|
|
As you've observed, when using an interface in the call statement you must supply the implementation name (this is not required if referencing the service part directly). It's valid syntax to leave the implementation name out, therefore you do not get a validation error, and instead get a runtime error. An example as to why it can't be a validation error would be you have defined your own type of IHTTP that does not have such a requirement. It would be like getting a validation error because you are assigning a string field to an integer field, and the string field contains non-numeric data; this is valid syntax and would only fail at runtime.
As for the formatter error, this is due to a change we made I think in 0.8 M3 where the string type is now a reference type instead of a value type, meaning its default parameter modifier has changed from INOUT to IN. The CellFormatter delegate defines the parameters to be of type INOUT, therefore you must change your function signature to: function formatCategory(class string inout, value string inout, rowData any in)
Right now the tutorial has it use the default modifier, which is no longer INOUT, and thus doesn't match the definition of CellFormatter.
I've updated the tutorial for this change so that it's once again without error. Let me know if you have any other questions!
-Justin
|
|
|
|
|
Re: Tutorial - Access a database [message #837613 is a reply to message #836863] |
Thu, 05 April 2012 18:31  |
Eclipse User |
|
|
|
Excellent! As a next step I would try to come up with a small application idea that uses similar concepts as the tutorial, to see if you're able to accomplish the task without being told what to do, and then from there you could add more and more complexity to the user interface and/or service logic to become more familiar with the tools and language. Feel free to post any questions that might arise from this!
-Justin
|
|
|