This discussion is archived
14 Replies Latest reply: Sep 6, 2012 2:07 AM by Udo RSS

How to reconfigure apex listener - It stucks all the time

JohnMackanzi Newbie
Currently Being Moderated
Greetings!

I m stuck to error Http://503. this happpens suddenly after some days while using appication for fixing this i redeployed apex.war file reinstall glassfish server but error was still there. then i all the time had to restart my app server and so that apex listener was reconfigure and then it was working.

i want to know without restarting my application server how i reconfigure apex listener

My enviroment: Oracle 10 g
Apex: 4.1.1
Glassfish.3.1.1
Application Express Listener: Apex 1.1.3 downloaded from www.oracle.com

URL for confiruging listener is : http://localhost:port/apex/listenerConfigure

First time its works, but if i access after pressing ok it gives message "The APEX Listener is already configured. Please login as Administrator to access APEX Listener Administration."
when i use this link http://localhost:port/apex/listenerAdmin, it requires password for windows security as i check all the passwords but no passwords works.

I m stuck on this from previous 2 months but didnt find any sutable solution. Please tell me if anyone knows


My Analysis: I saw my apex-config.xml file is placed in temp folder in c:/users/admin/appdata
is that a fault ?

Got follwing errors in server log files in domain
[#|2012-08-08T11:42:31.946+0500|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=586;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/C:/Users/Administrator/AppData/Local/Temp/apex2928557998295514068.rar|#]

[#|2012-08-08T11:42:31.948+0500|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=586;_ThreadName=Thread-2;|error in opening zip file --  invalid zip file: file:/C:/Users/Administrator/AppData/Local/Temp/apex2928557998295514068.rar|#]

[#|2012-08-08T11:42:31.950+0500|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=586;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/C:/Users/Administrator/AppData/Local/Temp/apex2928557998295514068.rar|#]

[#|2012-08-08T11:42:31.950+0500|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=586;_ThreadName=Thread-2;|error in opening zip file --  invalid zip file: file:/C:/Users/Administrator/AppData/Local/Temp/apex2928557998295514068.rar|#]

Edited by: Omzz on Aug 8, 2012 12:05 AM
  • 1. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    Hi Omzz,
    My Analysis: I saw my apex-config.xml file is placed in temp folder in c:/users/admin/appdata
    is that a fault ?
    It probably is. Your Temp folder might get cleaned up now and then. This will delete the APEX Listener configuration (including other relevant files stored in that area) causing APEX Listener to hang.
    You should configure APEX Listener to use a permanent location for it's configuration instead. See the [url http://docs.oracle.com/cd/E21611_01/doc.11/e21058/config_file.htm#BABIBHAJ]corresponding chapter of the Installation Guide for details.
    Note that this also concerns the caching directory if you use caching. A recent post of another user showed that this seems to be forgotten sometimes: {thread:id=2424440}

    -Udo
  • 2. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    I changed like this in web.xml file but it doesnt works.
    First of all when i changed and saved it i dont know how to convert it in*.war file, then i make apex folder a apex.rar file and upload on glassfish application tag, but it gives error that its an emplty file


    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4"
         xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
         <display-name>ApexMod</display-name>


         <context-param>
              <param-name>config.dir</param-name>
              <E:/Apex>${java.io.tmpdir}/APEX</param-value>
         </context-param>

         <context-param>
              <param-name>version</param-name>
              <param-value>1.1.3.243.11.40</param-value>
         </context-param>
         
         <listener>
              <listener-class>oracle.dbtools.rt.web.SCListener</listener-class>
         </listener>

         <servlet>
              <description>
              </description>
              <display-name>HttpEndPoint</display-name>
              <servlet-name>HttpEndPoint</servlet-name>
              <servlet-class>oracle.dbtools.rt.web.HttpEndpoint</servlet-class>
         </servlet>

         <servlet-mapping>
              <servlet-name>HttpEndPoint</servlet-name>
              <url-pattern>/*</url-pattern>
         </servlet-mapping>
         <servlet>
              <description>
              </description>
              <display-name>Config</display-name>
              <servlet-name>Config</servlet-name>
              <servlet-class>oracle.dbtools.apex.config.Config</servlet-class>
         </servlet>

         <servlet-mapping>
              <servlet-name>Config</servlet-name>
              <url-pattern>/Config</url-pattern>
         </servlet-mapping>
         <servlet>
              <description>
              </description>
              <display-name>Admin</display-name>
              <servlet-name>Admin</servlet-name>
              <servlet-class>oracle.dbtools.apex.admin.Admin</servlet-class>
         </servlet>

         <servlet-mapping>
              <servlet-name>Admin</servlet-name>
              <url-pattern>/Admin</url-pattern>
         </servlet-mapping>

         <servlet-mapping>
              <servlet-name>Admin</servlet-name>
              <url-pattern>/listenerAdmin</url-pattern>
         </servlet-mapping>

         <servlet-mapping>
              <servlet-name>Admin</servlet-name>
              <url-pattern>/listenerConfigure</url-pattern>
         </servlet-mapping>

         <servlet-mapping>
              <servlet-name>Admin</servlet-name>
              <url-pattern>/listenerStatus</url-pattern>
         </servlet-mapping>

         <servlet>
              <description>
              </description>
              <display-name>Forbidden</display-name>
              <servlet-name>Forbidden</servlet-name>
              <servlet-class>oracle.dbtools.apex.Forbidden</servlet-class>
         </servlet>

         <servlet-mapping>
              <servlet-name>Forbidden</servlet-name>
              <url-pattern>/____embedded/*</url-pattern>
         </servlet-mapping>

         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>

         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>APEX Listener Administration</web-resource-name>
                   <url-pattern>/listenerAdmin</url-pattern>
                   <http-method>GET</http-method>
                   <http-method>POST</http-method>
              </web-resource-collection>
              <auth-constraint>
                   <!-- NOTE: This role is not present in the default users file -->
                   <role-name>Admin</role-name>
              </auth-constraint>
         </security-constraint>

         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>APEX Resource Templates</web-resource-name>
                   <url-pattern>/resourceTemplates/*</url-pattern>
                   <http-method>GET</http-method>
              </web-resource-collection>
              <auth-constraint>
                   <!-- NOTE: This role is not present in the default users file -->
                   <role-name>Admin</role-name>
              </auth-constraint>
         </security-constraint>

         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>APEX Resource Templates</web-resource-name>
                   <url-pattern>/_/*</url-pattern>
                   <http-method>GET</http-method>
                   <http-method>PUT</http-method>
                   <http-method>POST</http-method>
                   <http-method>DELETE</http-method>
              </web-resource-collection>
              <auth-constraint>
                   <!-- NOTE: This role is not present in the default users file -->
                   <role-name>Admin</role-name>
              </auth-constraint>
         </security-constraint>

         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>APEX Listener Status</web-resource-name>
                   <url-pattern>/listenerStatus</url-pattern>
                   <http-method>GET</http-method>
              </web-resource-collection>
              <auth-constraint>
                   <!-- NOTE: This role is not present in the default users file -->
                   <role-name>Manager</role-name>
              </auth-constraint>
         </security-constraint>

         <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>APEX</realm-name>
         </login-config>

         <security-role>
              <description>The role that is required to log in to the APEX Listener Administration</description>
              <role-name>Admin</role-name>
         </security-role>

         <security-role>
              <description>The role that is required to log in to the APEX Listener Status</description>
              <role-name>Manager</role-name>
         </security-role>

    </web-app>
  • 3. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    One thing more i read that in "init para" you have to give the path where apex-config.xml file located . But i dont know how to create this file, should i coyp that file from temp folder and paster it in given path in web.xml file ?
  • 4. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    You should change the following block in your web.xml
    <context-param>
    <param-name>config.dir</param-name>
    <E:/Apex>${java.io.tmpdir}/APEX</param-value>
    </context-param>
    to look like something similar to
    <context-param>
      <param-name>config.dir</param-name>
      <param-value>E:/Apex/ApexListener/apex</param-value>
    </context-param>
    One thing more i read that in "init para" you have to give the path where apex-config.xml file located .
    You can use a JVM parameter to pass in a path to the web.xml instead of "hard coding" it in there. But it's not necessary, and I'd recommend to take one step after each other, i.e. start with a fixed path in your web.xml and make your APEX Listener work.

    To create a war file, you should simply use the tool jar shipped with your JDK. The procedure could be something like go to your apex.war, create a temporary folder for repackaging, unpack the apex.war to that temporary folder, edit the web.xml in the temporary folder, repackage the apex.war from the temporary folder, e.g.
    E:
    cd \APEX\ApexListener
    md repack
    cd repack
    jar xf ..\apex.war
    del apex.war
    REM edit web.xml now
    jar cf ..\apex.war .
    rd /S /Q repack
    Note that this example assumes you have the Java bin directory (where jar is located) in your PATH environment variable. You may have to adjust paths to your actual scenario.

    -Udo
  • 5. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    Hi Udo

    <context-param>
    <param-name>config.dir</param-name>
    <param-value>E:/Apex/ApexListener/apex</param-value>
    </context-param>

    i am confused with this path understanding "E:/Apex/ApexListener/apex" .. Is this the path where my apex listener is located apex.war ? which i uploaded on glassfish server under application tag ?
    OR i have to create this location on my any drive e.g its same like E:/Apex/ApexListener/apex .. and apex-config.xml will automatically created in this folder ?

    and second thing

    E:
    cd \APEX\ApexListener
    md repack
    cd repack
    jar xf ..\apex.war
    del apex.war
    REM edit web.xml now
    jar cf ..\apex.war .
    rd /S /Q repack

    in follow these steps and upto edit web.xml its fine. after editing i execute jar cf..\apex.war it gives error

    " D:\apex_listener.1.1.2.131.15.23\repack>jar cf ..\apex.war
    'c' flag requires that input files specified!
    Usage: jar {ctx}[vfm0M] [jar-file] [manifest-file] files ...
    Options:
    -c create new archive
    -t list table of contents for archive
    -x extract named (or all) files from archive
    -v generate verbose output on standard error
    -f specify archive file name
    -m include manifest information from specified manifest file
    -0 store only; use no ZIP compression
    -M Do not create a manifest file for the entries

    If any file is a directory then it is processed recursively.
    Example: to archive two class files into an archive called classes.jar:
    jar cvf classes.jar Foo.class Bar.class
    Note: use the '0' option to create a jar file that can be put in your CLASSPATH"

    what i have to do now ?
  • 6. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    i am confused with this path understanding "E:/Apex/ApexListener/apex" .. Is this the path where my apex listener is located apex.war ?
    Not necessarily. It's a separate path to store your configuration data. You can put it to another location if you want to.
    OR i have to create this location on my any drive e.g its same like E:/Apex/ApexListener/apex .. and apex-config.xml will automatically created in this folder ?
    That's close to the way it is. I'd put an existing apex-config.xml there, e.g. copy from the current temp location.
    in follow these steps and upto edit web.xml its fine. after editing i execute jar cf..\apex.war it gives error
    Then you didn't follow these steps thoroughly. It seems you omitted the *.* at the end of the jar command. It tells the tool to take the files/directories of the current directory.

    -Udo
  • 7. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    Created Jar file with command

    jar cvf apex.war .
  • 8. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    ALL steps done successfully,

    Now i will see some days weather the same error occur or not.

    Thanks For the help Udo!
  • 9. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    Hi Udo !

    i want to discuss that if application is running with 5 tabs (5 pages) e.g. Tab 1 = Information, Tab 2 = Customer Profile, Tab 3 = Presentar Profile, Tab 4 = Group Profile and Tab 5 = sequence, assuming application was running fine glassfish is fine even all the pages are fine and checked by cliking on each page, data is displaying fine, but suddenly the same Http 503 error occurs when click on Tab 1 = Information, although rest of tabs are working fine, after few minutes again another tab is giving the same error.

    How this will cause ? Is that the same issue of apex-config.xml file located in temp folder or not ?
  • 10. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    Hi Omzz,
    [...]but suddenly the same Http 503 error occurs when click on Tab 1 = Information, although rest of tabs are working fine, after few minutes again another tab is giving the same error.
    [...]
    Is that the same issue of apex-config.xml file located in temp folder or not ?
    I don't think so. Could you check your server's log to find out what's causing that error?
    Since you say it basically concerns one tab, I guess somethings wrong on that page, e.g. you have some long running query there that prevents the database connection to be returned to the connection pool. If you click repeatedly, this may consume all connections you have in your pool resulting the APEX Listener to be unable to serve additional requests and hence producing the 503 error. This would heal itself as soon as your long running query ends and the connection is coming back to the pool.

    -Udo
  • 11. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    But the thing is a simple query

    like SLECT * FROM CUSTOMER
    WHERE CUTOMER_ID = 14

    IF IT RUNS ON WEB AFTER SOME DAYS SAME QUERY GIVES ERROR WHILE OTHER PAGES WITH LONG RUNNING QUERY RUNS OK.. VISEVERSA.
  • 12. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    Well, I would have wondered if the 503 affected just one page. But as described above, you need just one page with one long-running query to get all connections busy. It doesn't matter which other page you call - when the connection pool has no idle connection left and is not allowed to open a new one (i.e., limit reached), the request can't be fulfilled. So you need to make sure that your page with a long running query doesn't use up all connections. Often this is caused by impatient users who think repeating a request will show up a result faster - causing an additional request while the first one is still processed in the database. You could prevent such behaviour with application logic. If you already did that but it didn't help you get the deployment stable, you have three other options: Implement a limitation of concurrent requests on pages with long-running queries at application level, reimplement the query basis to make long-running queries end faster, or increase the limit for the number of connections in APEX Listener's connection pool. Note that the latter approach might overload your database...

    -Udo
  • 13. Re: How to reconfigure apex listener - It stucks all the time
    JohnMackanzi Newbie
    Currently Being Moderated
    Hi Udo !

    Back on the same question, today when i login in my apps on 2 page same error occurs "HTTP Status 500 - System Unavailable. Please try again later.

    --------------------------------------------------------------------------------
    type Status report

    messageSystem Unavailable. Please try again later.

    descriptionThe server encountered an internal error (System Unavailable. Please try again later.) that prevented it from fulfilling this request.

    --------------------------------------------------------------------------------
    GlassFish Server Open Source Edition 3.1.1".

    Is that problem with database. because i have to reset my DB for oversoming this error.
    What does it means ? is the query or seesion stucks ? and how i handle this
  • 14. Re: How to reconfigure apex listener - It stucks all the time
    Udo Guru
    Currently Being Moderated
    Hi Omzz,

    sorry for the late reply. Could you please provide APEX Listener's log output for that 500 error? It will usually provide additional information on the reason for that error, in many cases some ORA-Stack trace that will hint on what is wrong in your application or somewhere else. Without that piece of information it's hard to tell what to do...

    -Udo

Legend

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