8 Replies Latest reply on Aug 5, 2011 12:08 PM by rhusar

    Tomcat and ROOT context issue

    nichele

      Hi All,

      i'm experiencing some strange behaviour using mod_cluster + tomcat 6 (apache and tomcat are on the same host)

      In tomcat i have 3 contexts:

      - ROOT

      - webapp1

      - webapp2

       

      I'm trying to stop tomcat and to restart it simulating fail-over and fail-back.

      ISSUE: very often, but not always, the ROOT context is not available (not listed at all in mod_cluster-manager). No issue with the other contexts that are always available and enabled.

       

      With a graceful restart of apache, the ROOT context starts to work fine.

      When it doesn't work, in the apache error.log i see:

       

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(1653): manager_trans INFO (/)

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2296): manager_handler INFO (/) processing: ""

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2339): manager_handler INFO  OK

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(1653): manager_trans CONFIG (/)

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2296): manager_handler CONFIG (/) processing: "JVMRoute=DS01&Host=xx.xx.xx.xx&Port=8009&Type=ajp"

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2339): manager_handler CONFIG  OK

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(1653): manager_trans ENABLE-APP (/)

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2296): manager_handler ENABLE-APP (/) processing: "JVMRoute=DS01&Alias=localhost&Context=%2F"

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2339): manager_handler ENABLE-APP  OK

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(1653): manager_trans REMOVE-APP (/)

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2296): manager_handler REMOVE-APP (/) processing: "JVMRoute=DS01&Alias=localhost&Context=%2F"

      [Tue Aug 02 20:52:33 2011] [debug] mod_manager.c(2339): manager_handler REMOVE-APP  OK

       

      To note "manager_trans REMOVE-APP (/)"

       

      When it works there is :

       

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(1653): manager_trans INFO (/)

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2296): manager_handler INFO (/) processing: ""

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2339): manager_handler INFO  OK

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(1653): manager_trans CONFIG (/)

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2296): manager_handler CONFIG (/) processing: "JVMRoute=DS01&Host=xx.xx.xx.xx&Port=8009&Type=ajp"

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2339): manager_handler CONFIG  OK

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(1653): manager_trans ENABLE-APP (/)

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2296): manager_handler ENABLE-APP (/) processing: "JVMRoute=DS01&Alias=localhost&Context=%2F"

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2339): manager_handler ENABLE-APP  OK

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(1653): manager_trans STATUS (/)

      [Tue Aug 02 20:56:06 2011] [debug] mod_manager.c(2296): manager_handler STATUS (/) processing: "JVMRoute=DS01&Load=100"

       

       

      Do you have ahy hits for helping me ?

       

      Any suggestion ?

       

      Thanks in advance

      ste

       

      Message was edited by: Stefano Nichele UPDATE: with Rado's help, I built a new version of 1.1.2 final jar with the fix for this issue (that was already in jira https://issues.jboss.org/browse/MODCLUSTER-220). Changed code: http://source.jboss.org/browse/mod_cluster/trunk/src/main/java/org/jboss/modcluster/mcmp/impl/ResetRequestSourceImpl.java?r2=601&r1=208 In attachment a patched jar for the ones that can be interested

        • 1. Re: Tomcat and ROOT context issue
          rhusar

          Hi Stefano, whats your mod_cluster version?

          • 2. Re: Tomcat and ROOT context issue
            nichele

            Hi Radoslav,

            i'm using 1.1.2.

             

            ste

            • 3. Re: Tomcat and ROOT context issue
              rhusar

              Hey! Might sound silly, but you could try an older version and see if it works as expected. Also you can have a look at related Jiras if its your use case:

               

              https://issues.jboss.org/browse/MODCLUSTER-220 (fix not in 1.1.2 yet)

              https://issues.jboss.org/browse/MODCLUSTER-188 (just fixed in 1.1.2)

              • 4. Re: Tomcat and ROOT context issue
                nichele

                Many thanks !

                 

                https://issues.jboss.org/browse/MODCLUSTER-220

                 

                is really my issue. Not sure why it's marked as 'Enhancement' because to me it seems a bug but this is not important :-) since it is marked as resolved.

                 

                I'll try to get the fix and maybe port it to version 1.1.2 (i saw (checking diff between rev 599 and 598) the fix is in class ResetRequestSourceImpl

                 

                From your side, when should it be ported on 1.1.2  ? And when a new version wih the fix is planned ? (if you arelady have a plan of course :- ) ).

                 

                At the end, is there anything i can do to help you.

                 

                Ste

                • 5. Re: Tomcat and ROOT context issue
                  rhusar

                  Hi Stefano, you r welcome!

                   

                  Not sure why it's marked as 'Enhancement' because to me it seems a bug but this is not important :-) since it is marked as resolved.


                  I just updated the issue type to bug (I was not sure what are the consequences of the issue when I ran into it first).

                   

                  I'll try to get the fix and maybe port it to version 1.1.2 (i saw (checking diff between rev 599 and 598) the fix is in class ResetRequestSourceImpl

                  I woudln't recommend spending time on backporting to 1.1.2, I would recommend you download the 1.1.x version sources and just build the Java part yourself (which is trivial) and replace in your runtime. As you said (and if you look at the commits its only change in the Java part of mod_cluster).

                  From your side, when should it be ported on 1.1.2  ? And when a new version wih the fix is planned ? (if you arelady have a plan of course :- ) ).

                  Yes, it will be fixed in 1.1.3.

                  At the end, is there anything i can do to help you.

                  You can always contribute a test for it :-)


                  Let me know how that goes for you.

                  1 of 1 people found this helpful
                  • 6. Re: Tomcat and ROOT context issue
                    nichele

                    Hi Radoslav,

                    i applied the changes to the downloaded source code and i just verified that now the bug is gone.

                     

                    Many many thanks !

                     

                    I'll continue the test and i'll let you know if i'll find issues.

                     

                    ste

                    • 7. Re: Tomcat and ROOT context issue
                      nichele

                      ...i forgot....

                       

                      i'd like to make available the patched jar (maybe someone else is interested on it) but i did not find a place where to upload it.

                       

                      ste

                      • 8. Re: Tomcat and ROOT context issue
                        rhusar

                        i applied the changes to the downloaded source code and i just verified that now the bug is gone.

                         

                        Many many thanks !

                        Exciting, this is wonderful!

                        i'd like to make available the patched jar (maybe someone else is interested on it) but i did not find a place where to upload it.

                        Actually, I think you can go edit your original posting, add a section at the bottom (like "Update:" or something) and you might be able to attach a file, since its not possible to attach files to the replies/comments. You can also select one of the helpful replies as an answer to your question.

                         

                        Cheers,

                        Rado