Spring vs JBoss, and why I don’t care about Sun standards

After a long time, it was interesting to see the Spring and JBoss folks engage in a public war of words, in comments on Matt Raible’s blog.

Beyond the obvious entertainment value that one gets as an outside observer to these kinds of things, it is interesting to analyze what the JBoss folks are up to and what they appear to be doing to counter Spring. And please, if you hear anyone from JBoss say that they are OK with Spring – they don’t see it as competition etc., if you believe that, don’t read this blog entry…!

Rod Johnson appears to have uncharacteristically lost his cool when faced with this comment from someone in the JBoss camp:

All those features in or out the app server are the real value of projects like JBoss Embeddable EJB3: the same code run both in and out of app server (or in another one).

Rod’s response:

Wow. What a great idea! Imagine if someone had thought of that back in 2002. Imagine if there was a project used very very widely that gave you the same model inside and outside the app server across a wide range of functionality. There’s a whole world outside JBoss technology :-)

Rod is understandably laying on the sarcasm, not only has JBoss flipped and embraced the POJO, they are trying to make it look like they came up with the whole idea. In the next JBoss versions, they are replacing the JMX based microkernel with a POJO based one. So one thing is clear: both the Spring and JBoss camps agree on something.

I can’t believe that Gavin pushes the talking point that AOP is no big deal.

However, the fact is that full AOP has basically zero traction in the developer community and that to shovel it into the EJB spec would be a terrible idea at this point. Moreover, almost all of the interesting problems you might think you need AOP for can be solved by interceptors + annotations – an approach that is much more understandable to nongeniuses. To me, AOP looks like totally overhyped, failed technology right now. (Of course, future history could prove me wrong on this.)

Or maybe its a defensive reaction to one of the main criticisms of the EJB3 spec.

I have been meaning to rant about a few things for a while, and maybe now is a good time, especially after all that Java One excitement has died down. Boy, am I glad that I don’t work for Sun, JBoss, IBM, BEA or even Interface21 for that matter – I don’t need to sprinkle my posts with sugary hints on how great technology A is, or that B is the best thing since sliced bread – unless I wholeheartedly agree. Here’s a few things I want to say on the oh-so-frustatingly wide world of Java EE:

Sun Specification != Standard – just because some technology carries a Sun “rubber stamp” and is touted as a specification does not mean that a) it is good or b) that it will last or c) that it is superior to other technologies. Classic examples: Entity Beans. The whole EJB 1.X and 2.X specifications.

Everyone agrees that to a large extent: EJB3 = Spring + Hibernate. What does this mean? To put it bluntly – Sun got it wrong and had to revise the specification. Innovation happened outside of Sun. A fresh perspective did not come from IBM, BEA or Oracle. It was the open source community that made things happen. Rod Johnson did a huge service to the entire Java community with that first book of his, and I was lucky enough to have read it at that time.

Now, we are in the middle of a new wave of JSRs, and specifications like EJB3, JPA, the JBoss camp pushing Seam as a new specification, the NetBeans camp raving about Java EE development, MVC frameworks being released right and left and something called Google Web Toolkit. I sometimes feel that it is too much work to be a Java developer nowadays. There is no option but to pick one out of the gazillion frameworks out there, hope that your pick will stand the test of time and focus on it. (And also bash the other “rival” frameworks on public forums for good measure :)

Java developers should keep an open mind and not trust anything that emerges as the result of a “design by committee”. A large part of what goes into a specification, will be the political agendas of the committee members. Ask yourself whether they will really give top priority to the needs of developers, or really try to keep things simple. This is why I like open source, the chances that something proprietary is created is far less and things are far more democratic. Unfortunately the open source landscape is getting increasingly commercialized nowadays…

I’m a blatant Spring fan, but one part of the thread I am referring to grabbed my attention: the part about conversations / optimistic transactions and the dreaded Hibernate LazyInitializationException. I use Spring and Hibernate and with Spring MVC the OpenInSessionViewFilter works fine. However I immediately ran into problems when using Spring Web Flow with Hibernate – and it looks to be something that still needs to be resolved, as of now.

PS: I hope GWT kills JSF and most of the other MVC frameworks. There are too many out there! But seriously I think GWT is something really really big. More on that later.

PS PS: I hate JNDI and I hate annotations. The Spring XML way is better.

Update 2007-03-07: Wicket Impressions: a post comparing Wicket with Spring MVC / WebFlow and some other frameworks as well.

About Peter Thomas

35 Responses to Spring vs JBoss, and why I don’t care about Sun standards

  1. Agree on a lot of the post. There are some of us who are looking to join / create JSRs from a user’s point of view to try to make them based on what people are really doing now. I think it’s time for people like yourself (and me) to become involved in the JCP and make it better.

    Oh, and GWT may have an effect on JSF, but it won’t kill action-oriented MVC frameworks, since GWT doesn’t provide a strong controller framework, just UI widgets.

  2. Peter Thomas says:

    GWT may have an effect on JSF, but it won’t kill action-oriented MVC frameworks, since GWT doesn’t provide a strong controller framework, just UI widgets.

    What I’m able to figure from my initial look at GWT is that like Swing, you don’t care about the session or managing navigation-state and just work with widgets and write event handlers. A lot of Swing applications are implemented without a formal controller layer. Which may not be ideal in terms of design but it happens. I actually wonder whether introducing something like Spring Rich Client will be worth it when you use Swing. Anyway, in GWT unlike the typical web MVC framework, you don’t worry about page navigation anymore – you just update areas on the GUI – AJAX style. The important thing is having in place a service facade that can cater to all your UI rendering use cases.

    Especially given the way most MVC frameworks tightly couple the V and the C – I’m not sure about GWT not having an effect on MVC frameworks. In fact I’m almost positive that if I use GWT, I have to drop Spring WebFlow. I hope to have more clarity on this soon.

  3. Matt Raible says:

    To be fair to JBoss, I sat in a Denver JUG meeting with Mark Fleury way back in 2002 where he said the next generation of JBoss would be completely POJO and AOP-based.

  4. Peter Thomas says:

    To be fair to JBoss, I sat in a Denver JUG meeting with Mark Fleury way back in 2002 where he said the next generation of JBoss would be completely POJO and AOP-based.

    Thanks Matt – and I remember reading the “Blue Paper” and getting all excited in those days. I don’t think that in practice JBoss had a POJO flavor until now anyway. And Gavin is trashing AOP now.

    BTW – the link to the “Blue Paper” doesn’t work anymore. Anyone know where to find it? I want to read it for old times sake…

  5. Keith Donald says:

    Hi Peter,

    To address your Spring Web Flow comments:

    – Yes, we currently do not officially support extended Hibernate sessions (session per flow). I expect us to first support JPA’s extended persistence context in the Spring Web Flow 1.1 timeframe, as it provides a standard, workable model there.

    – Spring Web Flow is very much decoupled from the View (V). As a dedicated controller framework you’ll find an abstraction for logical “View Selections” that is extensible. And I see great opportunity to combine SWF with richer UI technologies, including JSF components and GWT. JSF integration will be in Spring Web Flow will be full-featured in 1.0 final.

    Definitely ping me on the forums if you get an opportunity to have a look at using GWT within a SWF environment.



  6. Peter Thomas says:


    I completely agree that SWF does a great job in completely decoupling the V and the C, apologies if I made it sound otherwise. I am using 1.0-RC1 in a real-life app and am thrilled with the difference it makes – especially with how you can re-use sub-flows within the view tier – JSPs in my case.

    What I meant in comment #2 is that in a GWT context – I may choose to stick with Spring MVC for the C, but am less likely to use SWF where long-running page-flows are its sweet-spot. Of course these are very early days, and I will certainly ping you on the forums.

  7. Werner Keil says:

    I came across your posts from a bit earlier this year.
    Since I am putting together a couple of building parts for a multinational JBoss-based business web app, of course in need of persistence (where Hibernate is a first choice) and also a MVC framwork that matches both modern web app (portal) demand, as works well within the server environment.

    Regarding Jason’s reply, I fully agree on that. I myself am getting involved in both Open Source communities (like Apache or Eclipse, as well as JBoss and of course Source Forge) and also try to get some of the practical influence and experience into some JSRs.

  8. Pingback: GWT now 100% open source, yet another framework to consider « Incremental Operations

  9. George Georgovassilis says:

    I agree and hope with Peter that GWT (if not itself, but an idea inspired by it) will provide some good and final arguments on MVC implementations. Spring does very much for the model & control, it decouples them in an excellent way and joins them cleanly. On the other hand, GWT is an expressed advocate of client-side abstraction and they don’t deal much with the server side – an excellent opportunity for joining both frameworks together.

    As a sub-project of the GWT Widget Library [1] we created a transparent mapping between GWT applications running on the client and Spring managed server side beans. This allows GWT client applications to invoke bean methods very similar to how RMI works.

    [1] http://gwt-widget.sourceforge.net/

  10. Pingback: Hibernate, Spring and ASM « A Public Scratchpad

  11. sebnem says:

    Why should GWT kill anyone MVC framework? It is not even a strong powerful framework – it just helps Java developers who cannot wrap their brains around JS, to actually be able to establish a UI…Which is actually euthanasia for those guys, since if you don’t know JS, it will be deadly for you to track the JS bugs GWT has generated from your Java thinking…

  12. Hi,

    I agree with most of the comments. However I don’t agree that Spring XML approach is better than annotations.


  13. Peter Thomas says:

    You are entitled to your opinion Nagendra. But Spring also supports annotations and even configuration in pure Java or Groovy, JRuby and Beanshell etc.

  14. Ketan Padia says:

    If annotations can be used in Spring, which I find much better than monstrous XML, what’s the point comparing and criticizing both frameworks :D

    Cheers !

  15. Peter Thomas says:


    Huh? No point, no point at all. Just me ranting. Move on.

  16. AjaxSucks says:

    Screw GWT, it’s outdated technology already. Try Adobe Flex (+Java). Ever since I started using Flex Builder I’ve decided that Flex is the future of RIA and the best option available for most anything with more than a trivial level of functionality. Ajax should be abandoned only for use on mostly static webpages that want to display minor updates periodically without a page reload – that’s it.

    And no, I’m not an Adobe “committee member” with an agenda. :) I haven’t had this much fun doing software development since my days of C++ programming little graphics apps ten years ago!

    Yep…screw Ajax for RIA! It’s a cute hack appropriate for reloading the scoreboard of an ESPN webpage. Does anyone in their right mind enjoy looking at (and debugging) JavaScript crap? Especially when you could be using Flex debugging tools on the same level as Eclipse/Java – no freakin way! I’m tired of even gmail screwing up (somebody has to admit that it has issues sometimes!), tired of crappy “Ajax enabled” sites completely blowing up or “appearing” to work when they actually aren’t doing crap.

    All hype!

    I’ll NEVER go back to Ahax again!! Hahaha… what painful misery it seems like now, looking back with the tools Flex/Air and Java gives you! As for the skeptics or the people who already spent all their time learning Ahax, and as a consequence don’t want to switch to something else… oh well!

    No loss to me, I’ll just be here producing killer apps in no time with Flex, and having a pleasant time doing it, while all the Ahackers toil away…endlessly chasing after that “perfect Ajax framework” that works with all versions of all browsers available on the internet! Including those which haven’t been created yet…lol…

  17. Peter Thomas says:

    And no, I’m not an Adobe “committee member” with an agenda. :) I haven’t had this much fun doing software development since my days of C++ programming little graphics apps ten years ago!

    It would have been nice if you gave your real name and a link to a blog post of yours sharing your experiences with Flex.

    Now you certainly *do* sound like an Adobe spam bot.

    I must say that I’m very interested in Flex, not yet got a chance to try it out.

  18. AjaxSucks says:

    Sorry Peter – I don’t have a blog. :(

  19. AjaxSucks says:


    Try that link… this guy knows his stuff.

    “If you are still thinking of using AJAX of JSF for your data intensive business application, just stop it, will you! Do not spend half of your project’s time trying invent your version of a data grid with embedded tree or a fancy dropdown, fighting with the browser incompatibilities and slow communication protocols. You can’t afford to be in the Google state of mind. Your human resources and the budget are limited, and your enterprise is not a software development company. Just take care of your business with Flex 3, AIR, and BlazeDS.”

  20. Peter Thomas says:

    Whatever. You still don’t want to provide your real name eh.

    Can’t help pointing out this bit of news that Adobe plans to introduce DRM into Flash. *shudder*


  21. AjaxSucks says:

    What use would my name be? It won’t be anywhere. Jus sayin… I’ll never go back to Ajax, or GWT, although I agree with your original points.

    As for the DRM thing, I’m going to wait a little more and see what happens. It sounds bad (can’t be good anyway), but I believe it’s use is “optional” (for content providers), so I’m not sure what kind of effect it will really have yet. It shouldn’t effect the use of Flex within an “enterprise” environment or most other uses as far as I can tell, although it’ll probably hurt Flash video.

    Of course I’m not a DRM expert, I only know that generally speaking it sucks.

  22. me, myself and I says:

    > Yep…screw Ajax for RIA!

    Seems you never used something like Wicket.

  23. me, myself and I says:

    Flash sucks. It’s closed technology. Altough supported on many platforms, it is not as pervasive as JS and HTML. I’s a pain in the ass to do flash without commercial tools. It’s not parseable. Bluntly put, it sucks.

  24. Peter Thomas says:

    I found a good blog post on the shortcomings of Flex here:


  25. Jeremy Chone says:

    “A large part of what goes into a specification, will be the political agendas of the committee members.”

    This is very true.

  26. Ketan Padia says:

    Yea keep on ranting…BTW Spring sucks.

  27. Peter Thomas says:


    From your comment at #15 it looks like you think Spring sucks because of the XML. You do know that Spring supports annotations instead of XML right?

    Also the Spring Java config option is worth mentioning.

    Some people like me are not in favor of using annotations for everything. You can have a look at this comment.

  28. Ketan Padia says:

    Peter, you were really not nice responding to my earlier comment. Yes I know it supports annotations, JSF, Hibernate etc etc …but none of these or any JEE frameworks around are perfect, like one size fits all thing and that’s why I mentioned in my earlier comment that there’s no point comparing these two Frameworks. Anyway, I am moving on :-)


  29. Peter Thomas says:

    @Ketan Padia

    Hmm. Let’s look at your earlier comment again:

    If annotations can be used in Spring, which I find much better than monstrous XML, what’s the point comparing and criticizing both frameworks :D

    I really couldn’t understand *your* point when I read this a few months ago but let me try again now.

    Suppose I want to write a blog post comparing two frameworks A and B. Both A and B support annotations. So going by your logic, I should not bother writing a blog post at all?

  30. ncaralicea says:

    i can not but agree with the huge role Spring framework has been playing for a good while now. I was one of the ones that chose EJB 2.1 and it had been a wrong choice (clearly proven). I had seen the “Spring” guys flying by me with all the cool stuff (DI, Hibernate, AOP etc). If there are guys that pretend the wheel is about to get the sunlight, then it is only to their own detriment. I would not worry about that. Most of us know who gave what and when.

  31. Shahzeb says:

    I agree with you totally as far as ideaogly of this post is concerned .

    Differ on two points

    1- Spring annotations are much better than XML config .
    2- Flex is much better than GWT .

    Want to add one more point :)

    for presentation layer Struts 2 are better than any thing I have every used I have used servelets , jsp , jsf , spring MVC , Struts and struts 2

  32. Peter Thomas says:

    @Shahzeb: I disagree with your third point ;) – have you used Wicket?

  33. sandrar says:

    Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  34. Shahzeb says:

    Came across this couple of years later while searching for something else :)

    Where does this battle between Spring and Jboss leaves Hibernate . Bit of Apple vs Google things happening here . Spring has always supported hibernate but recently seems to be favouring JPA .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: