This discussion is archived
1 2 Previous Next 15 Replies Latest reply: May 7, 2013 8:45 AM by TonieD RSS

JQuery Mobile template: Error Loading Page

Robert Hantink Newbie
Currently Being Moderated
Hello Apex community,

My name is Robert and this my first post on this forum. I've been developing with Oracle Apex for over a year now.
I've recently started developing for mobile devices with Oracle Apex 4.2.
However i stumble on serveral problems including the one I will describe here:
The problem is best described by this screenshot:
[ http://roberthantink.com/img/Error_loading_page.JPG]
Whenever I log into my JQuery template based application which uses 'Application Express Accounts' as authentication.
I get the following Error: "Error Loading Page".
When inspecting with a development tool I only get this warning:

"The page at https://apex***********.com/nbb/f?p=100:LOGIN_JQM_SMARTPHONE:5788626446201 displayed insecure content from http://apex*******.com/nbb/f?p=100:101:0:::::."

Page 101 is de login page and after the login it should redirect to Home which is page 1. This is all default.

The weird thing is I can log into the application if I am on our company's local network.
And I can also log into the workspace from outside our network, but I cannot get in the Application.
I've also made a 'Sample Database Application' which I can log into from anywhere.

I've searched this forum and of course the internet and could not find anything on this subject.
I hope my explanation is clear enough and that someone could help me out.

Edited by: Robert Hantink on 5-dec-2012 11:09

Edited by: Robert Hantink on 5-dec-2012 11:10
  • 1. Re: JQuery Mobile template: Error Loading Page
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Robert,

    are you getting the error when after you hit the login button or already when the login page is displayed?

    It looks like your page is referring to some static files with an absolut URL which contains http:// as protocol. I assume you don't get the error internally because you access your APEX with the http:// protocol, but if you access it externally your web server is setup to automatically use https://

    So you should check your page for that hard coded http:// and replace it by a relative URL which doesn't contain the protocol or domain name.

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 2. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    Hey Partick,

    Thank you for the response. I forgot that the problem could be that simple.
    I'll try to find if there is some hard-coded protocol in our application or our webserver and then I will let you know if that was the problem.

    Greetings,

    Robert
  • 3. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    Could someone point me a few locations, where this protocol could be hardcoded?
    I'm guessing the Theme/template?
    Could it be defined in the internal workspace or apex_listener?
  • 4. Re: JQuery Mobile template: Error Loading Page
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Robert,

    I think the easiest approach would be to just have a look at the HTML source in your browser. In most browsers you just have to right mouse click to open a context menu where you should fine an option like "View Page Source".

    For a jQuery Mobile app, it's a little bit more complicated to get the right page source, because of all the AJAX loading.

    You have three options:

    1) Check the generated pages

    1) Run your login page
    2) Right mouse click and inspect the source and search for http
    3) Login
    4) Reload the page with the reload button of the browser (that's very important) to get the correct page source code
    5) Right mouse click and inspect the source and search for http

    2) you could also use the "Application Search" feature of APEX (top right corner) and search for http

    3) Use Firebug (plug-in of Firefox) or Developer Tools (of Google Chrome) to check the "Network" pannel and check the URL of all requests.

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 5. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    So here is the update.
    I've checked my themes/templates/pages for hardcoded HTTP/HTTPS and didn't find anything.
    I also inspected and compared the website from inside our network and outside and could not find anything out of the ordinary.

    Because this problem only occurses when i use the JQuery Mobile template I also compared the JQuery template with a Normal template.
    The only thing i noticed besides the different scripts that are found in the <head>tag, is the <base> tag :

    <base href="http://*****************.com:8080/nbb/f?p=100:10:13950022358106::NO:::">

    This tag is only used in the mobile template.

    I have also used the firebug network function and i noticed that when the site is used from outside our network that there is no response to a POST.
    I've uploaded some screenshots to make things clear.

    This is what happens from inside our network when i click on the SUBMIT-button "test" :

    http://roberthantink.com/img/intern1.JPG

    http://roberthantink.com/img/intern2.JPG

    Everything just works and the answer to the POST is a html site.
    However if i do the same thing from outside our network this is what happens:

    http://roberthantink.com/img/extern1.JPG

    http://roberthantink.com/img/extern2.JPG

    The next thing I'm about to check is our webcache and our firewall.
    Because the current port that is used is 443 and maybe we need 8080 and 8181 as well.

    Hope this gives you more of an insight of what is going on.
    Let me know if you need more information.
    Thanks a million so far!!!
  • 6. Re: JQuery Mobile template: Error Loading Page
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Robert,

    is the BASE tag something you find in our jQuery Mobile Page Template? -> Shared Components -> Templates -> Page
    Because I couldn't find it.

    Do you see the BASE tag only if you access your application externally or also if you access it internally? Because if you only see it in the HTML source when you access it externally I would suspect that your Webcache/Firewall is adding it. In that case it looks like that there is a configuration problem, because it should generate a BASE HREF with https and not with http.

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 7. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    No, the base tag is part of the template and it's generated the right way. So https if i use https and http if i use http.
  • 8. Re: JQuery Mobile template: Error Loading Page
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Robert,

    is it possible for you to upload your your application to apex.oracle.com so that I can have a look? You just have to provide the application#.
    Are you using the built-in theme 50 or a custom jQuery Mobile theme?

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 9. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    I am using the default JQuery Mobile Template. We are getting closer to the source of the problem.

    I've installed the sample application called "Sample Database Application". If i log in to the application it does apex.submit('P101_LOGIN'); . and it works.
    So now i am logged in.
    Now in the top right corner of the screen there is a link called "Mobile".
    If you click it and go into mobile-mode it uses the JQuery Mobile Template.
    If you go to Orders and try to delete or save an order it needs a submit and that's what's going wrong.
    And it only goes wrong when you are behind a firewall/webcache with your apex work enviroment.

    So my guess is that somewhere the JQuery Mobile Template
    is redirecting to the original hostname. As we are using webcache-entry this redirect produces an error.
    If i copy and paste the target page manually behind the webcache url the page is loaded succesfully.
    However when using the submit function the error occurs before the redirect.

    So is this something that we did wrong installing apex4.2 or is it a bug in the new JQuery Mobile Template?
    And more important how do we fix it?
  • 10. Re: JQuery Mobile template: Error Loading Page
    Robert Hantink Newbie
    Currently Being Moderated
    Ok, so we found a temporary solution to this problem.
    We have added a few new entries to the webcache which involves more ways to enter HTTP and HTTPS.

    We got a pretty clear idea of what is going wrong in the JQuery Template.
    Somewhere in this template there is some javascript that looks at the
    current serveradress instead of the original behind the webcache. This cause the Error Loading Page message.
    I hope this gives the oracle developers some platform to search for this issue.
    We don't have anymore time to sort this out.

    Thanks for the help, Patrick!!
  • 11. Re: JQuery Mobile template: Error Loading Page
    TonieD Newbie
    Currently Being Moderated
    Hi Robert,

    Could you explain a little more about the problem in the template. We are facing the exact same problem as you described. We also see that refferer ad location is different in the XHR header (http/https).
    We are using no webcache but have a firewall what is doing an SSL ofload for the glassfish server what is hosting apexlistener.

    Thanks in advance,
    Ton
  • 12. Re: JQuery Mobile template: Error Loading Page
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Ton,

    please see the "reverse proxy" threads here on the forum (ie. APEX charts and reverse proxy (Houston we have a problem!!) because I assume you use HTTP between your firewall and Glassfish. Your firewall/glassfish needs to correct the environment variables
    REQUEST_PROTOCOL=https
    HTTP_HOST=external-name:external-port
    because otherwise APEX use the protocol and server name of your glassfish server when it has to generate a fully qualified URL.

    Regards
    Patrick
    -----------
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 13. Re: JQuery Mobile template: Error Loading Page
    TonieD Newbie
    Currently Being Moderated
    Hi Patrick,

    Thanks for the quick response!

    I have a additional question after reading the reverse proxy post you mentioned;

    Is it possible to set these environment variables in the APEX listener (version 2.0.1)?

    Regards,
    Ton
  • 14. Re: JQuery Mobile template: Error Loading Page
    Colm Divilly Journeyer
    Currently Being Moderated
    TonieD wrote:
    Hi Patrick,

    Thanks for the quick response!

    I have a additional question after reading the reverse proxy post you mentioned;

    Is it possible to set these environment variables in the APEX listener (version 2.0.1)?

    Regards,
    Ton
    The process is different when using Listener, since Listener runs within an application server, you need to configure the application server to modify these values rather than Listener.

    In your case, you appear to be using GlassFish, so you will need to consult the GlassFish documentation. There are a number of strategies for proxying from your httpd to glassfish:

    - mod_proxy
    - mod_jk
    - mod_proxy_ajp

    The GlassFish documentation covers how to configure the latter two:

    http://docs.oracle.com/cd/E26576_01/doc.312/e24928/webapps.htm#gfaad, but does not discuss the former.

    However this ticket below, indicates support was added to GF 3.1.2.2 for modifying the request protocol (from http to https) when using mod_proxy, the ticket includes instructions on how to configure this:

    https://java.net/jira/browse/GLASSFISH-15409

    So this sounds like what you need.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points