Results 1 to 8 of 8

Thread: Best Practice - Spring under JBoss

  1. #1
    Join Date
    Nov 2005
    Location
    Charlotte,NC
    Posts
    57

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2005
    Location
    Charlotte,NC
    Posts
    57

    Default

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

  4. #4
    Join Date
    Dec 2005
    Posts
    269

    Default

    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.

  5. #5
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    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.

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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 )
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    Jul 2006
    Posts
    11

    Default

    Quote 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.

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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 .
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •