8 Replies Latest reply on Dec 19, 2012 10:09 AM by komododave

    Is there, or will there be, a Tomcat feature/FAB?

    komododave

      We're interested in developing a Tomcat feature/FAB to run Tomcat in an OSGi container rather than by using Process Manager which, albeit useful, seems like a glorified system pid aliaser (forgive me!).

       

      We spoke to James Strachan a few weeks ago and he hinted this might arrive in an upcoming release.

       

      I've had a look at your release schedule and can't see a related issue. Is this on the horizon? Alternatively, would it be a sufficiently simple job that it's worth us attempting it on our own?

        • 1. Re: Is there, or will there be, a Tomcat feature/FAB?
          jstrachan

          Long term we definitely want Fuse Fabric to support deploying new Tomcat instances, starting & stopping them - then managing (with Fuse Fabric's fine grained management and rolling upgrades & rollback etc) what goes into each Tomcat instance; deploying/upgrading WARs or managing the shared JNDI tree etc.

           

          The Process Manager stuff can install and provision Tomcat servers (and Jetty & JBoss); though as you say, it just starts it / stops it. The missing bit is the Tomcat Agent which runs inside the Tomcat process (rather like TomEE does) which then acts like the Fuse Fabric agent does inside an OSGi container.

           

          So something like fabric-agent needs creating for Tomcat really which

           

             

          • adds/updates/removes WARs based on changes to profiles

             

          • manages the Tomcat JNDI tree (in a similar way to fabric-agent mirrors the OSGi config admin properties from ZooKeeper/Profiles into the OSGi registry)

           

          Feel free to take a stab at this yourself if you like; contributions are more than welcome in the fuse project on github here is where the source lives and how to contribute or just go straight to github.

           

          Incidentally the JNDI tree part should be generic and be reusable outside of OSGi in vanilla Java processes, or with JBoss or Jetty too. The Tomcat specific agent piece is more the tomcat deployer of WARs. I guess over time we could refactor most of the tomcat agent to work with Jetty & JBoss too

          • 2. Re: Is there, or will there be, a Tomcat feature/FAB?
            komododave

            Thank you for getting back to us James.

             

            It looks like we've been thinking about it the wrong way. We've wondered how to run Tomcat from a Fabric container, but I understand you wanting to consider it as another kind of container to be provisioned by the fabric agent instead.

             

            We now need to establish whether it's possible for us to deploy our Java EE WARs to Fabric containers. I understand that Fuse ESB containers have some Java EE support, but haven't yet found anything indicating JSPs are supported which is unfortunate for us.

             

            We could at least utilise the process manager if I could access the bundle, but having posted another question regarding this Stan Lewis has just responded suggesting you guys may not have released/productized the bundle. This surprises me considering there's a whole page explaining its use in the fabric documentation hub.

             

            I'll continue reading about what Java EE tech is supported, beginning with (and maybe concluding with) this page.

             

            Thank you for your time.

            • 3. Re: Is there, or will there be, a Tomcat feature/FAB?
              stlewis

              Just a quick note that Pax Web does support JSPs, details are here

              • 4. Re: Is there, or will there be, a Tomcat feature/FAB?
                komododave

                Thank you for this info Stan, much appreciated.

                 

                This has led me here which looks like exactly what I needed.

                 

                Apologies for not reading the manuals page by page.. I do attempt to search thoroughly though!

                • 5. Re: Is there, or will there be, a Tomcat feature/FAB?
                  stlewis

                  No worries!

                  • 6. Re: Is there, or will there be, a Tomcat feature/FAB?
                    komododave

                    We've come back to discussing this recently. We really need support for Tomcat and Glassfish and are considering our options.

                     

                    We understand that Process Manager can be used, however this offers no versioning support and the rollback capability that enables.

                     

                    We're pondering three options currently; comments on these would be appreciated. Specifically we're eager to find any resources which might help in creating any of these solutions (presumably no docs other than source code?), and insight into how time consuming each option might be.

                     

                    1. (Crudest) Use a Maven archetype to convert existing webapp projects into a bundle containing the servlet container (TC/GF) and within that the WAR. We can then version these features and deploy as normal to a Fabric container. The downside of course is that the servlet container is being redeployed each time. Would the servlet container run ok inside a Fabric container like this, as long as we configured a port for servlet access which was before the start of the port range specified with fabric:create?

                     

                    2. (Better) Work out a mechanism to decouple the servlet container from the WAR in (1) such that the servlet container can be deployed as one feature, versioned in isolation, while the WAR can be versioned separately.

                     

                    3. (Best) As J Strachan has suggested above, create a Tomcat fabric container type. Add whatever code + configuration is required to enable provisioning of this by the fabric agent.

                     

                    Clearly (3) would be ideal but is likely to involve the most work.

                     

                    Please contribute whatever info you can which might advise us which of these approaches is best suited to fabric, what steps we might follow to achieve it and any resources which may be of use.

                     

                    We'll be happy to contribute what we develop if it seems reusable by Joe Public.

                    • 7. Re: Is there, or will there be, a Tomcat feature/FAB?
                      stlewis

                      Don't know how much I can add, but maybe a few pointers...

                       

                      For option #1 it should be possible, at least the Jolokia project have a build of their OSGi agent that embeds Jetty, so runs standalone without requiring you to install a servlet container, so might be worth having a look to see what they did.

                       

                      Option #2 should be do-able as well, you're basically going to be writing your own version of pax-web but trying to use Tomcat/Glassfish in place of Jetty.  I guess if Glassfish have an implementation of the OSGi HTTP service it's worth seeing if it deploys in Karaf as-is, you might get lucky!

                       

                      Option #3 I think would be a bit of work, at least in Fabric as it's fairly tied at the moment to Karaf and more to the point pushing out it's own assembly to hosts and spinning them up.  Plus you've got to ensure that the fabric bundles deploy and work alright in Glassfish, along with part of Karaf due to dependencies.

                       

                      Hope that helps somewhat.

                      • 8. Re: Is there, or will there be, a Tomcat feature/FAB?
                        komododave

                        Thank you for contributing this information Stan; anything related you guys can provide is useful. I'll take a look at Jolokia and search for a Glassfish OSGi HTTP service now.

                         

                        Hopefully Mr Strachan himself will wander in here at some point and offer his $0.02..