Topic
  • 7 replies
  • Latest Post - ‏2012-11-26T23:43:04Z by Hsieh
SystemAdmin
SystemAdmin
6195 Posts

Pinned topic Dynamic Load problem when RUI application deployed

‏2012-10-01T22:48:14Z |
Rich UI
Websphere 6.1 on Lunix
RBD 8.0.1.3

We are experiencing an unexpected problem once we deployed our EGL Rich UI application to our WAS test environment that mirrors how we will deploy in production. The customer would accesses the EGL Rich UI web app as follows.

Load Balancer w/SSL >> Apache Web Server w/WAS 6.1 Proxy Plugin >> Load Balancer >> IBM Web Application Server (WAS 6.1) >> IBM i DB

The application comes up just fine. But, when trying to access a part of the web app that needs to Dynamically Load, we get the following error.

Dynamic Loader Debug View


ui.dialogs.MCASearchDialogWidget load fail: Cannot load ui.dialogs.MCASearchDialogWidget: EGL1542E An exception occurred 

while converting from JSON. parameter:port, json: EGL0001I The error occurred in EGL Rich UI Proxy. 500 FAILED EGL0102E The value of string type cannot be converted to the number type. EGL0001I The error occurred in EGL Rich UI Proxy.

Here is some trace information when hitting the test URL using the path that starts with https://zzzwebtest.mycompanydomain.com/ZZZ_BUDGET/
Notice there is no PORT 9085 in the JSON record.
DOES NOT WORK


(Content)   
{
"headers" : 
{
}, 
"status" : 500, 
"statusMessage" : 
"FAILED", 
"body" : 
"{\"error\" : {\"name\" : \"JSONRPCError\", \"code\" : \"EGL1542E\", \"message\" : \"EGL1542E An exception occurred while converting from JSON. parameter:port, json:\\nEGL0001I The error occurred in EGL Rich UI Proxy.\", \"error\" : {\"messageID\" : \"EGL1542E\", \"message\" : \"EGL1542E An exception occurred while converting from JSON. parameter:port, json:\\nEGL0001I The error occurred in EGL Rich UI Proxy.\", \"source\" : 4, \"detail1\" : \"500\", \"detail2\" : \"FAILED\", \"detail3\" : \"EGL0102E The  value of string type cannot be converted to the number type.\\nEGL0001I The error occurred in EGL Rich UI Proxy.\", \"name\" : \"egl.core.ServiceInvocationException\"}}}"
}

When we hit the WAS server URL directly at -- http://10.100.xx.xx:9085/ ZZZ_BUDGET/ , and bypassing the proxy and SSL, everything works fine and the trace contains this content. Notice the PORT 9085 in the JSON record.

WORKS


(Content)   
{
"uri":
"",
"queryParameters":
{
},
"method":
"POST",
"body":
"{\"bindingName\":\"svc\",\"method\":\"getModules\",\"params\":[\"ZZZ_BUDGET\",\"ui.dialogs.MCASearchDialogWidget\",\"9085\",\"en_US\",\"ui.BudgetFundingSourceMaintenanceWidget,ui.dialogs.AccountSearchDialogWidget,ui.dialogs.MCASearchDialogWidget,ui.dialogs.LinkedNameSearchDialogWidget,ui.tools.SystemInformationMaintenanceWidget,ui.tools.HUDfilewidget\"],\"binding\":{\"name\":\"svc\",\"type\":\"EGLBinding\",\"serviceName\":\"com.ibm.egl.rui.loader.services.ModuleLoaderService\",\"alias\":\"\",\"protocol\":\"local\"}}",
"headers":
{
"EGLDEDICATED":
"TRUE",
"Content-Type":
"application\/json; charset=UTF-8"
}
}

Just to simplify things, we also tested the path below but it too didn't work. We received the same error as above.

Apache Web Server w/WAS 6.1 Proxy Plugin >> IBM Web Application Server (WAS 6.1) on port 9085
We pulled out the Dynamic Loading code and redeployed. Without Dynamic Loading, the application works fine.

Any idea what’s happening here?

Thanks,
Daniel
Updated on 2012-11-26T23:43:04Z at 2012-11-26T23:43:04Z by Hsieh
  • markevans
    markevans
    2815 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-10-01T23:21:40Z  
    Daniel,

    This is a known problem that has been fixed in APAR PM64664. This APAR will be included in the next fixpack which should be ready very soon. You could also open a PMR and request a fixtest.
    it is an update to the file named helper.js
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-10-02T11:25:08Z  
    • markevans
    • ‏2012-10-01T23:21:40Z
    Daniel,

    This is a known problem that has been fixed in APAR PM64664. This APAR will be included in the next fixpack which should be ready very soon. You could also open a PMR and request a fixtest.
    it is an update to the file named helper.js
    Hi Mark,

    That's great news. If the fix pack will be out in the next couple weeks, I think I'll just wait for that.

    Thank you,
    Daniel
  • Hsieh
    Hsieh
    603 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-11-26T17:34:24Z  
    • markevans
    • ‏2012-10-01T23:21:40Z
    Daniel,

    This is a known problem that has been fixed in APAR PM64664. This APAR will be included in the next fixpack which should be ready very soon. You could also open a PMR and request a fixtest.
    it is an update to the file named helper.js
    Hi Mark,

    Please, could you say if APAR PM64664 fix our problem.

    We have an RUI aplication deploy to TOMCAT 5.5 and Service REST deploy to WAS 7.
    We have installed RBD 8.5.0.

    My RUI aplicação call service using @RESTBinding { baseURI = "" } and when we running application, it didn't find the URL location to the application service. For this case, we have a service binding parameter in egldd that point to URL service. In this case, it does not used egldd parameter.

    Then if we change to @RESTBinding { baseURI = "http://servername:9080/......" } then it works fine.

    Is it same fix ?

    Thanks.

    Hsieh
  • markevans
    markevans
    2815 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-11-26T20:58:59Z  
    • Hsieh
    • ‏2012-11-26T17:34:24Z
    Hi Mark,

    Please, could you say if APAR PM64664 fix our problem.

    We have an RUI aplication deploy to TOMCAT 5.5 and Service REST deploy to WAS 7.
    We have installed RBD 8.5.0.

    My RUI aplicação call service using @RESTBinding { baseURI = "" } and when we running application, it didn't find the URL location to the application service. For this case, we have a service binding parameter in egldd that point to URL service. In this case, it does not used egldd parameter.

    Then if we change to @RESTBinding { baseURI = "http://servername:9080/......" } then it works fine.

    Is it same fix ?

    Thanks.

    Hsieh
    Hsieh,

    I don't think this APAR will solve your problem by itself.

    My understanding of the problem was two fold.

    a.) YOu had to be using a web server in front of the WAS server and the requests would be redirected to the WAS server. I think yours is that way..but you need to confirm.

    b.) The port was the only thing missing. I believe you are still required to identify the servername or it does not know what host to go to. I believe the fix allows you to remove the port number.

    take care.
  • Hsieh
    Hsieh
    603 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-11-26T23:13:23Z  
    • markevans
    • ‏2012-11-26T20:58:59Z
    Hsieh,

    I don't think this APAR will solve your problem by itself.

    My understanding of the problem was two fold.

    a.) YOu had to be using a web server in front of the WAS server and the requests would be redirected to the WAS server. I think yours is that way..but you need to confirm.

    b.) The port was the only thing missing. I believe you are still required to identify the servername or it does not know what host to go to. I believe the fix allows you to remove the port number.

    take care.
    Hi Mark,

    I think that explained wrong. I'm using:

    1. The Mozila is browser.
    2. The TOMCAT application server to EGL RUI applications.
    3. The WAS 7 to EGL application service.

    a) The RUI application is load in Mozila browser. OK !
    b) and RUI issues CALL PROGRAM_SERVICE {@RESTBinding { baseURI = "" } from WAS to access Data from DB2
    Note: my deployment descriptor has a parameter for Service Binding as REST with base URL = http://servername:9080/......"
    The call service failed (sorry ... I forgot to get all the message) EGL0001I The error occurred in EGL Rich UI Proxy ... URL is blank.

    Question-1:
    If i have in deployment descriptor Service Binding as REST with base URL = http://servername:9080/...
    The RUI application should not be using this Service Binding ?

    If i change the call statement to CALL PROGRAM_SERVICE {@RESTBinding { baseURI = "http://servername:9080/......" }
    the it's work fine and call service with success.

    Question-2:
    how to call a service that dynamically pointed in the URL from deployment descriptor ?
    I do not want a static call service with the URL assign in the application.

    Thanks !

    Hsieh
  • markevans
    markevans
    2815 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-11-26T23:31:59Z  
    • Hsieh
    • ‏2012-11-26T23:13:23Z
    Hi Mark,

    I think that explained wrong. I'm using:

    1. The Mozila is browser.
    2. The TOMCAT application server to EGL RUI applications.
    3. The WAS 7 to EGL application service.

    a) The RUI application is load in Mozila browser. OK !
    b) and RUI issues CALL PROGRAM_SERVICE {@RESTBinding { baseURI = "" } from WAS to access Data from DB2
    Note: my deployment descriptor has a parameter for Service Binding as REST with base URL = http://servername:9080/......"
    The call service failed (sorry ... I forgot to get all the message) EGL0001I The error occurred in EGL Rich UI Proxy ... URL is blank.

    Question-1:
    If i have in deployment descriptor Service Binding as REST with base URL = http://servername:9080/...
    The RUI application should not be using this Service Binding ?

    If i change the call statement to CALL PROGRAM_SERVICE {@RESTBinding { baseURI = "http://servername:9080/......" }
    the it's work fine and call service with success.

    Question-2:
    how to call a service that dynamically pointed in the URL from deployment descriptor ?
    I do not want a static call service with the URL assign in the application.

    Thanks !

    Hsieh
    Hsieh,

    I am stretching a little on what I know..but based on another customer issue, I think I can answer it. If anyone else feels what I am saying is wrong, PLEASE correct me.

    To start, please review this section of the EGL helps. I think it explains the issue:

    http://publib.boulder.ibm.com/infocenter/rbdhelp/v8r0m0/topic/com.ibm.egl.pg.doc/topics/pegl_ui_richui_rest_interface_var.html

    As I read the above, it says if you use @RESTBinding, then the baseURI value in the RESTBinding properties is the value used in the service call. So, when the value is an empty string, that is what is used.

    If you want to use the deployment descriptor, then you have use the @BindService.

    For your question 2, the suggestion I have seen for the other customer is that the url should not be hardcoded, but be externalized or parameterized. Here are a few choices:

    • Externalize the URL in properties file for each environment, dev, test, production.
    • Have 1 file containing 3 urls. The name would have an extension read from a properties file. The file would contain url_Dev, url_test, url_Production. Dev, test, or Production is read when the application starts.
    • If the html is deployed to the same server as the service. Create a service that extracts the url prefix ie https://xxx.yyy.www.aaa:1234/ABCD and return this to the client to use to access the service.

    You can access properties files from the code...so hopefully this will help.
  • Hsieh
    Hsieh
    603 Posts

    Re: Dynamic Load problem when RUI application deployed

    ‏2012-11-26T23:43:04Z  
    • markevans
    • ‏2012-11-26T23:31:59Z
    Hsieh,

    I am stretching a little on what I know..but based on another customer issue, I think I can answer it. If anyone else feels what I am saying is wrong, PLEASE correct me.

    To start, please review this section of the EGL helps. I think it explains the issue:

    http://publib.boulder.ibm.com/infocenter/rbdhelp/v8r0m0/topic/com.ibm.egl.pg.doc/topics/pegl_ui_richui_rest_interface_var.html

    As I read the above, it says if you use @RESTBinding, then the baseURI value in the RESTBinding properties is the value used in the service call. So, when the value is an empty string, that is what is used.

    If you want to use the deployment descriptor, then you have use the @BindService.

    For your question 2, the suggestion I have seen for the other customer is that the url should not be hardcoded, but be externalized or parameterized. Here are a few choices:

    • Externalize the URL in properties file for each environment, dev, test, production.
    • Have 1 file containing 3 urls. The name would have an extension read from a properties file. The file would contain url_Dev, url_test, url_Production. Dev, test, or Production is read when the application starts.
    • If the html is deployed to the same server as the service. Create a service that extracts the url prefix ie https://xxx.yyy.www.aaa:1234/ABCD and return this to the client to use to access the service.

    You can access properties files from the code...so hopefully this will help.
    Thanks ! I will review the documentation.