4 Replies Latest reply on Feb 3, 2011 3:14 PM by Udo

    Problem with multiple Apex listeners on same Weblogic server

    Haakon
      I've got a strange problem when trying to set up two separate listeners on the same Weblogic server.
      Listeners are deployed as separate applications in separate logical servers with different port numbers.

      What happens is, both listeners responds, but the second listener seems to redirect directly to the first.
      That is; it opens the same Apex database as the first, and when trying to run http://<server>:<portnum>/apex/listenerConfigure - it claims that the listener is already configured.

      Has anyone successfully set up two separate listeners on the same Weblogic server?
      Could'nt find anything specific on this on this forum or on Metalink...

      Regards,
      -Haakon-
        • 1. Re: Problem with multiple Apex listeners on same Weblogic server
          Udo
          Hello Haakon,


          though I don't use WLS myself, I guess the reason is the apex-config.xml. You probably haven't reconfigured its location in both cases, so both Listener deployments will use the same location, which is java.io.tmpdir. Some other J2EE servers (e.g. Tomcat) use a different tmpdir for each webapp. As far as I know, the WLS defaults to one tmpdir per domain, so your two Listener instances share it.
          If that's true, there are two solutions for your problem: Locate each Listener instance in a separate domain or reconfigure the location for the config file. The latter can be achieved by changing the corresponding value in the web.xml.
          I recommend to do this within the war-file before you deploy it.

          -Udo
          • 2. Re: Problem with multiple Apex listeners on same Weblogic server
            Haakon
            Udo, thank you for your quick reply.

            I checked out the apex.war file, and the web.xml states the following:
                 <servlet>
                      <description>
                      </description>
                      <display-name>ModApex</display-name>
                      <servlet-name>ModApex</servlet-name>
                      <servlet-class>oracle.dbtools.apex.ModApex</servlet-class>
            <!--               
                           <init-param>
                               <param-name>config.dir</param-name>
                               <param-value>${java.io.tmpdir}/APEX</param-value>
                          </init-param>
                          <init-param>
                              <param-name>cache.dir</param-name>
                              <param-value>${java.io.tmpdir}/APEX/cache</param-value>
                          </init-param>
            -->
                 </servlet>
            As you see, the java.io.tmpdir code is commented out, so I guess that means it defaults to whatever the WLS gives it. And when importing the same war-file into two listeners, they both default to the same?

            I'll try to uncomment the init-param code and give them different directory names for my second listener instance. Let's see how that goes....

            Regards,
            -Haakon-
            • 3. Re: Problem with multiple Apex listeners on same Weblogic server
              Haakon
              Yep, that seemed to do the trick actually. Second listener now communicating with different database!
              Thanks Udo!

              So far, images are displayed correctly - but I suspect that I might have a potential error hidden here too, as the second image war file has the application deployment alias of "/i2", which is not reflected in the Apex database I guess....
              As long as it's all the same Apex version, it will probably not matter, but I'll see if I can figure out how to get it 100% correct.


              Regards,
              -Haakon-
              • 4. Re: Problem with multiple Apex listeners on same Weblogic server
                Udo
                Haakon,

                great to hear you got your Listeners working as intended!

                You can run a script ( reset_image_prefix.sql ) to change the images prefix on the second database instance to give it a different value. The script is located in the directory utilities of your APEX installation package and should be run as sys/sysdba. Make sure to disable all access to the APEX on that instance while your are running the script. It will take some time, as there are many references to be updated.

                -Udo