1Z0-133 practice question 14 of 25

You created a shutdown class Myclass that you would like to execute just before server shutdown. Which statement is true regarding Myclass?

Full set: 126 questions
Answer options
A: Myclass can be specified in the Configuration Wizard as a shutdown class.
B: Myclass must be available in the WebLogic server’s classpath. Correct answer
C: Myclass can be targeted to only one server instance.
D: Myclass must not have a main method.
Correct Answer:
B. Myclass must be available in the WebLogic server’s classpath.
Explanation

For a WebLogic Server instance to execute a custom Java class, such as a shutdown class, the class file must be locatable by the server's Java Virtual Machine (JVM). This is accomplished by placing the class or its containing JAR file in a location that is part of the server's classpath. This is a fundamental requirement for the server to load and instantiate the class during the shutdown sequence. Common locations include the DOMAINHOME/lib directory, or other directories specified in the server's startup scripts.

Why Incorrect

A. Shutdown classes are configured on an existing domain via the Administration Console or WLST, not during the initial domain creation process with the Configuration Wizard.
C. A shutdown class can be targeted to a single server, multiple servers, or an entire cluster, making this statement a possible configuration but not a mandatory rule.
D. The presence of a static void main(String[] args) method does not interfere with the server's ability to use the class as a shutdown hook; the server simply ignores it.

References

1. Oracle Fusion Middleware Documentation for Oracle WebLogic Server

"Administering Startup and Shutdown Classes for Oracle WebLogic Server

" 12c (12.2.1.4.0)

Chapter 2: Using Startup and Shutdown Classes.

Section: "Making a Startup or Shutdown Class Available": This section explicitly states

"To be available to a WebLogic Server instance

a startup or shutdown class must be in the server's classpath. You can add a class to the classpath by..." This directly supports the correct answer (B).

2. Oracle Fusion Middleware Documentation for Oracle WebLogic Server

"Administering Startup and Shutdown Classes for Oracle WebLogic Server

" 12c (12.2.1.4.0)

Chapter 2: Using Startup and Shutdown Classes.

Section: "Targeting a Startup or Shutdown Class": The documentation states

"You can target a startup or shutdown class to one or more servers or to a cluster." This shows that targeting is flexible and not restricted to a single server

making option (C) an incomplete description of the capability.

3. Oracle Fusion Middleware Documentation for Oracle WebLogic Server

"Creating WebLogic Domains Using the Configuration Wizard

" 12c (12.2.1.4.0).

The steps outlined for creating a domain do not include a screen or option for configuring startup or shutdown classes

which confirms that this is a post-creation administrative task. This invalidates option (A).

Scroll to Top