Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: JBoss vs Spring

  1. #1
    Join Date
    Feb 2005
    Posts
    2

    Default JBoss vs Spring

    Our group is trying to decide whether to go with JBoss or Spring in our project. Among our requirements are:
    - transaction management
    - persistence
    - remoting
    - message/event handling
    - maintainability
    - possibly distributed architecture

    I was wondering if folks have made comparisons of both and can specify reasons for going with one instead of another.

    Thanks in advance,
    Marylou

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Spring can address all of the requirements you listed. It's more a case of whether you want to run with an EJB-based architecture or a POJO-based one. The consensus of most recent thinking is that EJB 2.x-based architectures are suboptimal in almost every situation. But don't take my word for it - I'd urge you to read some of the current books on the subject. Some people use EJB 2.x as it's a political requirement of the project, or they already have lots of EJB 2.x beans they need to integrate with.

    Personally I couldn't imagine ever using EJB 2.x on purely technical grounds. At an engineering level it is just so ugly and dated.

    In terms of Spring vs JBoss, they are not mutually exclusive. Spring will happily live within a JBoss-deployed WAR. However, most Spring people using JBoss do so only because of legacy EJBs or the need to use JBoss-specific services such as JBoss transaction or cache management.

  3. #3
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    To add to what Ben has said, I think your fifth point, maintainability, points more to Spring than is does to JBoss/EJB. I can personally vouch for the fact that Spring applications are much easier to maintain on an ongoing basis than traditional EJB applications, plus they are substantially easier to test.

    As Ben says, you can use Spring inside JBoss, but if all you using is the servlet container, then you might be better off with Tomcat standalone.

    If you are looking for messaging, can I recommend ActiveMQ. From my experience it is a very good JMS implementation, plus it has a nice JCA-based message driven POJO archiecture that drops into Spring.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  4. #4
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    Quote Originally Posted by Ben Alex
    In terms of Spring vs JBoss, they are not mutually exclusive. Spring will happily live within a JBoss-deployed WAR. However, most Spring people using JBoss do so only because of legacy EJBs or the need to use JBoss-specific services such as JBoss transaction or cache management.
    We use Spring with JBoss because JBoss supports all J2EE specifications and EJB is only a small part of it. So there is a lot more about JBoss than EJB..

    What alternative do you suggest for a full J2EE compliant application server?

  5. #5
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

    Default

    I love Spring, but the idea that Spring can be used as a generic application server replacement is patently absurd, and it is these types of overblown claims that caused me to shy away from Spring for a long time.

    Forcing yourself to choose either JBoss or Spring is doing yourself a disservice. Where the functions overlap, choose the one that you feel is best.

    I use JBoss and Spring, though I do not use session or entity beans.

    I use JBoss for:
    • JMX Container
      Deployment Lifecycle and Deployment Dependencies
      Transaction Manager
      .EAR deployment / Classloading Architecture
      Message-driven Beans

    I use Spring for:
    • Configuration of internal application services, including third-party packages like Hibernate and OSWorkflow
      Dependency Injection
      Transaction Demarcation
      Integration Testing Framework
      Custom AOP needs

  6. #6
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    I'm not suggesting that Spring is a replacement for a full J2EE server, but then again I don't always need a full J2EE server. At the end of the day, Spring is not a replacement for J2EE specs, but you don't need a full J2EE server to get JTA transactions or JMS messaging or any other part of J2EE. I prefer to pick the parts I need and then use what I feel to be the best tool for the job. Of course if I'm using a lot of J2EE stuff then a J2EE server is the way to go, but if I'm just using JMS and servlets, then I prefer Tomcat and ActiveMQ.

    Mainly, from J2EE the bit I need is JMS and I really like ActiveMQ for that.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

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

    Default

    I use Spring and JBoss. I Spring'ified 2 ASP'ed production J2EE apps in the last few months and it all seems to work pretty well together, i.e. customers are not screaming or anything.

    We use the following features of JBoss that may or may not be in some other web-only containers.
    - hot deploy of all component types
    - clustered data cache
    - JMX
    - MDBs/JMS

    I'm also using SLSBs and (gasp!) BMP Entity EJBs for data access, straight SQL for reports. The way that the Entity beans are generated, I am getting extremely good performance with a fast distributed cache and optimistic locking.

    The ability to drop modules in as SARs is very cool also. I was actually wondering if there was some way to deploy a Spring app as a bunch of JMX components. The reasons for doing this might be:

    - as a time saving during development so that the SAR contains stable modules, and you only have to reload the context for that part of the Spring app being worked on.

    - as a configuration mechanism, so that spring properties could be changed live at runtime via the JMX console.

    - as a reusability mechanism, so that you could build Spring modules, and just hot deploy them, and the system could detect (via JMX) that they were present.

    I guess there would need to be some funky JMX-aware proxy or something to allow an object in one JMX module to be injected as a property in another JMX module -- and then what happens if you redeployed one module.

  8. #8
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    By all means use JBoss if you need the extra services, just like I said in my original post. I have no idea where the "I love Spring, but the idea that Spring can be used as a generic application server replacement is patently absurd" response came from. I have never come across any Spring team member (or even experienced user) claiming Spring can be used as a replacement for an application server. Spring doesn't implement JTA or the Servlet Spec. We need containers for that. What Spring team members often say is that you generally no longer need a fully-fledged J2EE application server (ie one that delivers EJB). That is a perfectly responsible, considered and defendable position, as many current books explore in great detail.

  9. #9
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

    Default

    Quote Originally Posted by robh
    Mainly, from J2EE the bit I need is JMS and I really like ActiveMQ for that.
    Rob, are you using the Message-Driven POJO support in ActiveMQ? I have been anxious to try it out once ActiveMQ resolves some of its more serious bugs.

  10. #10
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

    Default

    Quote Originally Posted by Ben Alex
    I have no idea where the "I love Spring, but the idea that Spring can be used as a generic application server replacement is patently absurd" response came from.
    I think it was from someone asking, "Should I use JBoss, or should I use Spring?", and someone else responding, "Spring".

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 1
    Last Post: Oct 2nd, 2005, 07:10 PM
  3. Replies: 4
    Last Post: May 13th, 2005, 07:49 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 AM

Posting Permissions

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