Oracle WebLogic Server: A Guide to Deploying and Managing Java Applications

This guide provides a comprehensive overview of Oracle WebLogic Server, a robust platform for deploying and running Java EE and Jakarta EE applications. Learn about deployment descriptors, explore different WebLogic Server versions, and understand how to effectively manage and deploy your Java applications in this enterprise-grade environment.



Top WebLogic Interview Questions and Answers

What is WebLogic Server?

Question 1: What is WebLogic Server?

WebLogic Server is a Java-based application server developed and maintained by Oracle. It's a robust platform for deploying and running Java applications, providing a scalable and reliable environment for enterprise applications. It's used for both on-premises and cloud deployments and supports Java EE (Enterprise Edition) and Jakarta EE standards.

Deployment Descriptors

Question 2: Deployment Descriptors

Deployment descriptors in WebLogic Server are XML files that describe the structure and configuration of applications and modules. They're essential for deploying and managing applications within the WebLogic environment.

WebLogic Server Versions

Question 3: WebLogic Server Versions

(A table listing WebLogic Server versions and their release dates would be inserted here. The table should be clearly formatted and easy to read.)

WebLogic Server and Kubernetes

Question 4: WebLogic Server on Kubernetes

Oracle WebLogic Server is fully compatible with Kubernetes. This allows for deploying and managing WebLogic applications within containerized environments, providing increased flexibility and scalability.

Core WebLogic Server Components

Question 5: Core Components of WebLogic Server

Key components:

  • Domains: Logical groupings of resources managed as a single unit.
  • Node Manager: Manages server instances.
  • Administration Server: Centralized management interface for the domain.
  • Managed Servers: Run applications within a domain.
  • Clusters: Groups of managed servers for increased availability and scalability.
  • Messaging Services: Support for messaging standards (JMS).

WebLogic Domains

Question 6: WebLogic Domains

A domain in WebLogic Server is a logical container for all the resources that make up a WebLogic deployment. It's managed as a single unit by the Administration Server and is often used to isolate different environments (development, testing, production).

WebLogic Servers

Question 7: WebLogic Servers

A WebLogic server is a multi-threaded application server running on a JVM (Java Virtual Machine) that hosts enterprise applications. There are two main types:

  • Administration Server: Manages the domain's configuration.
  • Managed Server: Hosts and runs applications.

Administration Server

Question 8: Administration Server

The Administration Server manages the configuration of a WebLogic domain. It's the central point for creating, configuring, and monitoring all resources within the domain. A domain can have only one Administration Server.

Managed Servers

Question 9: Managed Servers

Managed servers in a WebLogic domain host and run applications. Multiple managed servers can be grouped into a cluster for high availability and scalability.

web.xml

Question 10: web.xml

web.xml is a deployment descriptor file (XML) that defines the configuration for a web application deployed in a WebLogic Server. It specifies settings like servlets, filters, listeners, security roles, etc.

WebLogic Server: Application vs. Web Server

Question 11: WebLogic Server: Application or Web Server?

WebLogic Server is primarily an *application* server. Although it includes features like a web server, its main function is to host and manage enterprise applications.

WebLogic Thread States

Question 12: WebLogic Thread States

WebLogic Server threads can be in various states:

  • ACTIVE
  • IDLE
  • STANDBY
  • RUNNABLE
  • WAITING
  • BLOCKED

Additional states may exist depending on the WebLogic version and configuration.

Providing User Credentials

Question 13: Providing User Credentials

When you create a WebLogic domain, you provide user credentials (username and password). These credentials are used to access the Administration Console. For development domains, the credentials are often stored in an encrypted identity file. For production domains, it is recommended to use a different security method to avoid storing credentials directly in a file. A new identity file is required to change the credentials or when creating production domains.

Administration Server Failure

Question 14: Administration Server Failure

If the Administration Server fails, the Managed Servers in the domain typically continue running. Managed Servers periodically try to reconnect to the Administration Server to synchronize configuration. If the Administration Server is unavailable, the Managed Servers use their local configuration. However, failure of the Administration Server may impact other servers if they are on the same host machine.

WebLogic Installation Modes

Question 15: WebLogic Installation Modes

WebLogic Server offers various installation modes:

  • Console Mode: Text-based, interactive installation.
  • Graphical Mode: GUI-based, interactive installation.
  • Silent Mode: Non-interactive installation using a properties file.

HTTP Protocol

Question 16: HTTP Protocol

HTTP (Hypertext Transfer Protocol) is the foundation of data communication between web browsers and servers. WebLogic Server uses HTTP for communication with clients.

Stage vs. Non-Stage Deployments

Question 17: Stage vs. Non-Stage Deployments

In a staged deployment, applications are deployed to the Administration Server first, and then propagated to Managed Servers. Non-staged deployment requires each Managed Server to contact the application source for deployment.

Providing WebLogic Server Credentials

Question 18: Providing WebLogic Server Credentials

Methods for providing credentials:

  • Command-line: Prompted during domain creation.
  • boot.properties file: Used for development domains (stores encrypted credentials).
  • Identity file: Used for production domains or when changing credentials.

Default Admin Server Port

Question 19: Default WebLogic Admin Server Port

The default port for the WebLogic Administration Server is 7001 (7002 for SSL).

Starting and Stopping WebLogic Server

Question 20: Starting and Stopping WebLogic Server

Methods for starting and stopping:

  • Using the java WebLogic.Server command.
  • Using Windows Services.
  • Using scripts.
  • Using WLST (WebLogic Scripting Tool) with or without Node Managers.

Auto-Deployment

Question 21: Auto-Deployment

WebLogic Server's auto-deployment feature automatically deploys applications when changes are detected (typically used during development). To disable it:

  • Select "Production Mode" in the Administration Console.
  • Use the command-line option -Dweblogic.ProductionModeEnabled=true.

Setting CLASSPATH

Question 22: Setting CLASSPATH in WebLogic Server

Use the setWLSEnv.cmd (Windows) or setWLSEnv.sh (Linux) scripts located in WL_HOME/server/bin to set the CLASSPATH.

Accessing Admin Console

Question 23: Accessing WebLogic Admin Console

Access the admin console via a web browser, entering the admin server's hostname or IP address and port (default 7001).

Checking WebLogic Server Version

Question 24: Checking WebLogic Server Version

Navigate to Environment > Servers > [Your Server] > Monitoring > WebLogic Version in the WebLogic Server Administration Console.

Configuring Managed Servers

Question 25: Configuring Managed Servers

Methods for configuring Managed Servers:

  • WebLogic Scripting Tool (WLST)
  • Administration Console
  • Configuration Wizard

WebLogic Server Capabilities

Question 26: WebLogic Server Capabilities

WebLogic Server capabilities include dynamic reconfiguration, application redeployment, and rolling upgrades.

IIOP (Internet Inter-ORB Protocol)

Question 27: IIOP

IIOP (Internet Inter-ORB Protocol) is a protocol that enables communication between the WebLogic Server and other ORBs (Object Request Brokers).

BSU (BEA Smart Update Utility)

Question 28: BSU (BEA Smart Update Utility)

BSU (BEA Smart Update utility) is used for applying patches to WebLogic Server instances.

Development vs. Production Mode

Question 29: Development vs. Production Mode

Key differences between development and production modes:

Feature Development Mode Production Mode
JDK Typically Sun Hotspot JDK Typically JRockit JDK
Auto-Deployment Enabled Disabled
SSL Certificates Demo certificates allowed Warnings displayed for demo certificates
Logging Log rotation on startup Log rotation when file size reaches a threshold
JDBC Data Source Capacity Lower Higher

T3 Protocol

Question 30: T3 Protocol

The T3 protocol is a proprietary protocol used by WebLogic Server for communication between the Administration Server and Managed Servers.

Setting CLASSPATH

Question 31: Setting CLASSPATH

To set the CLASSPATH for a WebLogic Server, modify the setWLSEnv.cmd (Windows) or setWLSEnv.sh (Linux) script in the WL_HOME/server/bin directory. These scripts control the environment variables used when starting WebLogic.

Connection Pooling in Tomcat

Question 32: Connection Pooling in Tomcat

Setting up connection pooling in Tomcat involves:

  1. Including necessary JAR files (commons-dbcp, commons-pool, and commons-collections) in your Tomcat `lib` directory.
  2. Configuring the connection pool within Tomcat's server.xml file.

Stub Behavior in WebLogic Clusters

Question 33: Stub Behavior in WebLogic Clusters

In a WebLogic Server cluster, stubs maintain a list of available server instances using DNS. If a server fails, the stub removes it from the list and redirects requests to other healthy instances. This ensures high availability and load balancing.

Server Crash vs. Server Hang

Question 34: Server Crash vs. Server Hang

A server *crash* terminates the Java process. A server *hang* occurs when the Java process is running but stops responding to requests.

Troubleshooting Server Hangs

Question 35: Troubleshooting Server Hangs

To troubleshoot a server hang, check the WebLogic logs (often `weblogic.Admin.log` or similar) for errors. Look for clues related to deadlocks, long running operations or memory issues.

Causes of Server Hangs

Question 36: Causes of Server Hangs

Common causes of server hangs include:

  • Memory leaks.
  • Deadlocks.
  • Long-running operations that block other processes.

Causes of Server Crashes

Question 37: Causes of Server Crashes

Common causes of server crashes:

  • Issues with native I/O operations.
  • JVM (Java Virtual Machine) problems.
  • Problems with configuration settings.
  • JDBC driver issues.
  • Issues with SSL native libraries.

`boot.properties` File

Question 38: `boot.properties` File

The boot.properties file (located in DOMAIN_HOME/servers/<server_name>/security) contains encrypted security information. This includes the username and password for the Administration Server or Managed Server. This file is used to configure boot-up security parameters.

Troubleshooting Server Crashes

Question 39: Troubleshooting Server Crashes

For JVM crashes, examine the hs_err_pid<pid>.log file for clues about the cause. Addressing the root cause may involve adjusting configurations, updating drivers, or contacting the relevant support teams.

Out of Memory Errors

Question 40: Causes of Out of Memory Errors

Causes of out-of-memory errors:

  • Insufficient heap size.
  • Memory leaks in the application.
  • Long-lived objects (e.g., HTTP sessions).
  • JVM bugs preventing garbage collection.

T3 Protocol Functionality

Question 30: T3 Protocol Functionality

T3 (WebLogic Server's proprietary protocol) provides a framework for communication between the Administration Server and Managed Servers. It supports features such as object serialization, RMI (Remote Method Invocation), and secure communication.