EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Dynamic Loading question

    Posted Mon January 26, 2015 04:24 PM

    I'm experimenting with Dynamic Loading in RBD 9.1.1.  I have a simple MainHandler that tries to load a second handler dynamically.  The second handler is called "LoginHandler".

    When deployed to my local WAS 8.5, I keep seeing this in the DynamicLoader.showDebugView and the load fails:

    ui.LoginHandler load fail: Cannot load ui.LoginHandler: EGL1603E: See log. ID:Jan 26, 2015, 4:00:23 PM.1 

    Where is this "log" the message refers to?

     

    Thanks,

    Kendall

    Kendall.Coolidge


  • 2.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 08:45 AM

    For deployed applications you need to add entries to the RUI UI Deployment tab in the deployment descriptor.

    Click on the main handler at the top and a window will appear for dynamic loading.

    Click configure to select the handlers to load dynamically.

    Redeploy your application

     

    We use dynamic loading extensively

     

    Rick

    RickGentner


  • 3.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 09:09 AM

    Thanks for the reply, Rick.

    I think I'm already doing what you suggest.  Could you look at the attached screen shot of my deployment descriptor and see if it looks right to you?

    Here's what I'm doing in code -

    In my MainHandler, I make a type reference to my LoginHandler, like so:

       loginWidget LoginHandler;

    In my start() function of my MainHandler, I do this:

        DynamicLoader.loadDoneListeners ::= processLoadDone;

    I have a button in my MainHandler that when clicked, does this:

        DynamicLoader.loadHandler("ui.LoginHandler");

    And my processLoadDone function looks like this

         function processLoadDone(event HandlerLoadedEvent in)

            SysLib.writeStdErr("in processLoadDone");
            
            // access a function in the loaded handler
            theHandler any = event.theHandler;
     
            // the use of a handler (or other container) of type any requires
            // a type reference so that your code can directly access a field 
            // or function that is embedded in that container
            if(theHandler isa LoginHandler)
                if(loginWidget == null)
                    loginWidget = new LoginHandler{};
                    loginWidget.ui{layoutData = new GridLayoutData{row = 1, column = 2}};
                    content.children =[loginWidget.ui];
                    SysLib.writeStdout("loaded loginHandler");
                    return;
                end
            end
        end

     

    All seems to work in debug or preview, but I don't think that's a valid test in the case of Dynamic Loading.  Does this look right to you?

    Thanks again,

    Kendall

    Kendall.Coolidge


  • 4.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 09:33 AM

    The deployment descriptor looks right as does most of the code,

    The only thing I do differently to display the handler is

    ui.children = event.initialUI;

     

     

    RickGentner


  • 5.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 11:47 AM

    Hmmmm.  So I exported my project from RBD 9.1.1 and imported into 8.5.1.2 and my code runs fine.

    Attached is the Debug View...

    I'm going to do some more testing and make sure.

     

    Kendall

    Kendall.Coolidge


  • 6.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 03:04 PM

    Ahah.  To answer my original question, the log referred to here:

    ui.LoginHandler load fail: Cannot load ui.LoginHandler: EGL1603E: See log. ID:Jan 26, 2015, 4:00:23 PM.1 

    is the WebSphere log.

    In it I found this:

    [1/27/15 13:19:55:039 EST] 000000ad SystemErr     R   Jan 27, 2015, 1:19:55 PM.0  EGL1603E:EGL1603E An error occurred while loading the com.ibm.egl.rui.loader.services.ModuleLoaderService_Impl service. Error: java.lang.ClassNotFoundException:com.ibm.egl.rui.loader.services.ModuleLoaderService_Impl.
    EGL0001I The error occurred in EGL Rich UI Proxy.
        detail1:500
        detail2:FAILED
        detail3:

    I could see that class up in the com.ibm.egl.rui.loader.services package, so I did a project -> clean on all the IBM projects and voila, my sample started working in 9.1.1.

    Thanks for checking my work, Rick.  I think I'm all set now.

    Kendall

    Kendall.Coolidge


  • 7.  Re: Dynamic Loading question

    Posted Tue January 27, 2015 03:46 PM

    Kendall and Rick, 

     

    Glad it started working and thanks for posting the info in the forum so others can share in the diagnostics and the solution.

     

    Mark

    markevans


  • 8.  Re: Dynamic Loading question

    Posted Wed January 28, 2015 08:11 AM

    I have been bitten by the "project clean" more times than I can count.

    Sometimes I have found that the Developer PC just needs to be rebooted to solve a problem.

    Glad you got it working

     

    RickGentner