2017-08-19 28 views
2

JAREAR文件相對於EJBdistinction是什麼? 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不能

回答

1

EAR -耳朵文件基本上旨在包含完整的企業應用程序。它包含構成特定Java EE應用程序的所有組件。企業應用程序被定義爲.jar文件,資源,類和多個Web應用程序的集合.JAR文件封裝了一個或多個Java類,清單和描述符。 Jar文件基本上是爲了保存Java類,資源等的通用庫。而且,JAR文件是歸檔的最低級別。 JAR文件在Java EE中用於打包EJB和客戶端Java應用程序。

+0

是由Netbeans定義的'EJB'模塊,打包爲'EAR'?或者,正如你在答案中所建議的那樣,作爲「JAR」?如果你想擴大這一點,將不勝感激。 – Thufir

+1

Ejb模塊將僅打包爲EAR ..格式 – kattoor

+1

如果要將其歸檔爲企業應用程序,可以將其創建爲EAR,或者如果要將其歸檔爲包含EJB模塊,EJB客戶端模塊和實用程序的Java應用程序模塊,你可以創建它作爲JAR..hope這有助於:) – kattoor

相關問題