JAR组件与EAR有何不同? (应用服务器)
问题描述:
JAR
与EAR
文件相对于EJB
的distinction是什么? Glassfish的帮助说:JAR组件与EAR有何不同? (应用服务器)
[email protected]:~$
[email protected]:~$ GlassFish_Server/bin/asadmin deploy --help
...
--type
The packaging archive type of the component that is being deployed.
Possible values are as follows:
car
The component is packaged as a CAR file.
ear
The component is packaged as an EAR file.
ejb
The component is an EJB packaged as a JAR file.
osgi
The component is packaged as an OSGi bundle.
rar
The component is packaged as a RAR file.
war
The component is packaged as a WAR file.
因此,一个EJB
可以打包成一个文件JAR
?什么是功能差异?具体来说,EAR
组件可以做什么JAR
不能?
答
EAR -耳朵文件基本上旨在包含完整的企业应用程序。它包含构成特定Java EE应用程序的所有组件。企业应用程序被定义为.jar文件,资源,类和多个Web应用程序的集合.JAR文件封装了一个或多个Java类,清单和描述符。 Jar文件基本上是为了保存Java类,资源等的通用库。而且,JAR文件是归档的最低级别。 JAR文件在Java EE中用于打包EJB和客户端Java应用程序。
是由Netbeans定义的'EJB'模块,打包为'EAR'?或者,正如你在答案中所建议的那样,作为“JAR”?如果你想扩大这一点,将不胜感激。 – Thufir
Ejb模块将仅打包为EAR ..格式 – kattoor
如果要将其归档为企业应用程序,可以将其创建为EAR,或者如果要将其归档为包含EJB模块,EJB客户端模块和实用程序的Java应用程序模块,你可以创建它作为JAR..hope这有助于:) – kattoor