Announcement Announcement Module
Collapse
No announcement yet.
Best Practice - Spring under JBoss Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best Practice - Spring under JBoss

    Looking for best practice for deploying Spring jar files under JBoss.

    We are running several web applications in a Tomcat instance running under JBoss. All of these WARs are part of a larger application JBoss is serving for us.

    Should we deploy the Spring jar files (and supporting jar files - not including our app specific jars:

    a) in the war files
    b) in the common lib area of Tomcat
    c) in the common lib area of Jboss

    Currently we have no plans to use EJB's, but we are using JBoss clustering, JBoss JMS, other features of the J2EE container.
    Looking for any pros and cons those with more experience can share...

  • #2
    It depends...

    If I would have multiple applications sharing the same version of Spring I would place it in some shared directory (tomcat/jboss). However if I have 1 application using it I would place it in the war file.

    Also placing jars in other locations can sometimes lead to unpredictable situations.

    Comment


    • #3
      We will have multiple WARs usng Spring. They will each have there own context.

      Comment


      • #4
        according to your description, I would place all spring-related jars into the jboss/yourserver/lib. That way you won't have to copy the same files into multiple locations.

        Comment


        • #5
          I'd first try selecting answer D) None of the above.

          Try putting jars in <ear>\lib and create <java> modules in your .ear application.xml

          I know you're not using EJB but you can still package multiple <web> modules inside an .ear file, just also then add a <java> module for each .jar you want to include.

          Comment


          • #6
            That would also be an option, however I concluded they only deployed different wars.

            Question from side regarding ears. If I have 30 web apps, sharing the same jars. Could we place those wars in a <ear>\lib. Would this reduce the memory footprint of all those applications? (Currently we have a memory issue on our production servers ). (Note: I didn't suggest the current type of deployment I'm only here to clean up the mess and make things better )

            Comment


            • #7
              Originally posted by mdeinum
              Question from side regarding ears. If I have 30 web apps, sharing the same jars. Could we place those wars in a <ear>\lib. Would this reduce the memory footprint of all those applications? (Currently we have a memory issue on our production servers ). (Note: I didn't suggest the current type of deployment I'm only here to clean up the mess and make things better )
              Of course you can... But I wouldn't do that with all beans. There are several jars which were likely unhappy being in such a situation.
              In the past Struts was unhappy about a shared location, also other webframeworks. So the most frameworks recommend to put them into WEB-INF/lib.

              But: Having them in a shared location would reduce the memory usage.

              Comment


              • #8
                Currently we have someone investigating which jars to put where, so which work well in a shared lib (or ear) and which not.

                I also recall that hibernate doesn't like it always to be in a shared environment. Well I think we need see what to put where. Luckily that is not my job .

                Comment

                Working...
                X