This discussion is archived
4 Replies Latest reply: Mar 5, 2013 11:28 AM by 994961 RSS

static resource issue when using apex listener 1.1.4

994727 Newbie
Currently Being Moderated
Greetings experts!

After about 4 full days on attempting to get this to work I thought asking here might be helpful!

I'm using the following

Oracle 11.2.0.3.0
Apex 4.2.1.00.08
Apex Listener 1.1.4
Tomcat

The oracle db itself is on a remote server that had apex installed and need apex listener separate from the db itself...

Downloaded fresh copy of apex and apex listener, unzipped each one. Unzipper apex listener's war file, took the images folder from apex itself and moved it into apex listener's unzipped directory. Renamed images to i and then zipped it up again into apex.war. So up to this point, i have an apex.war as it was originally and then just added the images directory (as i) that was from the apex installation into it, in its root directory.

APEX_040200.wwv_flow_image_prefix shows g_image_prefix = './i/'

After taking the apex.war file (for the listener) and deploying it, I go to http://path.to/apex/listenerConfigure and am able to successfully enter in information here. After I click Apply, I get a blank screen.

Checking the html source, I see some of the static resources (javascript, css, images) are as follows (i selectively copied/pasted the lines):

<link rel="stylesheet" href="./i/libraries/jquery-ui/1.8.22/themes/base/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="./i/css/apex_builder.min.css?v=4.2.1.00.08" type="text/css" />
<link rel="stylesheet" href="./i/css/apex_ui.min.css?v=4.2.1.00.08" type="text/css" />
<script src="./i/libraries/apex/minified/desktop_all.min.js?v=4.2.1.00.08" type="text/javascript"></script>
<script src="./i/libraries/apex/minified/legacy.min.js?v=4.2.1.00.08" type="text/javascript"></script>

Furthermore, I see all the elements within the source code are there ... and this is confirmed by actually (using internet explorer) going to the View menu and then Style > No Style ... after doing that you'll see everything come up but since the website doesn't degrade gracefully and relies on javascript to function, nothing works...

Having said that, after checking the access logs, I see that the first file above returns http 200 while the rest return http 404. As an extra step for good measure, I go directly to each file within the browser as follows

http://path.to/apex/i/libraries/jquery-ui/1.8.22/themes/base/jquery-ui.min.css <--- returns back fine
http://path.to/apex/i/css/apex_builder.min.css?v=4.2.1.00.08 <--- not found
http://path.to/apex/i/css/apex_ui.min.css?v=4.2.1.00.08 <--- not found
http://path.to/apex/i/libraries/apex/minified/desktop_all.min.js?v=4.2.1.00.08 <--- not found
http://path.to/apex/i/libraries/apex/minified/legacy.min.js?v=4.2.1.00.08 <--- not found

But then the kicker is removing the query string from the the css and js files, all get returned to problem:

http://path.to/apex/i/css/apex_builder.min.css <--- removed +?v=4.2.1.00.08+, then found successfully
http://path.to/apex/i/css/apex_ui.min.css <--- removed +?v=4.2.1.00.08+, then found successfully
http://path.to/apex/i/libraries/apex/minified/desktop_all.min.js <--- removed +?v=4.2.1.00.08+, then found successfully
http://path.to/apex/i/libraries/apex/minified/legacy.min.js <--- removed +?v=4.2.1.00.08+, then found successfully

A colleague of mine was able to deploy just the static files itself within their own "container" (if you will) as such

http://path.to/some_other_container/desktop_all.min.js?v=4.2.1.00.08

and the file was able to come back successfully...

This leads me to believe that it isn't a web server issue but rather some apex listener related...

Any insight would be greatly appreciated... For what it's worth, and though I'm not an expert on this by any means, I've pretty much reach every forum post regarding apex listener and images and as you can see have been unsuccessful. I saw there were some other potential issues but it affected installations that targeted Oracle 10.x and not 11.x.

Anybody know how to resolve?

Thanks in advance for your consideration...


PS. I also tried to do this as Apex Listener 1.1.4 Standalone (using the -D options for images and install path, etc) and have had the same exact results...

Edited by: 991724 on Mar 4, 2013 12:59 PM
Fixed two typos
  • 1. Re: static resource issue when using apex listener 1.1.4
    Udo Guru
    Currently Being Moderated
    Hello, and welcome to the OTN forums!
    Unzipper apex listener's war file, took the images folder from apex itself and moved it into apex listener's unzipped directory.
    I'm sorry to say, but that's wrong. Where did you find the instruction to move the images into APEX Listener's context?
    As you've found out, your image prefix has the (default) value +/i/+ , so hosting the images in +/apex/i/+ won't work.
    If you didn't remove the ROOT context from your Tomcat, just copy the images-directory of your unzipped APEX installation package to a directory i below the directory of the ROOT context of your Tomcat and you are done, e. g.
    cp -R /var/tmp/apex/images/ $CATALINA_HOME/webapps/ROOT/i
    If you removed that ROOT context, create a war file named i.war from the contents of the images-directory (as described in APEX Listener's Installation Guide) and deploy it to your Tomcat.
    PS. I also tried to do this as Apex Listener 1.1.4 Standalone (using the -D options for images and install path, etc) and have had the same exact results...
    Probably you had some typo in your path. Otherwhise APEX Listener will create a context +/i/+ that hosts the static contents contained in the path you've entered.

    -Udo
  • 2. Re: static resource issue when using apex listener 1.1.4
    994727 Newbie
    Currently Being Moderated
    ...

    Edited by: 991724 on Mar 5, 2013 9:35 AM
    Deleted because my post was messed up due to including html -- please check the following
  • 3. Re: static resource issue when using apex listener 1.1.4
    994727 Newbie
    Currently Being Moderated
    Hey Udo, thanks for the quick reply! Please forgive any misunderstanding that I may have...
    Unzipper apex listener's war file, took the images folder from apex itself and moved it into apex listener's unzipped directory.
    I'm sorry to say, but that's wrong. Where did you find the instruction to move the images into APEX Listener's context?
    Many forum replies I saw had people say, similarly as you've done below, "copy the images folder from the apex download into your_apex_deployment/i" -- perhaps I am misunderstanding the whole notion of "context"?
    As you've found out, your image prefix has the (default) value +/i/+ , so hosting the images in +/apex/i/+ won't work.
    Not sure I understand here; in the OP, image prefix shows to be './i/' (please notice the . )...

    We also have a somewhat unique situation ... We have an internal cloud whereby we select a package to deploy (.war files, for example) and then press a button to deploy. We don't have CLI access so I don't know how being able to specify the image directory can be done...

    Having said all that, how can the situation within the OP be explained? Especially given your points of it being done wrong, then it would appear that nothing within the images path should load properly but please remember this isn't the case... Please allow me a moment to rephrase and perhaps be a bit more explicit and verbose...

    In the URL, when going to the apex listener deployment, I see a blank page. When viewing the source, I see all the source code....

    *Now, in internet explorer, when going to the "View" menu, then "Style" menu, then selecting "No Style"... I in fact see images and styling applied (confirm with picture):*

    http://i49.tinypic.com/28m1v2h.png ... if the image doesn't come up, perhaps this might http://tinypic.com/r/28m1v2h/6

    If it were done wrong, how would it partially be able to be applied?


    Though when removing ?v=4.2.1.00.08 from the javascript and css includes, and going to it directly within the URL, it comes back successfully...


    It appears that there is some kind of mapping issue with Apex 4.2.1 ...

    Does all of that make sense?


    I was thinking, is there a way to specify within Apex itself when outputting the javascript and css includes within the html, to supress the auto versioning? Meaning don't add the version query string onto the end of the .js and .css files; I understand this was added in 4.2.1....
  • 4. Re: static resource issue when using apex listener 1.1.4
    994961 Newbie
    Currently Being Moderated
    The setting for the APEX images context path is in the APEX installation. You will need to run the reset_image_prefix.sql script and specify "/i/" instead of "./i/":

    From command line or shell:
    Change the folder to the <apex installation folder>\utilities
    Login to your database with sqlplus
    User: sys as sysdba
    Password: <...>
    Run SQL>@reset_image_prefix.sql
    Specify: /i/

    It takes a couple of minutes to run and it will not require restarting of the database service.

    Reference:
    http://www.oracle.com/technetwork/developer-tools/apex-listener/apex-listener-v1-157668.pdf

Legend

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