views:

647

answers:

7

Hi all.

I'm currently starting a new app development. The app architect insists we use JBoss5 because its "better". Do anyone has a wider definition of "better" (if its the case)?

I have experience using Tomcat5 and 6 in large scale applications with big user loads and it handles pretty well (IMHO). Both would be running over a RedHat6 in identical hardware conditions (in case the implementation matters).

Thanks in advance

+21  A: 

I'm currently starting a new app development. The app architect insists we use JBoss5 because it's "better". Do anyone has a wider definition of "better" (if its the case)?

Funny, because JBOSS uses Tomcat as its servlet/JSP engine.

Sounds like "better" means "supports EJBs and JMS", because Tomcat out of the box has neither.

But that's not an issue if your application doesn't use EJBs or JMS.

And if you do need them, you can add them to Tomcat with OpenEJB and RabbitMQ or ActiveMQ.

I'd ask your app arch when the last time they wrote something besides Power Point slides or UML documents. The response might surprise you.

duffymo
+1 for *when the last time they wrote something besides Power Point slides* - so so true it's almost as if you are working in my organization :)
JoseK
Sadly, it's true of too many organizations.
duffymo
@duffymo: Dude, I think you nailed it with the PPT comment, you really made my day =). We are not adding EJB or JMS by the way.
Chepech
So why not accept the answer? It's a good thing for both of us.
duffymo
@duffymo: Sorry man, I have a thing for long, detailed answers, besides Javid Jamae worte a book... you can't compete with that =)
Chepech
Sometimes succinct is better. Depends on the book.
duffymo
+4  A: 

As @duffymo points out, JBoss uses Tomcat for its web container so better makes not much sense if we compare equivalent things (i.e. Tomcat and the web container part of JBoss). And if you are not going to use JTA, EJBs, JMS, JMX, etc, there is no real advantage at using JBoss, especially during development (Tomcat is lighter and starts faster, this is often appreciated by development teams).

There are some cases where you could prefer JBoss for production though (I'm still assuming you're not using EJBs, etc):

  • The production team is trained or used to use JBoss in production, tools (deployment, monitoring, etc) are tailored for JBoss.
  • The company has a support contract for JBoss (although you can also get support for Tomcat).

But I'm not sure this is what the app architect meant. I would try to discuss this choice with the architect, maybe he has a rationale explanation. And if really JBoss has to be used in production, you can always use Tomcat or Jetty during development.

Pascal Thivent
+10  A: 

JBoss is an Application Server while Tomcat is a Servlet container

So JBoss may be better than Tomcat in the sense it contains it, plus other components. That's it.

If you're not going to use those other components, you're wasting resources. If you need those other components then Tomcat is not enough.

It depends, probably your Architect has something else in mind.

I wonder what would he say if you ask him directly?

OscarRyz
+2  A: 

It's not better, it's just more. JBoss includes Tomcat.

Thilo
+2  A: 

If you use JBoss, you can pay Jboss.org for support. But it is not the case with Tomcat.

Dennis Cheung
You can get support from SpringSource for their [tc Server](http://www.springsource.com/products/tcserver#tabs-4)
Pascal Thivent
+1  A: 

JBoss is J2EE specification compliant, it supports J2EE specification very well, such as EJB, JTA,JMS, JNDI and etc. Tomcat is only a servlet container, although it also supports a bit J2ee specification. When you want to use J2EE component, you should consider JBoss first.

Forgot a point, JBoss supports JMX very well, especially in version 4.*. I have experienced a project, it doesn't have a web UI, JBoss is used just as a platform and EJB container to integrate all the standalone application on it use MBean.

Simon
Servlets and JSPs are both part of the Java EE spec. Tomcat might be a mere servlet container, but it's still a valid subset of the Java EE spec. It's the reference implementation for all servlet/JSP engines. And J2EE is 1998 vintage terminology. They dropped the "2" a long time ago.
duffymo
Yes, you are right, but I'm still used to calling it J2ee, because I'm an old man :-)
Simon
@duffymo Tomcat is not the RI anymore since Java EE 5, GlassFish is the RI for JSP/Servlet.
Pascal Thivent
@Pascal - D'oh! Thanks for the correction.
duffymo
@Simon - You're a young buck to me, my friend. I have t-shirts older than you.
duffymo
+16  A: 

To say that any tool or framework is just 'better' is ridiculous. It always depends on the situation, architecture, etc. You don't necessarily want to use a hammer to drive a screw.

I wrote JBoss in Action, so I obviously like the JBoss technology, but I'll be the first to say that JBoss can be overkill in many situations. For example, for the last two sites I've developed, it made more sense to build with Grails and deploy on a standalone Tomcat instance.

Its a bit unfair to say that all you get when using JBoss is EJB and JMS. JBoss offers many services and features, including:

  • Servlet/JSP container
  • JNDI
  • EJB
  • JTA
  • clustering
  • caching
  • JMS
  • Datasource / Resource management
  • JMX integration
  • OSGi support
  • web services
  • portals
  • Web Beans (Seam)
  • Some administrative consoles
  • an IoC container
  • etc.

The thing that attracts many architects to JBoss is its flexibility. It uses a plugin architecture that allows you to add and remove services. As other have said, in uses Tomcat as its Servlet container, so you can literally whittle JBoss down to where it is practically just a Tomcat server. What is the benefit of doing this? Future proofing if you think that you're going to utilize other features of JBoss.

These services in JBoss come pre-integrated and strive to provide a consistent deployment model that minimizes your effort in writing application logic or configuration to integrate them yourself. That being said, other frameworks like Spring also do a great job of supporting a uniform ways of integrating many popular libraries and frameworks. But since they focus on integrating 3rd party libraries, the interoperability between services is up to you. Because JBoss is building the services and the integration platform, they spend time developing (and providing support) for interoperability.

Some questions to ask when making a choice are:

  • Are you going to use standard JavaEE architectural components like EJB?
    • BTW, EJB can be run in standalone Tomcat using the JBoss embedded container, so if EJB is all you're using, then you still don't have to use JBoss
  • Are you going to utilize Web Services, Portals, JMS?
  • Are you looking into building with Web Beans or Seam?
  • What deployment platforms (Tomcat, JBoss, etc) does your IT, support, and development staff currently use? If you are going to use something new, you will incur additional cost to learn the new platform.
  • If you're selling a product that customers will deploy, what impact will it have on the customers' IT organization.
  • Are you going to need paid support?
    • You can find support for Tomcat through many companies (including Red Hat I believe).
    • You'll need to compare the costs, because I don't think JBoss support is cheap, though I haven't looked up prices lately.
  • Will you need to do any sophisticated clustering?
    • JBoss has some wonderful clustering capabilities, and you'll probably get good clustering support through Red Hat. Though, for full disclosure, I've never done any complex clustering with any other frameworks to be able to compare.
  • Are you going to need advanced transaction management (distributed transactions, 2-phase commits, etc)

Not to sound like a shameless plug, but the first chapter of JBoss in Action is available for free on the Manning website. Though we don't do a direct comparison between JBoss and other applications servers and deployment environments in the chapter, we do talk about the architectural differences a bit, which is relevant to your question.

Javid Jamae
Nice answer (and +1 from me). Regarding clustering, could you describe in a few words some obvious advantages of using JBoss vs Tomcat with mod_jk or mod_proxy or even mod_cluster for a Servlet/JSP application? Maybe things like clustering of JNDI tree or of datasource? Anything else obvious?
Pascal Thivent
This seems like it should be a question by itself, but mod_jk and mod_proxy are mainly used for load balancing, in which the Tomcat instances don't necessarily have to know about each other. I haven't used mod_cluster, so I'd have to research. JBoss offers replicated caches, JNDI clustering, session bean clustering, HTTP session replication, JPA/Hibernate 2nd level cache replication, service singletons (service only runs on one server but can failover), and a few other things.
Javid Jamae
Right, these mod_xxx are only for load balancing, which is different. Actually, since Tomcat also supports persistent HTTP sessions, I was wondering what could be good samples of sophisticated clustering features *for a webapp* (JNDI is one). But this should be indeed a question by itself. Thanks for the answer anyway, it already gave me some good hints.
Pascal Thivent
+1 from me, too. I didn't mean to slight JBOSS by only mentioning EJB and JMS, Javid. Your (very good) list makes it clear that there's lots more to it. I was just being succinct.
duffymo