Topic
  • 16 replies
  • Latest Post - ‏2013-02-06T18:56:36Z by ozair
ozair
ozair
15 Posts

Pinned topic Busy indicator does not hide upon WL startup

‏2013-01-27T16:52:16Z |
I recently upgraded to Worklight 5.0.5.1 and my application does not hide the busy indicator shown by WL upon startup. It stays on the page with the text "loading..".

In my app, I have security enabled using WebSphere LTPA, so upon loading the first page, I am presenting a form login page. I cannot access the form due to the WL busy indicator.

I traced through the code in the browser debugger and found that WL creates an indicator, WL.Client.__showBusy(); in wlclient.js, but I don't see a corresponding WL.Client.__hideBusy(); executed afterwards, even though the security framework methods via the challengeHandler are being invoked.

I am able to hide it manually in my code using the WL.Client.__hideBusy(); but seems like this is a bug. Can someone advise if there has been a change to the security framework or if I need to modify my code.

Thanks

Ozair
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-27T17:33:15Z  
    Hello.

    1. You say you have upgraded to v5.0.5.1 - from which version did you upgrade? There are been many changes to the security framework, these took place in 5.0.0.3 though.
    2. Did your app work fine in regards to app launch prior to upgrading?
    3. Could it be that something has changed on your end to cause a longer timeout?

    Hard to discern what is really happening without your app scenario and any logs...

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-27T20:47:22Z  
    • IdanAdar
    • ‏2013-01-27T17:33:15Z
    Hello.

    1. You say you have upgraded to v5.0.5.1 - from which version did you upgrade? There are been many changes to the security framework, these took place in 5.0.0.3 though.
    2. Did your app work fine in regards to app launch prior to upgrading?
    3. Could it be that something has changed on your end to cause a longer timeout?

    Hard to discern what is really happening without your app scenario and any logs...

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Thanks Idan for looking into the issue. I upgraded from WL 5.0.5 to 5.0.5.1, I was aware of the changes in 5.0.0.3 and modified my code to use the challengeHandler wrapper and authenticationConfig.xml.

    I have setup my authentication-config.xml with the following:
    <mobileSecurityTest name="mobileTests">
    <testUser realm="WASLTPARealm"/>
    </mobileSecurityTest>
    <realm name="WASLTPARealm" loginModule="WASLTPAModule">
    <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
    <parameter name="login-page" value="/login.html"/>
    <parameter name="error-page" value="/loginError.html"/>
    </realm>
    <loginModule name="WASLTPAModule">
    <className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
    </loginModule>

    -added login form snippet to web.xml.

    Here is my scenario:

    Web Browser -> WL Form-based authentication using WebSphere LTPA -> Backend

    Before the upgrade, when I accessed my page via the form (unauthenticated access), I would see the handleChallenge method invoked, but now I am seeing the handleFailure method invoked in the logs.

    wlclient init started worklight.js:1112
    Request [/MyApp/apps/services/api/MyApp/mobilewebapp/init]
    POST https://<host>:port/MyApp/apps/services/api/MyApp/mobilewebapp/init 403 (Forbidden) base.js:889
    >> challengeHandler1.handleFailure auth.js:157
    >> Authenticator.onBeforeLogin auth.js:243
    << Authenticator.onBeforeLogin auth.js:263
    >> Authenticator.onShowLogin auth.js:267
    << Authenticator.onShowLogin auth.js:283
    << challengeHandler1.handleFailure

    The /init call completes in about 10 seconds. In my onShowLogin, I show my login page from my dom, via dom.show("FormId")

    I noticed that if I hit my page multiple times, say after a failed login attempt, it complains with the following error:

    Error 500: com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException: SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:defaultWIMFileBasedRealm/uid=myid,o=defaultWIMFileBasedRealm.

    I followed the steps listed in this document:
    http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_20_1_-_Form_Based_Authentication.pdf
    http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_23_-_WebSphere_LTPA_Based_Authentication.pdf

    Thanks

    Ozair
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-27T21:53:22Z  
    • ozair
    • ‏2013-01-27T20:47:22Z
    Thanks Idan for looking into the issue. I upgraded from WL 5.0.5 to 5.0.5.1, I was aware of the changes in 5.0.0.3 and modified my code to use the challengeHandler wrapper and authenticationConfig.xml.

    I have setup my authentication-config.xml with the following:
    <mobileSecurityTest name="mobileTests">
    <testUser realm="WASLTPARealm"/>
    </mobileSecurityTest>
    <realm name="WASLTPARealm" loginModule="WASLTPAModule">
    <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
    <parameter name="login-page" value="/login.html"/>
    <parameter name="error-page" value="/loginError.html"/>
    </realm>
    <loginModule name="WASLTPAModule">
    <className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
    </loginModule>

    -added login form snippet to web.xml.

    Here is my scenario:

    Web Browser -> WL Form-based authentication using WebSphere LTPA -> Backend

    Before the upgrade, when I accessed my page via the form (unauthenticated access), I would see the handleChallenge method invoked, but now I am seeing the handleFailure method invoked in the logs.

    wlclient init started worklight.js:1112
    Request [/MyApp/apps/services/api/MyApp/mobilewebapp/init]
    POST https://<host>:port/MyApp/apps/services/api/MyApp/mobilewebapp/init 403 (Forbidden) base.js:889
    >> challengeHandler1.handleFailure auth.js:157
    >> Authenticator.onBeforeLogin auth.js:243
    << Authenticator.onBeforeLogin auth.js:263
    >> Authenticator.onShowLogin auth.js:267
    << Authenticator.onShowLogin auth.js:283
    << challengeHandler1.handleFailure

    The /init call completes in about 10 seconds. In my onShowLogin, I show my login page from my dom, via dom.show("FormId")

    I noticed that if I hit my page multiple times, say after a failed login attempt, it complains with the following error:

    Error 500: com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException: SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:defaultWIMFileBasedRealm/uid=myid,o=defaultWIMFileBasedRealm.

    I followed the steps listed in this document:
    http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_20_1_-_Form_Based_Authentication.pdf
    http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_23_-_WebSphere_LTPA_Based_Authentication.pdf

    Thanks

    Ozair
    Just a clarification, I understand why the handleFailure method was being called, as I had an error in the system logs because I was missing my login.html file. So, you can ignore the 500 error I was getting in my previous post as it was related to this issue.

    The outstanding issue is in the client-side wlclient.js file, and the busy indicator not hiding. I am able to workaround the issue by explicitly hiding it, but wondering if there is something else I am not doing correctly. I did check my WL 5.0.5 app, wlclient.js and did not see any code where the WL busy indicator is shown.

    Thanks

    Ozair
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-28T05:37:59Z  
    Worklight 5.0.5.1 features support for BlackBerry 10, Windows Phone 8 and the upcoming iOS 6.1; nothing else has been added to this release.
    http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/index.jsp

    I'll see if someone could take a look here and perhaps spot an error or a defect.
    Did this flow you depict in your previous post work fine in v5.0.5?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-28T13:47:23Z  
    • IdanAdar
    • ‏2013-01-28T05:37:59Z
    Worklight 5.0.5.1 features support for BlackBerry 10, Windows Phone 8 and the upcoming iOS 6.1; nothing else has been added to this release.
    http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/index.jsp

    I'll see if someone could take a look here and perhaps spot an error or a defect.
    Did this flow you depict in your previous post work fine in v5.0.5?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I traced through the code and found a difference in the wlclient.js (WL 5.0.5.1) on line 844, where I see the

    WL.Client.__showBusy();

    I opened up another app, which I packaged using WL 5.0.5. I searched the wlclient.js file and did not find the WL.Client.__showBusy(); line.

    In the second scenario, I don't use WebSphere LTPA but using the adapter-based authentication, but the app is still making the init call, and this was how my app was behaving on WL5051.

    Attached are the two files, hope this helps.

    Ozair
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-28T20:45:15Z  
    • ozair
    • ‏2013-01-28T13:47:23Z
    Hi Idan,

    I traced through the code and found a difference in the wlclient.js (WL 5.0.5.1) on line 844, where I see the

    WL.Client.__showBusy();

    I opened up another app, which I packaged using WL 5.0.5. I searched the wlclient.js file and did not find the WL.Client.__showBusy(); line.

    In the second scenario, I don't use WebSphere LTPA but using the adapter-based authentication, but the app is still making the init call, and this was how my app was behaving on WL5051.

    Attached are the two files, hope this helps.

    Ozair
    Which environments have you seen this occur on (android, ios, web)? And what happens when you try this on each environment? Or does the indicator show up just the same on every environment? And have you done it only on the simulators or the devices as well?
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-29T13:55:34Z  
    Which environments have you seen this occur on (android, ios, web)? And what happens when you try this on each environment? Or does the indicator show up just the same on every environment? And have you done it only on the simulators or the devices as well?
    I have only tried this on a mobile app.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-29T15:33:45Z  
    • ozair
    • ‏2013-01-29T13:55:34Z
    I have only tried this on a mobile app.
    But which mobile app have you tried this on? Was it Android, iPhone, Blackberry?
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-29T18:41:03Z  
    But which mobile app have you tried this on? Was it Android, iPhone, Blackberry?
    Did not try on any platform. I'm in my test phase, and just running it as a Mobile Web application from the Worklight Console Web browser.
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-01-30T05:42:09Z  
    ozair,
    Can you create a new project and application - no LTPA, no WebSphere, and see if the problem persists?
    This will help minimize where the problem is: in our busy indicator implementation or with setting up LTPA, timouts, etc...

    Simply create a new Worklight project and application.
    I see in your original post, that you used Android, so also add an android environment.
    Next build and launch your app and lets see if this happens or not...

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-02T10:05:23Z  
    • IdanAdar
    • ‏2013-01-30T05:42:09Z
    ozair,
    Can you create a new project and application - no LTPA, no WebSphere, and see if the problem persists?
    This will help minimize where the problem is: in our busy indicator implementation or with setting up LTPA, timouts, etc...

    Simply create a new Worklight project and application.
    I see in your original post, that you used Android, so also add an android environment.
    Next build and launch your app and lets see if this happens or not...

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    I have the exact same issue.

    I installed fresh 5.0.5.1
    Somehow, for the Android device, the busy Indicator doesn't go away at start up even though I have set it to connectOnStartup : false
    This doesn't happen on the Android emulator, so can't debug it.

    I have tested with connection, without WIFI. And the strange thing is - the first time i load the app after rebootting the device, the busy indicator does go away. However, if I remove the app from the list and start the app again, it stays.

    I have installed about 7 test app on my device. those test apps were fine originally the first time i started. Afterwards, I installed this app, suddenly all the other 7 apps and this app have the busy indicator on forever and hanging on the front page.

    Here is my app code: Nothing much on it. But it's certainly reproducible on my 2 android devices. BB10 environment was OK though on my BB10 device. Thanks.
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-03T07:32:32Z  
    Samsung Galaxy Nexus
    Android OS 4.2
    Eclipse Juno 4.2.1
    IBM Worklight Studio 5.0.5100.v20130115_1827
    Android Development Tools 21.0.1.v201212060256-543035
    I have all API level downloaded, by default Worklight uses 2.2 (API level 8)

    Steps:
    New Worklight project >> New Worklight application >> Added Android environment
    1. connectOnStartup = false

    Launching the app several times, I do see a busy indicator blinking at the very beginning, every time while launching the app.

    2. connectOnStartup = true

    Launching the app several times, I do see a busy indicator for a short while longer, every time while launching the app.

    In both cases the busy indicator does not remain on the screen.
    There indeed seems to be a change from 5.0.5, where in the case of connectOnStartup = false/true, there was no busy indicator on startup.

    I have opened a Customer Issue.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-03T14:25:11Z  
    • IdanAdar
    • ‏2013-02-03T06:03:23Z
    Samsung Galaxy Nexus
    Android OS 4.2
    Eclipse Juno 4.2.1
    IBM Worklight Studio 5.0.5100.v20130115_1827
    Android Development Tools 21.0.1.v201212060256-543035
    I have all API level downloaded, by default Worklight uses 2.2 (API level 8)

    Steps:
    New Worklight project >> New Worklight application >> Added Android environment
    1. connectOnStartup = false

    Launching the app several times, I do see a busy indicator blinking at the very beginning, every time while launching the app.

    2. connectOnStartup = true

    Launching the app several times, I do see a busy indicator for a short while longer, every time while launching the app.

    In both cases the busy indicator does not remain on the screen.
    There indeed seems to be a change from 5.0.5, where in the case of connectOnStartup = false/true, there was no busy indicator on startup.

    I have opened a Customer Issue.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Yea it's very mysterious. I was very certain that I had successful startup on the app that I attached. The first one or 2 times for sure. Then I continued my development and redeployed the APK as usual. Suddenly, it hung on the busy indicator front page. Then when I checked the other apps that were already installed (which was tested OK before), there were all acting the same way suddenly. Not sure what else I can provide you. Let me know. Thanks.
  • cheungah
    cheungah
    1 Post

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-04T06:48:22Z  
    • IdanAdar
    • ‏2013-02-03T06:03:23Z
    Samsung Galaxy Nexus
    Android OS 4.2
    Eclipse Juno 4.2.1
    IBM Worklight Studio 5.0.5100.v20130115_1827
    Android Development Tools 21.0.1.v201212060256-543035
    I have all API level downloaded, by default Worklight uses 2.2 (API level 8)

    Steps:
    New Worklight project >> New Worklight application >> Added Android environment
    1. connectOnStartup = false

    Launching the app several times, I do see a busy indicator blinking at the very beginning, every time while launching the app.

    2. connectOnStartup = true

    Launching the app several times, I do see a busy indicator for a short while longer, every time while launching the app.

    In both cases the busy indicator does not remain on the screen.
    There indeed seems to be a change from 5.0.5, where in the case of connectOnStartup = false/true, there was no busy indicator on startup.

    I have opened a Customer Issue.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    I hit the same problem on my 5.0.5.1 too, even it is just a helloWorld app with connectOnStartup ( Android emulator and device )..
    I think it's the bug in the core wlclient.js.
    Will it be fixed asap?
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-04T06:54:00Z  
    The defect has been assigned to a developer and will be investigated; we can't make promises over the forum of course, but it is scheduled for an upcoming release of Worklight.

    That is, as I mentioned I still cannot get to a point where it is stuck on the screen...
    See my previous post above.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ozair
    ozair
    15 Posts

    Re: Busy indicator does not hide upon WL startup

    ‏2013-02-06T18:56:36Z  
    • cheungah
    • ‏2013-02-04T06:48:22Z
    I hit the same problem on my 5.0.5.1 too, even it is just a helloWorld app with connectOnStartup ( Android emulator and device )..
    I think it's the bug in the core wlclient.js.
    Will it be fixed asap?
    Hi Idan,

    Sorry, I did not get chance to recreate the issue with new WL project. I was unable to recreate from a new WL project, but do see a busy indicator quickly show and hide as you also saw. If you want to take a look at my code where I have the issue, let me know.

    Thanks

    Ozair