1Z0-133 practice question 15 of 25

Your developers created Plain Old Java Objects (POJO) that provide useful functionality. The code is packaged in a JAR file. You want to make this code accessible from all the applications deployed to the managed servers in your domain. What are the four ways to accomplish this? (Choose four.)

Full set: 126 questions
Answer options
A:

A. Include the JAR file as an optional package

Correct answer
B:

B. Deploy the JAR file as an EJB

C:

C. Deploy the JAR file as a shared library

Correct answer
D:

D. Place the JAR file in the lib folder of the domain

Correct answer
E:

E. Deploy the JAR file to the administration server. All managed servers have access to their admin server

F:

F. Add the JAR file to the CLASSPATH of the domain servers by editing the domain’s seyDomainEnv.sh script

Correct answer
G:

G. Deploy the JAR file as another web application

H:

H. Deploy the JAR file as a web service.

Correct Answer:
A. A. Include the JAR file as an optional package; C. C. Deploy the JAR file as a shared library; D. D. Place the JAR file in the lib folder of the domain; F. F. Add the JAR file to the CLASSPATH of the domain servers by editing the domain’s seyDomainEnv.sh script
Explanation

To make a JAR file's classes accessible to all applications across all managed servers in a WebLogic domain, you can use several classloading mechanisms.
1. Domain Library Directory (D): Placing the JAR in the DOMAINHOME/lib directory causes WebLogic to automatically append it to the classpath of every server in the domain during startup.
2. Startup Script (F): Modifying the domain's setDomainEnv.sh (or .cmd) script to explicitly add the JAR to the CLASSPATH variable achieves the same result, making the classes available in the system classpath.
3. Shared Library (C): Deploying the JAR as a shared Java EE library is a more manageable, version-controlled approach. Applications can then reference this library to gain access to its classes.
4. Optional Package (A): This is a standard Java EE mechanism where a JAR is designated as an optional package via its manifest file. Applications can then declare a dependency on it. WebLogic often implements this using shared libraries. These four methods provide domain-wide accessibility for the POJO classes.

Why Incorrect

B. Deploy the JAR file as an EJB: A simple POJO JAR lacks the required EJB-specific classes, annotations, and deployment descriptors (ejb-jar.xml) to be deployed as an EJB module.
E. Deploy the JAR file to the administration server...: The Administration Server and Managed Servers run in separate JVMs with distinct classpaths. Deploying a library to the Admin Server does not make it accessible to Managed Servers.
G. Deploy the JAR file as another web application: A POJO JAR cannot be deployed as a web application, which requires a specific structure (e.g., WEB-INF directory) and is packaged as a WAR file.
H. Deploy the JAR file as a web service: A web service requires specific endpoint implementation code (e.g., JAX-WS or JAX-RS annotated classes) and cannot be created by simply deploying a POJO JAR. ---

References

1. Oracle Fusion Middleware, Developing Applications for Oracle WebLogic Server, 12c (12.2.1.4.0), Chapter 2: Understanding WebLogic Server Application Classloading.

Reference for D: The section "Modifying the Server Classpath" states, "You can add JARs to the domain/lib directory. These are automatically added to the end of the server’s classpath."

Reference for C & A: Chapter 8, "Creating Shared Java EE Libraries," describes deploying JARs as libraries. It states, "Shared Java EE libraries are Java EE modules that are deployed once to a WebLogic Server instance or cluster and shared by multiple enterprise applications... A library can also be registered as an optional package."

2. Oracle Fusion Middleware, Administering Server Startup and Shutdown for Oracle WebLogic Server, 12c (12.2.1.4.0), Chapter 3: Starting and Stopping Servers.

Reference for F: The section "Customizing the setDomainEnv Script" explains that this script is the recommended location for modifying environment settings for servers in a domain, including the CLASSPATH.

3. Jakarta Enterprise Beans 3.2 Specification (as a successor to Java EE specs relevant to the exam).

Reference for B: Section 21.2, "Packaging," details the required contents of an EJB JAR file, which includes compiled classes for beans and interfaces, and optionally an ejb-jar.xml deployment descriptor. A simple POJO JAR does not meet these requirements.

Scroll to Top