Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » EDT:Tutorial: RUI With DataBase Lesson 4 problem(Getting CRRUI2090E error)
EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #766517] Thu, 15 December 2011 23:14 Go to next message
blakeb72  is currently offline blakeb72 Friend
Messages: 5
Registered: December 2011
Junior Member
I am working through the EDT tutorial and am running into an error in section "Create a data grid to hold a set of database rows" of lesson 4. After creating the new EGL variable (allpayments) with the EGL Rich UI Data Wizard, this message text shows up under the GridLayout(ui) in the Design view of PaymentFieldMaintenance.egl:

[CRRUI2090E] Could not call service: ___loadScript?fileName=PaymentClient/records/paymentRec.js
NETWORK_ERR: XMLHttpRequest Exception 101
[CRRUI2094E] Here are the EGL function calls leading to this error:

PaymentFieldMaintenance.<init>() [native JavaScript]

I've attached a screenshot. I'm kind of lost here. I don't see a records/paymentRec.js file in my PaymentClient project (or any generated JS for that matter), but it looks like I can continue on with the tutorial. I was able to drag the allpayments variable to the GridLayout. Am I missing something?

I am running the EDT IDE on 64-bit openSUSE 12.1 with Tomcat 7.0.23 and Java JDK 7.0.1_01, against DB2 on IBM i 7.1. The JTOpen JDBC driver seems to be configured properly as I am able to ping the DB and was able to create the payments table as described in the tutorial.

Thanks for any assistance.

Blake
  • Attachment: error.png
    (Size: 29.69KB, Downloaded 160 times)
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #766555 is a reply to message #766517] Fri, 16 December 2011 01:09 Go to previous messageGo to next message
fahua jin is currently offline fahua jinFriend
Messages: 58
Registered: July 2011
Member
Blake,

Could you please tell me which project the paymentRec is created?

The paymentRec should be created in PaymentShared project, you can find the JS file for paymentRec is generated under the project. PaymentClient should have a project reference to PaymentShared, and then PaymentFieldMaintenance can resolve the paymentRec.

Rocky
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #766828 is a reply to message #766517] Fri, 16 December 2011 13:54 Go to previous messageGo to next message
Paul Hoffman is currently offline Paul HoffmanFriend
Messages: 6
Registered: July 2009
Junior Member
Hi Blake,

First of all EDT automatically generates JavaScript when you save changed EGL parts in a project for which the JavaScript generator is selected. These parts are hidden in the project explorer when you are using the EGL perspective. If you switch to the Resource perspective, you will be able to see them in a project folder named "generatedJavaScript".

Please check that:

1. You have defined the record part records.paymentRec in the PaymentShared project.

2. File records.paymentRec.js has been generated into the PaymentShared project.

3. Project ProjectClient includes project PaymentShared in its EGL Build Path property.

4. File PaymentFieldMaintenance.egl includes this import statement:

import records.paymentRec ;






Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #766955 is a reply to message #766828] Fri, 16 December 2011 18:28 Go to previous messageGo to next message
blakeb72  is currently offline blakeb72 Friend
Messages: 5
Registered: December 2011
Junior Member
Thanks for your response, Rocky and Paul. My error was that I created the records.paymentRec in the wrong project (PaymentService instead of PaymentShared). Once I corrected that, my problem was solved. Though, Paul, I don't have a file named PaymentFieldMaintenance.egl, but only PaymentFileMaintenance.egl, unless I am missing something. That latter file does have the import statement in it.

I am now at step 8 of the tutorial in section "Test the interface". I have a few observations and am also running into another problem.

Observations:
1. In lesson 4, section 1.5 "Add grid layout for a single row", a dialog comes up after being instructed to drag "the selectedPayment variable to the bracketed area inside the bracketed area in the payment record pane". In the "Data to display" section of that dialog, the amount field field type is decimal(10,2) instead of money(10,2). As a result, I could not change the widget type to DojoCurrencyTextBox through the dialog. I went through the steps and subsequently changed the source manually to set the appropriate widget type. I don't know if this resulted from an error in the original table definition (though I cut and pasted the tutorial SQL code to create the table), due to the fact that I am running the tutorial against DB2 for IBM i instead of Derby or something else, but I thought I'd bring it to your attention.

2. In lesson 6, section 1.8 "Create test data", the code for the createDefaultTable() function seems to throw off the editor when formatting the EGL source (CTRL+SHIFT+F). It may be due to the two try statements (unless I am doing something wrong). This is a minor issue, but again, I thought I'd bring it to your attention.

3. In lesson 8, section 1.7 "Create functions that use the service-access variable to invoke the service", it reads, "Now, to create the updateAll callback function, click anywhere in the call statement, right-click, hold down the Ctrl key, and press 1." I think it should be "left-click".

4. In lesson 8, section 1.7 "Create functions that use the service-access variable to invoke the service", the code for the addrow function includes onException serviceLib.serviceExceptionHandler;. Should it be onException serviceExceptionHandler; instead?

5. In lesson 8, section 1.9 "Complete the callback functions", the link for the completed source code is labeled PaymentLib.egl, but I think it should be PaymentFileMaintenance.egl.

New Problem:
When I test out the interface in lesson 8, section 1.10, I am getting this error. Maybe it has something to do with the way my JDBC driver is set up; I don't know. I was able to create the PAYMENT table in lesson 3 and add the SQL service in lesson 6. I am connected to the DB per the connection listed in Datasource Explorer as well. Here's are the errors that display when I preview my PaymentFileMaintenance.egl in the editor:

Failure: service invocation, exception = An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService
Detail 1:
Detail 2:
Detail 3: java.lang.NullPointerException
[CRRUI1072E] An An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService exception occurred in the error call back function, code with try...OnException
An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService
[CRRUI2094E] Here are the EGL function calls leading to this error:

handlers/PaymentFileMaintenance.egl() at line 268
handlers/PaymentFileMaintenance.egl() at line 263
RUI Runtime.Handling callback for services.SQLService() [native JavaScript]
RUI Runtime.Response for services.SQLService() [native JavaScript]

Failure: service invocation, exception = [CRRUI3660E] Exception occurred, could not handle response for 'services.SQLService', reason: '[CRRUI1072E] An An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService exception occurred in the error call back function, code with try...OnException'
Detail 1: 200
Detail 2:
Detail 3: {"headers" : null, "body" : "{\"error\" : {\"name\" : \"JSONRPCError\", \"code\" : \"EGL0024E\", \"message\" : \"An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService\", \"error\" : {\"source\" : 1, \"detail1\" : \"\", \"detail2\" : \"\", \"detail3\" : \"java.lang.NullPointerException\", \"message\" : \"An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService\", \"messageID\" : \"EGL0024E\", \"STACK_TRACES\" : true, \"name\" : \"eglx.services.ServiceInvocationException\"}}}", "status" : 500, "statusmessage" : "FAILED"}
[CRRUI1072E] An [CRRUI3660E] Exception occurred, could not handle response for 'services.SQLService', reason: '[CRRUI1072E] An An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService exception occurred in the error call back function, code with try...OnException' exception occurred in the error call back function, code with try...OnException
[CRRUI3660E] Exception occurred, could not handle response for 'services.SQLService', reason: '[CRRUI1072E] An An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService exception occurred in the error call back function, code with try...OnException'
[CRRUI2094E] Here are the EGL function calls leading to this error:

handlers/PaymentFileMaintenance.egl() at line 268
handlers/PaymentFileMaintenance.egl() at line 263

[type=eglx.lang.AnyException, message=[CRRUI1072E] An [CRRUI3660E] Exception occurred, could not handle response for 'services.SQLService', reason: '[CRRUI1072E] An An exception occurred during a service call. Service:services.SQLService, Function:services.SQLService exception occurred in the error call back function, code with try...OnException' exception occurred in the error call back function, code with try...OnException]
undefined:0
[CRRUI2095E] Could not find the EGL function calls leading to this error

Any ideas?

Thanks,
Blake
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #767830 is a reply to message #766955] Mon, 19 December 2011 02:32 Go to previous messageGo to next message
fahua jin is currently offline fahua jinFriend
Messages: 58
Registered: July 2011
Member
Blake,

Thanks for bring up the questions.

1. You're right. I think a wrong screen-shot was attached, we'll update the picture later.
2. This is a defect. Bug 367044 - 'The code formatter does not work for nested try statements' was opened.
3, 4, 5, I updated the wiki page.

For your new problems, have you tried to clean your workspace? Project > Clean > OK
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768140 is a reply to message #767830] Mon, 19 December 2011 16:40 Go to previous messageGo to next message
blakeb72  is currently offline blakeb72 Friend
Messages: 5
Registered: December 2011
Junior Member
Rocky,

If I notice anything else, I will let you know. It might help others using the tutorial later.

I tried cleaning my workspace, but am still getting the same error. Maybe I should have used the Derby DB for the tutorial, but in production, I would most likely be going against DB2 for IBM i. The DB2 connection in Data Explorer shows that I am connected, and that I can browse through the various schemas on the system.

The errors above refer to these lines of code in PaymentFileMaintenance.egl:

    function serviceExceptionHandler(ex anyException)
        try
            throw ex;
        onException(serviceEx ServiceInvocationException)
            log("Failure:  service invocation, exception = " +
                            serviceEx.message);
            log("Detail 1:  " + serviceEx.detail1);
            log("Detail 2:  " + serviceEx.detail2);
            log("Detail 3:  " + serviceEx.detail3);
        onException(anyex anyException)
            log("Failure:  service invocation, exception = " + anyex.message);
        end
        throw ex;
    end

    logActive boolean = true;

    function log(text string in)
        if(logActive)
            sysLib.writeStderr(text);
        end
    end

The actual lines in the code are throw ex and function log(text string in). I think the exception is being thrown due to an error with the readFromTable() function call in start(). This is calling the getAllPayments() function in PaymentService/services/SQLService.sql. I created a test SQL file and can run a query against the PAYMENT table in my BLAKE1 DB2 schema (library) on IBM i. I have to qualify the table name with the schema (i.e., BLAKE1.PAYMENT), however; otherwise it looks for the table in a bogus library named as my user profile.

So the problem may be that the program can't find the PAYMENT file. The URL for my JDBC connection in my PaymentService.egldd is "jdbc:as400:<systemName>;prompt=false;libraries=blake1", but that does not work. I tried setting the Default Schema to BLAKE1 as well with no success. Last thing, I tried was qualifying the table name in PaymentShared/records/paymentRec.egl as BLAKE1.PAYMENT, but again no luck. Not sure what else to try. It could be a JDBC configuration issue though.

Blake

[Updated on: Mon, 19 December 2011 17:42]

Report message to a moderator

Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768312 is a reply to message #768140] Mon, 19 December 2011 22:31 Go to previous messageGo to next message
Colin Brown is currently offline Colin BrownFriend
Messages: 4
Registered: December 2011
Junior Member
I am having the same problem also with DB2 on IBM i.
The database connection itself works, the test in the EGL Deployment resource section validates with a Ping Successful message, and earlier in the tutorial the table has been created with the supplied SQL.

Now that I know I'm not alone with the problem, and it might therefore be related to the IBM i JDBC connection, I'll do some investigation on the parameters.

My current set up is
jdbc:as400:systemi.mydomain.com;prompt=false;naming=system;translateBinary=true;dateformat=iso

This is what we normally use when accessing i tables from Java (we do it all the time).

Blake, if you get a solution, please post it. I will do the same.

Colin
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768474 is a reply to message #768312] Tue, 20 December 2011 08:13 Go to previous messageGo to next message
Colin Brown is currently offline Colin BrownFriend
Messages: 4
Registered: December 2011
Junior Member
After some more investigation looking at the generated SQL in SQLService.java and debugging it, the actual exception is:

Exception: SQLService, getAllPayments, SQLSTATE = 42704, message = [SQL0204] PAYMENT in CB5OMUSR type *FILE not found.: [sqlstate:42704][sqlcode:-204]

CB5OMUSR is the database username, NOT a library (schema to non IBM i people) so that make it an odd error.

Normally the jdbc driver will find a table as long as it's in the library list of the database user, which in this case it most defnitely is (If i log in as the user cb5omusr)

Editing the SQL in the generated java (just for testing) to qualify the table with the schema name works e.g "insert into mylib.PAYMENT ...." and the PAYMENT table has a record added.

I noted that the SQLDataSource variable is an EGL type, not a straight java.sql class. And in the debugger, the ds variable did not have a list of the properties I have set on the resource.

So the question to the EGL developers is does the EGL SQLDatasource class do anything to the database connection which is different to the standard java.sql behaviour?

Colin
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768629 is a reply to message #768474] Tue, 20 December 2011 13:50 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Colin - you might want to check out this other thread: http://www.eclipse.org/forums/index.php/mv/msg/264617/763605/#msg_763605 . Bob had a similar sounding issue and needed to set the library name in the JDBC connection URL. From what I can tell, it is odd you are having to do this, however.
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768757 is a reply to message #768629] Tue, 20 December 2011 18:11 Go to previous messageGo to next message
blakeb72  is currently offline blakeb72 Friend
Messages: 5
Registered: December 2011
Junior Member
Thanks, Colin and Will. After your responses, I did a little more digging and also looked at the thread above. I noticed that Bob added a resource binding for his DB not only in PaymentService.egldd per lesson 6, section "Create binding to database connection", but also in PaymentClient.egldd as well. Once I created a resource binding in PaymentClient, previewing PaymentClient/handlers/PaymentFileMaintenance.egl in the EGL editor works fine. I can create sample data and get results back from DB2 to populate the data grid. So is this solution the proper fix? If so, the tutorial will need to be updated to instruct readers to add a resource binding in the PaymentClient project as well (unless I missed it somewhere).

Here's the XML for my EGL DDs:

<?xml version="1.0" encoding="UTF-8"?>
<egl:deployment... [had to remove link to post] ...>
  <bindings>
    <binding name="DB2" type="edt.binding.sql" useURI="false">
      <parameters>
        <parameter name="dbms" value="DB2 for i5/OS"/>
        <parameter name="sqlID" value="<userName"/>
        <parameter name="sqlPassword" value="<password>"/>
        <parameter name="jarList" value="/opt/jtopen_7_6/lib/jt400.jar"/>
        <parameter name="sqlJDBCDriverClass" value="com.ibm.as400.access.AS400JDBCDriver"/>
        <parameter name="sqlDB" value="jdbc:as400:<systemName>;prompt=false;libraries=blake1"/>
      </parameters>
    </binding>
  </bindings>
</egl:deployment>

Also, I played around with my JDBC connection parameters. If I remove the libraries=blake1 property, but qualify the table name with blake1 in PaymentShared/records/paymentRec.egl, then things work as expected. If I add the property back in and remove the table name qualification, it works as expected. So the problem appears to have been with the missing resource binding.

I will continue on with the tutorial. If I find anything else or run into additional problems, I will let you know.

Edit
On second thought, it doesn't seem correct that the DB2 resource binding should be added to the client project. It seems like that violates separation of concerns. The UI shouldn't have to know anything about the service and persistence layers. Of course, I am not very familiar with EGL development. Hopefully, one the devs can clarify here.

Blake

[Updated on: Tue, 20 December 2011 21:09]

Report message to a moderator

Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #768836 is a reply to message #768757] Tue, 20 December 2011 22:36 Go to previous messageGo to next message
blakeb72  is currently offline blakeb72 Friend
Messages: 5
Registered: December 2011
Junior Member
I finished the tutorial and have one final observation.

After adding an empty payment record, modifying it in the form and then saving it, I can't get the record to reload into the form. Unlike the newly added record, however, I can click preexisting records in the grid and load them without issue. This seems to be the case whether using the internal IDE browser or an external one, like Firefox. If I refresh (reload) the page, then I can select the record in question. I briefly ran the app in debug mode, but didn't see anything different with the added record in comparison to the preexisting ones (i.e., I was taken to the appropriate event handler function and the data was in the payment record). I suppose it could be something with my setup, but I thought the devs might want to know in case there is a bug somewhere in the underlying EGL, Java or JS code.

Other than that the completed app runs great. Since I installed Tomcat standalone, I exported the client project to a WAR and deployed it through the Tomcat manager app. After researching various Java web technologies, I have to say I am impressed with EGL's ease of development. Thanks to the tutorial author and devs for providing this.

Closing thoughts/questions: I guess the next question is what is the best way to get a deeper knowledge of the technology beyond this tutorial? Are EGL books now becoming outdated with EDT and other enhancements? My main concern using EGL further is getting questions answered as it is currently not as widely adopted as, say, Java or PHP. Another concern is with the code generation aspect. It makes for easier development quicker, but what if something goes wrong? I guess comfort level in this respect would come with further development and experience. Is EDT 0.7.0 considered a production release or should one wait until 1.0+ comes out?

Thanks,
Blake
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #775267 is a reply to message #768836] Thu, 05 January 2012 17:14 Go to previous messageGo to next message
Lisa Lasher is currently offline Lisa LasherFriend
Messages: 5
Registered: May 2011
Junior Member
Blake,
I see that nobody has responded to your last of questions, so I'll give it a shot

To learn more about EGL, look through all of the information on our Eclipse Documentation site.

The EDT project is based on technology from IBM Rational Business Developer, and there is a wealth of information at the EGL Cafe (www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=3e2b35ae-d3b1-4008-adee-2b31d4be5c92). Just remember that EDT contains only a subset of the function that is found in Rational Business Developer, and we are redesigning the IDE and adjusting the EGL language to be leaner and cleaner.

You worry about getting questions answered because EGL has not been widely adopted. That is one of our main purposes for going open source with this EDT Eclipse project, to vastly expand our user community.

Code generation - we're big believers in it (obviously!), because EGL provides a simplified yet highly powerful language, with much of the complexity and heavy lifting hidden under the covers. It also provides easy portability across platforms and underlying technologies. When something goes wrong, you debug the EGL code, not the generated code.

Finally, EDT 0.7.0 is NOT production level. That is indicated by the leading 0 in the release number. We are still in the incubator stages, with a plan to reach 1.0 (production level) by the end of this year. In the meantime, we encourage you learn about EDT and the EGL language, give us feedback, and help us test by creating applications that reflect your world!

- Lisa
Re: EDT:Tutorial: RUI With DataBase Lesson 4 problem [message #780255 is a reply to message #768757] Tue, 17 January 2012 13:32 Go to previous message
Morten Krøyer is currently offline Morten KrøyerFriend
Messages: 10
Registered: January 2012
Location: Copenhagen
Junior Member
I'm following the tutorial as well with EDT and a db2 database installed on a windows laptop.

I have the exact same problem with the database connection as Blake. I can create the table and the test connection is fine, but when i preview PaymentFileMaintenance.egl i get a java nullpointer exception.

If I add db2 connection info to the deployment descriptor for the client project, everything works like a charm, but untill that is done, the ds variable in SQLService is a null reference (causing the execption).

Adding library references don't seem to do any difference for me

I tend to agree with Blake, that the client project shouldn't need to know about persistence

/Morten
Previous Topic:New blog post - Creating EGL projects
Next Topic:Building workspace freezes when migrating from RBD
Goto Forum:
  


Current Time: Sat Nov 22 00:40:17 GMT 2014

Powered by FUDForum. Page generated in 0.03329 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software