4 Replies Latest reply on Dec 20, 2012 10:44 AM by komododave

    What's the "proper" way of modifying etc/jetty.xml?

    komododave

      We'd like to customise jetty.xml to specify a default value for the jetty host IP so we can bind to a specific VIP.

       

      We want to change from

       

       

       

      (Actually we want to dynamically specify this so I'm about to see whether jetty.xml can evaluate Java system property references similar to TC's server.xml or GF's domain.xml).

       

      Questions:

       

       

      1. What is the "proper" method of us replacing the file with our customised version? Ideally we'd like to perform this change at the fabric configuration level rather than creating a custom fabric tarball.

       

      2. I'm unsure generally about what configuration is possible for a feature. Which API/specification determines the 'config properties' that you can see in FMC? I've read a lot in the fabric docs about how to change existing config properties, but nothing regarding what defines their creation. For example, what causes the broker.xml to be presented as a 'config properties' file for the mq-console profile?

       

      Many thanks for your time.

        • 1. Re: What's the "proper" way of modifying etc/jetty.xml?
          stlewis

          So basically config PIDs can be overridden via FMC, i.e. the values you see when you do a "config:list".

           

          One minor difference is that in FMC you use .properties as the suffix for files under etc/ that end with .cfg.

           

          In the case of jetty.xml I have a feeling that jetty is just reading that file directly rather than getting it's contents via the OSGi ConfigAdmin service, so you'd have to customize the actual file rather than configure it via fabric.

           

          That being said, if you want to try using Pax Web (which uses Jetty under the covers) it has a configuration setting to specify a bind address list, documented here, called "org.ops4j.pax.web.listening.addresses".  So in that case you'd go into FMC, go to the "Configuration" tab of your profile, create a new configuration called "org.ops4j.pax.web.properties", then open it and add:

           

          org.ops4j.pax.web.listening.addresses=localhost

           

          or whatever you need.

          • 2. Re: What's the "proper" way of modifying etc/jetty.xml?
            komododave

            Great info as usual, thank you Stan.

             

            Let's say we export the modified 'fmc' profile now from a created fabric.

             

            Then we import it at fabric creation and specify --profile fmc.

             

            Will it load the modified 'fmc' profile, or the unmodified one? i.e. what's the execution order on those fabric:create parameters?

             

            Is it determined by the order in which they're listed?

            • 3. Re: What's the "proper" way of modifying etc/jetty.xml?
              stlewis

              Yeah, FMC needs Pax Web to run at all, i.e. the profile should specify the "war" feature which gives you Pax Web and the "web:list" command.

              • 4. Re: What's the "proper" way of modifying etc/jetty.xml?
                komododave

                More useful info there, thanks Stan.

                 

                I actually modified my question earlier because the answer was clear from what you'd said when I read it a second time.

                 

                If you get chance I'd be grateful for a response to the new question.

                 

                Thank you very much for your time.