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

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

    Comment


    • #3
      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

      Comment


      • #4
        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?

        Comment


        • #5
          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

          Comment


          • #6
            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

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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".

                    Comment


                    • #11
                      I think it was from someone asking, "Should I use JBoss, or should I use Spring?", and someone else responding, "Spring".
                      I think the original question asked about some specific features, and Ben was responding based on that. Spring is designed to work in any application server (or outside an application server); using Spring does not mean ignoring what the server may have to offer. It just provides greater choice in a lot of cases.

                      It comes down to distinguishing between EJB and J2EE--which I, at least, have always been careful to do.

                      Comment


                      • #12
                        It comes down to distinguishing between EJB and J2EE--which I, at least, have always been careful to do.
                        I guess you wrote a whole book about it, arn't you?

                        Comment


                        • #13
                          Rod Johnson: It comes down to distinguishing between EJB and J2EE--which I, at least, have always been careful to do.
                          Is this the same Rod Johnson of "J2EE without EJB" :?: From what I've read it's a great book. But I'm a little lost right now, I need a better into to J2EE before I can grasp it all.

                          Do you know of any web references that give you a overview of J2EE and maybe some examlpes?

                          Josh

                          Comment


                          • #14
                            Yes it is. Spring came about from the framework discussed in the book. If you have never read it I definitely recommend that you do. You should probably read both Expert One-on-One J2EE books by Rod in the order in which they were printed.

                            Rob

                            Comment


                            • #15
                              Details on how to integrate Spring with JBoss.

                              Hi All,
                              I am new to spring.
                              I would like to know more about how can I integrate Spring with JBoss?

                              thanks
                              Ani

                              Comment

                              Working...
                              X