11 Replies Latest reply on Oct 11, 2002 10:25 AM by Quande Ren

    Context path in tomcat4-services.xml?

    humps Newbie

      I think I read it somewhere that the server.xml is not being parsed by the tomcat bundled with JBoss. I have struggled to find similar questions in this forum or manuals... so b4 I crack on the source code, I wanted to see if any guru knows how can I have something like in the JBoss/Tomcat4 bundle? It seems to ignore it in the tomcat4-services.xml, that's why I'm completely lost!

      thanks

        • 1. Re: Context path in tomcat4-services.xml?
          lea allison Newbie

          Somebody please answer this guy as I have the same problem with tomcat4-service.xml and docBase!


          Thanks

          • 2. Re: Context path in tomcat4-services.xml?
            humps Newbie

            I'm going to try to answer my own question since no one offered any answer :)

            I digged into the source code and found org.jboss.web.catalina.ConfigHandler.applyHostConfig().
            This is the method which EmbeddedCatalinaServiceSX seems to use and ConfigHandler seems to pick up stuff from tomcat4-services.xml. As I said seems, it really means I traced by hand and didn't write anything to test.

            I think if someone add the bit in ConfigHandler to take <Context path="" docBase="...> from the DOM and passes it on like the rest in Server/Service/Engine, it should be fine, fingers crossed! Of course the desired solution would be to map correctly to the DTD :)

            I'm going to try it myself and hopefully report the result here later. If it works, then I'll need advice on if I should raise a bug with JBoss or it'll be ok to just tell someone from JBoss.

            • 3. Re: Context path in tomcat4-services.xml?
              Thomas Peuss Newbie

              Hello!

              > I wanted to see if any guru knows how can I have
              > something like <Context path=""
              &gt; docBase="D:/staticFiles/" crossContext="false"
              &gt; reloadable="true"> in the JBoss/Tomcat4 bundle? It
              > seems to ignore it in the tomcat4-services.xml,
              > that's why I'm completely lost!

              This is by design. You need a war-file in your deploy-directory. A hello.war will be deployed as context /hello. You can have unpacked wars, too - these a normal directories. There you must have the WEB-INF directory et. al.

              CU
              Thomas

              • 4. Re: Context path in tomcat4-services.xml?
                Quande Ren Newbie

                I saw lot of posts say that they need to have the context root like this:


                By this way, we can have our code be outside the jboss code. I don't know if currently jboss can do it or not. If not, I hope this will be available in Jboss3.1

                • 5. Re: Context path in tomcat4-services.xml?
                  Thomas Peuss Newbie

                  Hello!

                  The solution is simple on Unix. Just create a link in the deploy-directory. On Windows you are lost. The only way to deploy a webapp in JBoss is to have a .war-file/directory in the deploy-directory.

                  CU
                  Thomas

                  • 6. Re: Context path in tomcat4-services.xml?
                    humps Newbie

                    This is a very nasty hack in my opinion :) But I did think of that.

                    I guess the whole point of having files served outside your war is for things like images, JavaScripts, CSS or anything that *could* be changed in runtime. Certainly helps during development.

                    I looked at the code, the JMX MBean integration requires a lot of coding; The ConfigHandler pases the DOM in tomcat4-service.xml to an EmbeddedCatalina. Which means the ConfigHandler needs to perform the same function as Catalina main class (the class that you run if you were running tomcat4 standalone). Obviously, the current bundled tomcat is capable of all things except the integration code does not do everything that Catalina (main class) does.

                    I've got the Host/Context patched, but some how it can't load JspServlet (Jasper Servlet) class from the classloader.... I'm pretty sure the jar is included in the classpath specified in the tomcat4-service.xml.... I'm stuck!! It serves static files (which is all I need) when you define a Context path="/" , but I doubt it serves JSPs currently in the patch..... well I'm trying, working on it... if someone from JBoss can help me with the class loader thingy for each MBean deployment, then I can probably make tomcat work properly......

                    cherrs guys

                    humps

                    • 7. Re: Context path in tomcat4-services.xml?
                      John Katilie Newbie

                      I'm not sure it will help and or do what you want but you can also changes the jboss-service.xml to refer to multiple deployment directories. I do it to make my development life a little easier so i do not have to move war files after i build them.

                      I.e.:

                      <!-- URLs are comma seperated and unprefixed arguments are considered
                      file URLs and resolve relative to server home(JBOSS_DIST/server/default)
                      unless the given path is absolute. Any referenced directories cannot
                      be unpackaged archives, use the parent directory of the unpacked
                      archive.
                      -->

                      ./deploy,D:/XmlBridge/Fresno/Archives

                      • 8. Re: Context path in tomcat4-services.xml?
                        Quande Ren Newbie

                        Thank you Jkatilie.

                        I like your idea. I tried this way and it works. This is a very simple yet effective solution.

                        • 9. Re: Context path in tomcat4-services.xml?
                          Quande Ren Newbie

                          Thank you Jkatilie.

                          I like your idea. I tried this way and it works. This is a very simple yet effective solution.

                          • 10. Re: Context path in tomcat4-services.xml?
                            Quande Ren Newbie

                            Thank you Jkatilie.

                            I like your idea. I tried this way and it works. This is a very simple yet effective solution.

                            • 11. Re: Context path in tomcat4-services.xml?
                              Quande Ren Newbie

                              Thank you Jkatilie.

                              I like your idea. I tried this way and it works. This is a very simple yet effective solution.