Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Jetty be used as a Java EE lightweight application server?

In the scope of deploying small Java EE web applications at various client sites, I am searching for an easy application server solution.

I think I remember hearing that it was possible to use Jetty as a JavaEE 6 lightweight application server but I can't seem to find more evidence on this right now on the web.

Knowing that my development environment is JSF2 + RichFaces, CDI (Weld) and JPA 2 => NO EJBs at this point), is Jetty a possible solution for me?

If yes, could you point me to some docmentation or specific keywords helping me? If no, what other lightweight Java EE 6 application server should I use?

like image 518
Jérôme Jadoulle Avatar asked Feb 04 '11 23:02

Jérôme Jadoulle


People also ask

Is Jetty Java EE?

Jetty is another application server (this one developed by Eclipse Foundation) that isn't technically a fully featured Java EE container. Just like Tomcat, it lacks support for many Java EE features.

What is Jetty server used for?

Jetty provides a web server and servlet container, additionally providing support for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and many other integrations. These components are open source and are freely available for commercial use and distribution.

What is Java EE application server?

A Java EE server is a server application that the implements the Java EE platform APIs and provides the standard Java EE services. Java EE servers are sometimes called application servers, because they allow you to serve application data to clients, much like web servers serve web pages to web browsers.

Is Jetty better than Tomcat?

On whole, the key difference between Tomcat and Jetty is the fact that Apache Tomcat places great stress on being up to date with the latest specification, while Eclipse Jetty prioritizes the needs of their user community which tends to result on an emphasis on performance.


1 Answers

Jetty is a servlet container, just like Tomcat. At the moment it's utterly unsuited as a Java EE 6 application server since the core requirement for a servlet container in that stack is being a Servlet 3.0 container.

Jetty 7, the latest stable version, is still at Servlet 2.5. At the moment nobody knows when Jetty 8, which will support Servlet 3.0 will be released, but experimental releases can already be downloaded. See http://www.eclipse.org/projects/project-plan.php?projectid=rt.jetty

Even when Jetty 8 will eventually be available, you'll of course still need to add JSF2 (Mojarra), CDI (Weld) and JPA2 (Hibernate).

Currently lightweight alternatives are Glassfish V3 (especially the Web Profile version). This weighs in at a 47MB download and gives you the full web profile. Glassfish starts up in approximately one second on modern systems and something like 2 or 3 on older ones. Memory overhead is minimal.

Yet another alternative is Caucho Resin. It's an inch away from being Java EE 6 Web Profile certified (see http://caucho.com/resin-4.0/changes/resin-4.0.14.xtp), and for all practical purposes is already fully useable as a Java EE 6 application server. Although I haven't personally used Resin, being lightweight seems to be their top priorities. (do note that 'lightweight' is a vague and much disputed term)

Finally, you could give JBoss AS 6 a spin. Few people would call JBoss AS 'lightweight' (startup time on fast hardware is at least 12 seconds, and its download size is 181MB), but its free and open source and depending on your definition of lightweight those numbers may be 'good enough'.

like image 144
Arjan Tijms Avatar answered Sep 18 '22 09:09

Arjan Tijms