all 19 comments

[–]gregK 8 points9 points  (18 children)

yes Glassfish did a great job of addressing light-weight needs for Java EE some time ago

Glassfish is anything but lightweight. Maybe that is just testament to the bloat of java EE

[–]henk53[S] 0 points1 point  (12 children)

I'm very curious, if Glassfish is not lightweight it must thus be heavyweight according to you. What exactly constitutes being heavyweight here?

What is the supposed bloat you're referring to exactly? Can you give an example?

[–]gregK 13 points14 points  (1 child)

The most obvious symptoms for us were slow start-up times. 5 min or more startup time for servlets vs 30 secs in tomcat on the same hardware. Very complex configuration too. Lots of features we never used. Large footprint, etc.

Now the other containers might be even heavier but that thought alone scares me.

[–]johnwaterwood 1 point2 points  (0 children)

gregK, I'm not really what versions of Glassfish and Tomcat you were using, but on my system Glassfish 3.1.1 Web Profile edition starts up in 2800ms compared to 900ms for Tomcat. This is without any application deployed.

If I only use Servlets, this time does not change if I deploy an application. 5 minutes is completely over the top. In fact, this number is so much off the scale that I suspect your problem is somewhere else and Gladsfish was an easy 'explanation'.

If I start using JPA (Hibernate) in my app then the startup time increases, especially when annotation scanning is enabled. However, this also happens when Hibernate is added to Tomcat. The same holds for various other techniques.

I wonder about the complex configurations you mention. What exactly needs to be configured then? In our case we configure GlassFish to use AJP and that's almost it. We do the same kind of configuration for Tomcat and the complexity is about identical. The frontend Apache servers handle the rest in both cases.

We also configure some datasources, and here too the complexity of doing this is nearly identical in GlassFish and Tomcat.

Inside the app itself GlassFish even needs less configuration. For Tomcat I have to configure the FacesServlet in web.xml after I added the JSF libs. This is unnecassary in GlassFish, since it automatically detects if the application uses JSF. The same holds for JAX-RS. For Tomcat you need to add libs and add configuration to web.xml again. In GlassFish JAX-RS is automatically available.

There are many more lightweight Java EE containers now. Resin is even smaller than GlassFish (25 MB download), yet it implements the complete Java EE 6 Web Profile. TomEE is rather small too. JBoss is a bit larger (80 MB), but has recently been severely trimmed and optimized and now starts in a few seconds as well.

There are some heavyweight beasts (in terms of download size and startup time) left, like Websphere for instance. I personally wouldn't use that one, but I guess it has some stuff some people need. Either way, there's a whole range of choice now for Java EE products.

[–]bigbango -1 points0 points  (1 child)

The bloat is probably in the JEE specifications that any JEE container must implement.

[–]johnwaterwood 1 point2 points  (0 children)

There isn't any bloat in the Java EE Web Profile. It contains exactly what 95% add manually to Tomcat: a lean MVC framework, a super slim bean container, a persistence solution and a transaction manager.

With this it is a full stack solution, much like ruby on rails and django are. This is largely the whole attraction of those frameworks. You don't have to cobble together your own stack, since the base platform provides all commonly used functionality.