Java Tomcat、JBoss 和 Glassfish 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3821640/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between Tomcat, JBoss and Glassfish?
提问by samoz
I am starting to look into Enterprise Java and the book I am following mentions that it will use JBoss. Netbeans ships with Glassfish. I have used Tomcat in the past.
我开始研究 Enterprise Java,我正在阅读的书提到它将使用 JBoss。Netbeans 附带 Glassfish。我过去使用过Tomcat。
What are the differences between these three programs?
这三个程序有什么区别?
采纳答案by Petar Minchev
Tomcat is just a servlet container, i.e. it implements only the servlets and JSP specification. Glassfish and JBoss are full Java EE servers (including stuff like EJB, JMS, ...), with Glassfish being the reference implementation of the latest Java EE 6 stack, but JBoss in 2010 was not fully supporting it yet.
Tomcat 只是一个servlet 容器,即它只实现了servlet 和JSP 规范。Glassfish 和 JBoss 是完整的 Java EE 服务器(包括 EJB、JMS 等),Glassfish 是最新 Java EE 6 堆栈的参考实现,但 2010 年的 JBoss 还没有完全支持它。
回答by NimChimpsky
jboss and glassfish include a servlet container(like tomcat), however the two application servers (jboss and glassfish) also provide a bean container (and a few other things aswell I imagine)
jboss 和 glassfish 包括一个 servlet 容器(如 tomcat),但是两个应用程序服务器(jboss 和 glassfish)也提供了一个 bean 容器(以及我想象的其他一些东西)
回答by Steve Perkins
Tomcat is merely an HTTP server and Java servlet container. JBoss and GlassFish are full-blown Java EE application servers, including an EJB container and all the other features of that stack. On the other hand, Tomcat has a lighter memory footprint (~60-70 MB), while those Java EE servers weigh in at hundreds of megs. Tomcat is very popular for simple web applications, or applications using frameworks such as Spring that do not require a full Java EE server. Administration of a Tomcat server is arguably easier, as there are fewer moving parts.
Tomcat 只是一个 HTTP 服务器和 Java servlet 容器。JBoss 和 GlassFish 是成熟的 Java EE 应用服务器,包括 EJB 容器和该堆栈的所有其他功能。另一方面,Tomcat 的内存占用更小(约 60-70 MB),而那些 Java EE 服务器的重量为数百兆。Tomcat 非常适用于简单的 Web 应用程序,或使用不需要完整 Java EE 服务器的 Spring 等框架的应用程序。Tomcat 服务器的管理可以说更容易,因为移动部件更少。
However, for applications that do require a full Java EE stack (or at least more pieces that could easily be bolted-on to Tomcat)... JBoss and GlassFish are two of the most popular open source offerings (the third one is Apache Geronimo, upon which the free version of IBM WebSphere is built). JBoss has a larger and deeper user community, and a more mature codebase. However, JBoss lags significantly behind GlassFish in implementing the current Java EE specs. Also, for those who prefer a GUI-based admin system... GlassFish's admin console is extremely slick, whereas most administration in JBoss is done with a command-line and text editor. GlassFish comes straight from Sun/Oracle, with all the advantages that can offer. JBoss is NOT under the control of Sun/Oracle, with all the advantages THAT can offer.
但是,对于确实需要完整 Java EE 堆栈(或至少可以轻松附加到 Tomcat 的更多部分)的应用程序...... JBoss 和 GlassFish 是两个最受欢迎的开源产品(第三个是 Apache Geronimo ,IBM WebSphere 的免费版本就是在此基础上构建的)。JBoss 拥有更大更深入的用户社区,以及更成熟的代码库。但是,JBoss 在实现当前的 Java EE 规范方面明显落后于 GlassFish。此外,对于那些喜欢基于 GUI 的管理系统的人... GlassFish 的管理控制台非常灵活,而 JBoss 中的大多数管理都是通过命令行和文本编辑器完成的。GlassFish 直接来自 Sun/Oracle,具有可提供的所有优势。JBoss 不受 Sun/Oracle 的控制,拥有可以提供的所有优势。
回答by Spartan
Both JBoss and Tomcat are Java servlet application servers, but JBoss is a whole lot more. The substantial difference between the two is that JBoss provides a full Java Enterprise Edition (Java EE) stack, including Enterprise JavaBeans and many other technologies that are useful for developers working on enterprise Java applications.
JBoss 和 Tomcat 都是 Java servlet 应用程序服务器,但 JBoss 远不止这些。两者之间的实质性区别在于 JBoss 提供了完整的 Java 企业版 (Java EE) 堆栈,包括 Enterprise JavaBeans 和许多其他对开发企业 Java 应用程序的开发人员有用的技术。
Tomcat is much more limited. One way to think of it is that JBoss is a Java EE stack that includes a servlet container and web server, whereas Tomcat, for the most part, is a servlet container and web server.
Tomcat 的局限性要大得多。一种思考方式是,JBoss 是一个 Java EE 堆栈,其中包括一个 servlet 容器和 Web 服务器,而 Tomcat 在大多数情况下是一个 servlet 容器和 Web 服务器。
回答by Valerio Vaudi
JBoss and Glassfish are basically full Java EE Application Server whereas Tomcat is only a Servlet container. The main difference between JBoss, Glassfish but also WebSphere, WebLogic and so on respect to Tomcat but also Jetty, was in the functionality that an full app server offer. When you had a full stack Java EE app server you can benefit of all the implementation of the vendor of your choice, and you can benefit of EJB, JTA, CDI(JAVA EE 6+), JPA, JSF, JSP/Servlet of course and so on. With Tomcat on the other hands you can benefit only of JSP/Servlet. However to day with advanced Framework such as Spring and Guice, many of the main advantage of using an a full stack application server can be mitigate, and with the assumption of a one of this framework manly with Spring Ecosystem, you can benefit of many sub project that in the my work experience let me to left the use of a full stack app server in favour of lightweight app server like tomcat.
JBoss 和 Glassfish 基本上是完整的 Java EE 应用服务器,而 Tomcat 只是一个 Servlet 容器。JBoss、Glassfish 以及 WebSphere、WebLogic 等与 Tomcat 和 Jetty 之间的主要区别在于完整应用服务器提供的功能。当您拥有全栈 Java EE 应用服务器时,您可以受益于您选择的供应商的所有实现,当然您也可以受益于 EJB、JTA、CDI(JAVA EE 6+)、JPA、JSF、JSP/Servlet等等。另一方面,使用 Tomcat,您只能从 JSP/Servlet 中受益。然而,如今使用 Spring 和 Guice 等高级框架,可以减轻使用全栈应用服务器的许多主要优势,并且假设该框架中的一个与 Spring 生态系统结合,
回答by Jaimin Patel
You should use GlassFish for Java EE enterprise applications. Some things to consider:
您应该将GlassFish 用于 Java EE 企业应用程序。需要考虑的一些事项:
A web Servermeans: Handling HTTP requests (usually from browsers).
A Servlet Container(e.g. Tomcat) means: It can handle servlets & JSP.
An Application Server(e.g. GlassFish) means: *It can manage Java EE applications (usually both servlet/JSP and EJBs).
一个网络服务器方式:处理HTTP请求(通常来自浏览器)。
一个Servlet 容器(例如Tomcat)意味着:它可以处理 servlet 和 JSP。
一个应用服务器(如GlassFish的)方式:*它可以管理Java EE应用程序(通常都的servlet / JSP和EJB)。
Tomcat- is run by Apache community - Open source and has two flavors:
Tomcat- 由 Apache 社区运行 - 开源并有两种风格:
- Tomcat - Web profile- lightweight which is only servlet container and does not support Java EE features like EJB, JMS etc.
- Tomcat EE- This is a certified Java EE container, this supports all Java EE technologies.
- Tomcat - Web 配置文件- 轻量级,仅是 servlet 容器,不支持 EJB、JMS 等 Java EE 功能。
- Tomcat EE- 这是一个经过认证的 Java EE 容器,它支持所有 Java EE 技术。
No commercial support available (only community support)
没有可用的商业支持(只有社区支持)
JBoss- Run by RedHat This is a full-stack support for JavaEE and it is a certified Java EE container. This includes Tomcat as web container internally. This also has two flavors:
JBoss- 由 RedHat 运行 这是对 JavaEE 的全栈支持,并且是经过认证的 Java EE 容器。这包括 Tomcat 作为内部的 Web 容器。这也有两种口味:
- Community version called Application Server (AS)- this will have only community support.
- Enterprise Application Server (EAP)- For this, you can have a subscription-based license (It's based on the number of Cores you have on your servers.)
- 称为应用程序服务器 (AS) 的社区版本- 这将仅具有社区支持。
- 企业应用程序服务器 (EAP)- 为此,您可以拥有一个基于订阅的许可证(它基于您在服务器上拥有的核心数量。)
Glassfish- Run by Oracle This is also a full stack certified Java EE Container. This has its own web container (not Tomcat). This comes from Oracle itself, so all new specs will be tested and implemented with Glassfish first. So, always it would support the latest spec. I am not aware of its support models.
Glassfish- 由 Oracle 运行 这也是一个全栈认证的 Java EE 容器。它有自己的 Web 容器(不是 Tomcat)。这来自 Oracle 本身,因此所有新规范都将首先使用 Glassfish 进行测试和实施。所以,它总是会支持最新的规范。我不知道它的支持模型。
回答by BATMAN_
Apache tomcat is just an only serverlet container it does not support for Enterprise Java application(JEE). JBoss and Glassfish are supporting for JEE application but Glassfish much heavy than JBOSS server : Reference Slide
Apache tomcat 只是一个不支持 Enterprise Java 应用程序 (JEE) 的 serverlet 容器。JBoss 和 Glassfish 支持 JEE 应用程序,但 Glassfish 比 JBOSS 服务器重得多:参考幻灯片
回答by user2130951
It seems a bit discouraging to use Tomcat when you read these answers. However what most fail to mention is that you can get to identical or almost identical use cases with tomcat but that requires you to add the libraries needed (through Maven or whatever include system you use).
当您阅读这些答案时,使用 Tomcat 似乎有点令人沮丧。然而,最没有提到的是,您可以使用 tomcat 获得相同或几乎相同的用例,但这需要您添加所需的库(通过 Maven 或您使用的任何包含系统)。
I have been running tomcat with JPA, EJBs with very small configuration efforts.
我一直在运行带有 JPA、EJB 的 tomcat,配置工作量很小。