Assume you have been tasked with building an ejb-jar containing an EJB application. The EJB
application contains local, remote, and web service end-point EJBs that provide reusable sevices
within an enterprise. When the application is deployed, client will access the remote session beans
using the global JNDI name java:ServiceLayer/<bean_name>. All of the EJBs are located in the
com.acme.sevicelayer package and are deployed as class files. The application uses a mixture of
deployment descriptor and annotation configuration.
Which JAR representation best represents deployed structure for the previous requirements?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Explanation:
Note:
*JAR (Java ARchive) is an archive file format typically used to aggregate many Java class files
and associated metadata and resources (text, images and so on) into one file to distribute
application software or libraries on the Java platform.
*JAR file is a file format based on the popular ZIP file format and is used for aggregating many
files into one. A JAR file is essentially a zip file that contains an optional META-INF directory.
*In the Java Platform, Enterprise Edition, a deployment descriptor describes how a component,
module or application (such as a web application or enterprise application) should be deployed.It
directs a deployment tool to deploy a module or application with specific container options,
security settings and describes specific configuration requirements. XML is used for the syntax of
these deployment descriptor files.
For web applications, the deployment descriptor must be called web.xml and must reside in the
WEB-INF directory in the web application root. For Java EE applications, the deployment
descriptor must be named application.xml and must be placed directly in the META-INF directory
at the top level of the application .ear file.
*The existing jar tool is enhanced to be able to examine a list of jar files and generate directory
information as to which classes and resources reside in which jar file. This directory information is
stored in a simple text file named INDEX.LIST in the META-INF directory of the root jar file. When
the classloader loads the root jar file, it reads the INDEX.LIST file and uses it to construct a hash
table of mappings from file and package names to lists of jar file names. In order to find a class or
a resource, the class loader queries the hashtable to find the proper jar file and then downloads it
if necessary.
*The INDEX.LIST file contains one or more sections each separated by a single blank line. Each
section defines the content of a particular jar file, with a header defining the jar file path name,
followed by a list of package or file names, one per line. All the jar file paths are relativeto the code
base of the root jar file. These path names are resolved in the same way as the current extension
mechanism does for bundled extensions.
Incorrect:Not A: No reference to the deployment descriptor file ejb-jar.xml
Not D: No reference to classes
D same as 36
D, there is no classes folder in ejb-jar
C is right!