8 Replies Latest reply on Aug 31, 2010 9:04 AM by jaumzera

    Seam and shared jars in tomcat

    sherkan777

      Hi,
      I got 3 Seam 2 applications on tomcat 6.
      In all applications jar files are placed in WEB-INF/lib directory. Can I move all of them to Tomcat6/lib if I use for all applications seam jar versions? If yes, than which?

        • 1. Re: Seam and shared jars in tomcat
          israel.bgf

          I want to know this too. All the library for each war is somewhat a big waste of space. I tried to put them in the lib dir, and it works for one application, but with multiple seam applications, things start to blow-up.

          • 2. Re: Seam and shared jars in tomcat

            Putting it all in the shared lib dir will become a big problem as you start having more Seam based applications, and you start to have some with Seam 2.1, some with 2.2, some with 2.3, some with 3.0 and some with 3.1... (and that is without adding the possibility that some of them might need a different version of Hibernate, or of Richfaces, or of...)


            In an ideal world, you would have the time to always update them to the latest Seam/Hibernate/Richfaces/Whatever version... but this is not an idea world... this a real world...


            The solution(s)?



            1. Use a different Tomcat instance for each of your Seam applications (this solution has the extra advantage that you get ProcessIsolation) the disadvantage is that there is no easy way to balance memory use between Tomcat instances (or JBoss instances or...)

            2. Use Apache Geronimo, Geronimo  has a versioned .jar repository that makes it possible to share the .jars of different Seam versions between those app that need them (and at the same time have the right version of Seam for each app).Sadly AFAIK JBoss AS does not have this feature... Am I wrong?


            • 3. Re: Seam and shared jars in tomcat
              israel.bgf

              Well, my real world is even worse. I'm renting a host, and it dont gives me full control of tomcat (/lib dir for example), as far i know its using the virtual hosts feature of tomcat. So i really cant have multiple tomcat installations. And well, i dont matter of handling Seam versions, just keep a stable one like the 2.2, and after some time i would try a update.


              • 4. Re: Seam and shared jars in tomcat
                v.lukoyanov

                I'm using configuration with tomcat (one vhost per app) and shared seam jars in production env. Everything seem to work just fine, but my applications are rather simple.


                The only bug i noticed recently is a bug with seam mail. More deatails here.

                • 5. Re: Seam and shared jars in tomcat
                  israel.bgf

                  And how exactly did you do that configuration Vasilii? I'm very noob about tomcat configuration. :)


                  I will give some tries with a local tomcat.

                  • 6. Re: Seam and shared jars in tomcat
                    v.lukoyanov
                    The setup is quite simple.

                    1. make dir /tomcat/lib/seam
                    2. put required seam jars to /tomcat/lib/seam
                    3. in /tomcat/conf/catalina.properties set shared.loader=${catalina.home}/lib/seam/*.jar
                    4. if necessary configure vhosts in /tomcat/conf/server.xml

                    now you can deploy your apps without Seam jars in WEB-INF/lib
                    • 7. Re: Seam and shared jars in tomcat
                      israel.bgf

                      Hmm, thks, I will give a try.

                      • 8. Re: Seam and shared jars in tomcat
                        jaumzera

                        Hey guys... sorry to reopen this question, but I think it's pertinent.
                        I've setup my Tomcat with that configuration, but after some time the Seam apps stop creating new sessions and the users are not able to log in anymore. Does anyone have some idea?