JAR组件与EAR有何不同? (应用服务器) [英] how does a JAR component differ from an EAR? (application server)

查看:151
本文介绍了JAR组件与EAR有何不同? (应用服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JAR

区别是什么? code>和 EAR 文件相对于 EJB 的? Glassfish的帮助说:

  thufir @ doge:〜$ 
thufir @ doge:〜$ GlassFish_Server / bin / asadmin deploy --help

...

  --type 
正在部署的组件的打包归档类型。
可能的值如下:

car
该组件被打包为一个CAR文件。

ear
组件打包为EAR文件。

ejb
该组件是一个打包为JAR文件的EJB。

osgi
组件打包为OSGi包。

rar
组件打包为RAR文件。

war
组件打包为WAR文件。

因此,可以将 EJB 打包为 JAR 文件?什么是功能差异?具体而言, EAR 组件可以做什么 JAR 不能

解决方案

EAR - Ear文件基本上用于包含完整的企业应用程序。它包含构成特定Java EE应用程序的所有组件。企业应用程序被定义为一组.jar文件,资源,类和多个Web应用程序。 JAR文件封装了一个或多个Java类,清单和描述符。 Jar文件基本上是为了保存Java类,资源等的通用库。而且,JAR文件是归档的最低级别。 JAR文件在Java EE中用于打包EJB和客户端Java应用程序。


What's the distinction between a JAR and an EAR file relative to EJB's? Glassfish help says:

thufir@doge:~$ 
thufir@doge:~$ 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.

So an EJB can be packaged as a JAR file? What is the functional difference? Specifically, what can an EAR component do which a JAR cannot?

解决方案

EAR - Ear files are basically intended to contain complete enterprise applications. it contains all of the components that make up a particular Java EE application. The enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications

JAR - Java Archives (JAR) A JAR file encapsulates one or more Java classes, a manifest, and a descriptor. Jar files are basically intended to hold generic libraries of Java classes, resources etc. Also, the JAR files are the lowest level of archive. JAR files are used in Java EE for packaging EJBs and client-side Java Applications.

这篇关于JAR组件与EAR有何不同? (应用服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆