Showing posts with label Web Logic. Show all posts
Showing posts with label Web Logic. Show all posts

Friday, 17 July 2015

weblogic interview questions


WebLogic Interview questions and answers


1)What is web.xml?

Web.xml is an XML document that is mainly for application purpose and it helps in listing out the J2EE components and configuration that of your application in J2EE modules format.

2)What are the capabilities of WebLogic server?

There are various capabilities associated with WebLogic server and they are
... Changes in dynamic configuration.
... Production application redeployment.
... Rolling upgrades.
 
3) Explain about the function associated with T3 in WebLogic server?

T3 provides enhancements support for the messages of WebLogic server. The enhancements comprise of the object replacement, the working of the weblogic server - clusters and also HTTP. T3 also performs serialization of java object and also predation of RMI. T3 can be considered as superset associated with JAVA object. T3 is mandated between WebLogic servers, programmatic clients and cluster associated with WebLogic server. The protocols HTTP and IIOP are made used for enabling communication between WebLogic server and processes.

4) Explain the use of HTTP?

HTTP is the protocol that is made used for the purpose of enabling communication between the WebLogic server and processes.

5) Explain the functionality of IIOP?

IIOP is a kind of protocol helpful in enabling the communication between WebLogic server and object request broker.
 
6) How do you differentiate between a server hang and server crash issue?

When a server crashes, the JAVA process no longer exists. 
When Server is hang, it stops responding.
We can use the weblogic.ADMIN utility to ping the server. In case of hang situation we can take multiple thread dumps and analyse the cause of hang.

7) What can be the various reasons for a server crash?

... Native IO
... JVM
... SSL Native Libraries
... Supported Configuration
... JDBC Driver issue
8) Server crash ---- troubleshoot?

JVM crash generates a hs_err_pid file. We need to look into the stack trace of the hs_err_pid file.

Thread is from a native io, we need to disable native io.
Stack trace is from the driver, we need to get in touch with the drive team.
quite possibly its a problem with driver changing the type of driver can be a workaround.
If the thread shows it coming from an optimised code, we can turn of optimization.
stack is from native calls of application, its a bug with the application and it has to be modified.

9) Server hang ---- troubleshoot?

We can use java weblogic.admin PING to check if we get a normal response.
We need to take multiple thread dumps with kill -3 pid on unix and Ctrl+Break on Windows
Analyze the thread dump to find the root cause.

10) Reasons of Server hang?
.... Memory leak
.... database query taking a longtime to return
.... Deadlock

11) What is memory leak?

Memory leak is when objects are not removed from the heap even when they are not required.

12) What are the variour causes of OUT OF MEMORY?

... Insufficient  heap size
... Objects licking too long
... Memory leak in application code.
... Full Garbage Collection (GC) not happening due to JVM Bug.
13) How to overcome such issues?

Gather memory data by enabling GC verbose.
If its due to HTTP Session, timing out http session after certain interval might help.
Look into the code for JDBC connection handling.
Optimizing the heap size according to the load.

14) When the High CPU Usage occur?

It occurs when one process or one thread utilizes unexpectedly high proportion of CPU.

Wednesday, 15 July 2015

weblogic installation

Selecting the correct installer to install Oracle Weblogic Server

When ever we start learning about a software product, the first step is to get the software installer and install it.

Before we start with "How to install Oracle Weblogic Server?",
lets understand the different kinds of installers available for Oracle Weblogic Server and select the correct installer.

There are three different kinds of Weblogic server Installers:

1. Package Installer
2. Development-only and supplemental installers
3. Upgrade Installer

1) Package Installer:

If you have never installed Oracle Weblogic Server and this is the first time you are installing it, then what you need is a Oracle Weblogic Server's Package Installer.

Again there are two different kinds of Package Installers:

a) Generic Package installer:

. It does not include JAVA runtime. (When using "Generic Package installer" it is a prerequisite that a supported JDK should be installed)
. If you want to install weblogic server with 64bit JVM, you have to use "Generic Package installer".
. "Generic Package installer" is platform independent and can be used to install weblogic server on any supported 32bit or 64bit platform.

b) OS-specific Package installer

. As the name suggests the installer is platform specific.
. It is meant for installation with a 32 bit JVM only.
. Both SUN and JROCKIT 32bit JDKs come bundled with "OS-specific Package installer", so no need to install the JDK in advance.

2) Development-only and supplemental installers:

. If you have no plans to use there Oracle Weblogic Server in Production and need a simple installer fro testing purpose only, then use this installer.
. Download the zip distribution, unzip it and its ready to use.

3) Upgrade Installer:

. Upgrade installer is used to upgrade a Oracle Weblogic Server installation from one minor version to a higher minor version.
. There are no installers available to upgrade Oracle Weblogic Server Installation from one major version to another, though Domain upgrade is always available.

Note:

Following are the different versions of Oracle Weblogic Server in ascending order (excluding versions before WLS 9.2):

Where "x" denotes the minor version, 9.2,10.0,10.3 and 12.1 are the major versions.

so you may use the upgrade installer to upgrade from WLS 10.3.1 to 10.3.6, or 10.0.1 to 10.0.2 etc.


Steps on how to install Oracle Weblogic Server Installer

Generic Package installation
OS-specific Package installation
Domain creation using configuration wizard

Generic Package Step by Step Installation:

1) Graphical mode:

Step 1: Log in to the target system.
Step 2: Add the bin directory of the appropriate JDK to the beginning of the PATH variable definition on the target system.
Step 3: For example: PATH=$JAVA_HOME/bin:$PATHexport PATH (Unix/Linux) or
set PATH=%JAVA_HOME%/bin;%PATH% (Windows)
Step 4: Go to the directory where you downloaded the installation program.
Step 5: Launch the installation program by entering the following command (this example shows the NET installer):
java -jar net_wlsversion_generic.jar
The installation program begins to install the software.
Step 6: Once the installation preparation is complete you will see the welcome screen
Screen:


Step 7: Click Next

Step 8: If there are existing Middleware Home Directories it will list all of them.
You may either select an existing Middleware Home Directory or create a new one.

Note: It is always recommended to have one Middleware Home Directory per installation, so I'll select "Create a new Middleware Home"

Step 9: Click Next

Step 10: If you want to register for Security updates enter  your My Oracle Support credentials or else un-check the box, it will prompt to bypass click Yes
and then
click Next.

Step 11: Click Next

Step 12: Click Next

Step 13: Click Next to All Users to access the Oracle Weblogic Server Installation.

Step 14: Click Next ( Make sure the more then 1289.8 MB of space is available in the Middleware Home)

Step 15: Wait for the installation to complete.


Click Done. And the installation is complete.

2) Console mode:
Step 1: Log in to the target system.
Step 2: Add the bin directory of the appropriate JDK to the beginning of the PATH variable definition on the target system.
Step 3: For example: PATH=$JAVA_HOME/bin:$PATHexport PATH (Unix/Linux) or
                set PATH=%JAVA_HOME%/bin;%PATH% (Windows)
Step 4: Go to the directory where you downloaded the installation program.
Step 5: Launch the installation program by entering the following command (this example shows the NET installer):

java -jar net_wlsversion_generic.jar -mode=console


The installation program begins to install the software.

OS-Specific Package Installation:

There are 3 types of installations

1. GUI mode.

2. Console mode.

3. Silent mode.

1) GUI Mode: 

Step1: welcome screen

Step2: Accept license agreement.

Step3: Create new BEA home directory

C:\bea10.3

Step4: Choose installation- Complete (or) Custom

Step5: Select complete

Step6: Select product installation directory

          C:\bea10.3\wlserver_10.3

2) Console Mode:

       server10.3_win32.exe  -mode = console

3) Silent Mode:   It is a way of setting installation configuration only once and then using those configurations to duplicate the installation on many machines.

The installation programs read the settings for your configuration from an xml file.(silent.xml)

server10.3_win32.exe -mode=silent -silent.xml=c:\bea10.3\silent.xml  -log=c:\10.3\silent.log


Step 1: Create silent.xml file

<?xml version="1.0" encoding="ISO-8859-1" ?>

<bea-installer>

<input-fields>

<data-value name="BEAHOME" value="C:\bea10.3" />

<data-value name="USER_INSTALL_DIR" value="C:\bea10.3\wlserver_10.3" />

</input-fields>

</bea-installer>

Step 2: Save this file as silent.xml file in C:\bea10.3 folder

Step 3: Copy the WebLogic software under C:\bea10.3 folder

Step 4: Create a sub folder wlserver_10.3 under c:\bea10.3

Step 5: Execute the below command

server103_win32.exe -mode=silent -silent_xml=C:\bea10.3\ silent.xml  -log=C:\10.3\silent.log



Domain creation using configuration wizard:

Step 1: Goto the below path and execute config.cmd script
            C:\bea10.3\wlserver_10.3\common\bin>config.cmd
Step 2: Select - Create new WebLogic domain
Step 3: Select - Base this domain on an existing template
Step 4: Configure Administrator username and password.
Step 5: Configure server start mode and JDK
             Development mode ---- SunJdk
             Production mode ----- Jrocket
             Select development mode and SunJdk
Step 6: Customize environment & services settings
            Select yes if you would like to configure resources
Step 7: Configure Admin server
             Name : AdminServer
             Listen address: localhost
             Listen port : 7001
             SSL listen: None
             Default port number for AdminServer-7001
              Default ssl listen port : 7002
Step 8: Configure managed servers
             name listen address listen port ssl listen port
             ms1 localhost 7003 None
             ms2 localhost 7004 None
Step 9: Configure cluster
            Name Multicast address multicast port cluster address
            c1 239.192.0.0 7010 localhost:7003, localhost:7004
Step 10: Assign servers to clusters
Step 11: Configure machines
               Name NodeManagerListenAddress NodeManagerListenPort
               m1 localhost 5556
Step 12: Assign servers to machines
Step 13: Create WebLogic domain
              Enter the name and location for the domain
              Domain name : dev_domain
              Domain location : c:\bea10.3\user_projects\domains
Step 14: Click on Create

Monday, 13 July 2015

WebLogic Intraduction





WebLogic Server Administration


WebLogic Server:


Oracle WebLogic is a server software application that runs on a middle tier, between back-end databases and related applications an browser-based thin clients. WebLogic is a leading e-commerce online transaction processing (OLTP) platform, developed to connect users in a distributed computing environment and to facilitate the integration of mainframe applications with distributed corporate data and applications.
WebLogic server is based on Java2 Platform, Enterprise Edition (J2EE), the standard platform used to create Java-based multi-tier enterprise applications.


Oracle WebLogic Server 12c is the industry's best application server for building and deploying enterprise Java EE applications with support for new features for lowering cost of operations, improving performance, enhancing scalability and supporting the Oracle Applications portfolio.

WebLogic Versions:

WebLogic Server 12c (12.1.1) - March 2012
 WebLogic Server 12c (12.0) - December 1, 2011
 WebLogic Server 11gR1 PS5 (10.3.6) - February 2012
WebLogic Server 11gR1 PS4 (10.3.5) - May 16, 2011
WebLogic Server 11gR1 PS3 (10.3.4) - January 15, 2011
WebLogic Server 11gR1 PS2 (10.3.3) - April 2010
WebLogic Server 11gR1 PS1 (10.3.2) - November 2009
WebLogic Server 11g (10.3.1) - July 2009
WebLogic Server 10.3 - August 2008
WebLogic Server 10.0 - March 2007
WebLogic Server 9.2
WebLogic Server 9.1
WebLogic Server 9.0 - November 2006
WebLogic Server 8.1 - July 2003
WebLogic Server 7.0 - June 2002
WebLogic Server 6.1
WebLogic Server 6.0 - file date March 2001 on an old CD
WebLogic Server 5.1 (code name: Denali) First version supporting hot deployment for applications (via command line)
WebLogic Server 4.0


Domain: The basic administrative unit for a WebLogic Server installation is called a domain. A domain is a logically related group of WebLogic Server resources that you manage as a unit. A domain always includes only one instance of WebLogic Server called the Administration Server. The Administration Server serves as a central point of contact for server instances and system administration tools. A domain may also include additional WebLogic Server instances called Managed Servers.
You can configure some or all of these Managed Servers to be part of a WebLogic Server cluster. A cluster is a group of WebLogic Server instances that work together to provide scalability and high-availability for applications. A Managed Server in a cluster can act as a backup for services such as JMS and JTA that are hosted on another server instance in the cluster. Your applications are also deployed and managed as part of a domain.

Node Manager: Node Manager is a Java program provided with WebLogic Server that enables you to start, shut down, restart, and monitor remote WebLogic Server instances. To enable these capabilities, you run an instance of Node Manager on each physical machine in your domain.
A Node Manager process is not associated with a specific WebLogic domain but with a machine. You can use the same Node Manager process to control server instances in any WebLogic Server domain, as long as the server instances reside on the same machine as the Node Manager process. Node Manager must run on each computer that hosts WebLogic Server instances—whether Administration Server or Managed Server—that you want to control with Node Manager.

WebLogic Server provides two versions of Node Manager, Java-based and script-based, with similar functionality. However, each version has different configuration and security considerations.

Java-based Node Manager: Java-based Node Manager runs within a Java Virtual Machine (JVM) process. It is recommended that you run it as a Windows service on Windows platforms and as an operating system service on UNIX platforms, allowing it to restart automatically when the system is rebooted.

Oracle provides native Node Manager Libraries for Windows, Solaris, HP UX, Linux on Intel, Linux on Z-Series, and AIX operating systems.

Note: Node Manager is not supported on Open VMS,OS/390,AS400,UnixWare/Tru64 UNIX.

Script-based Node Manager: For UNIX and Linux systems, WebLogic Server provides a script-based version of Node Manager. This script is based on UNIX shell scripts, but uses SSH for increased security. SSH uses user-id based security. For information on configuring the script version of Node Manager.

See more details about Node Manager Configuration and Properties

Note: It is recommended that you run script-based Node Manager as Operating System services, which allows to restart automatically when the system is rebooted.This version does not provide as much security as the Java-based version. However, the advantage of the script-based Node Manager is that it can remotely manage servers over a network that has been configured to use SSH. No additional server installation is required. The scripts merely have to be copied to the remote machine.



Administration Server: Admin Server is an instance of Weblogic server. The Administration Server operates as the central control entity for the configuration of the entire domain. It maintains the domain's configuration documents and distributes changes in the configuration documents to Managed Servers. You can also use the Administration Server as a central location from which to monitor all resources in a domain.

Managed server: Apart from Admin Server any weblogic server instance is called Managed server. To prevent the Administration Server from becoming a single point of failure, Managed Servers can always function without the presence a running Administration Server. When a Managed Server starts, it contacts the Administration Server to retrieve its configuration information. If a Managed Server is unable to connect to the specified Administration Server during startup, it can retrieve its configuration directly by reading a copy of the config.xml file and other files located on the Managed Server's own file system.

Cluster: A WebLogic Server cluster consists of multiple WebLogic Server instances running simultaneously and working together to provide increased scalability and reliability. A cluster appears to clients to be a single WebLogic Server instance. The server instances that constitute a cluster can run on the same machine, or be located on different machines. You can increase a cluster’s capacity by adding additional server instances to the cluster on an existing machine, or you can add machines to the cluster to host the incremental server instances. Each server instance in a cluster must run the same version of WebLogic Server.

A cluster is defined as a group of application servers that transparently run a J2EE application as if it were a single entity.  There are two methods of clustering:  vertical scaling and horizontal scaling

Horizontal clustering: It involves running multiple Java application servers that are run on two or more separate physical machines. Horizontal scaling is more reliable than vertical scaling, since there are multiple machines involved in the cluster environment, as compared to only one machine.
 Vertical clustering: However, consists of multiple Java application servers on a single physical machine. With vertical scaling, the machine's processing power, CPU usage, and JVM heap memory configurations are the main factors in deciding how many server instances should be run on one machine

Proxy Server: Proxy Server is an intermediary server between your web browser (client) which requests for some information/data and your server (web server/Application server) that process the data.

Types of Proxy Server: They are three different types of proxy servers. They are as follows

1) Forward Proxy Servers: Forward Proxy Server is a server which forwards the request from the intranet clients (web browser) to the internet servers. These proxy servers are present in the same network of your client.

2) Open Proxy Server: An open proxy is a proxy server which is accessible by any Internet user. Any proxy server that doesn’t restrict its client base to its own set of clients and allows any other client to connect to it is known as an “Open Proxy”. An anonymous open proxy allows users to conceal their IP address while browsing the Web or using other Internet services. They are in numerous open proxy servers present in Internet. For converting any flavor of proxy servers to Open Proxy servers we just have to enable the flag “ProxyRequests On” in the configuration file.

3) Reverse Proxy Server: A Proxy Server which takes requests from external clients (web browsers) or Internet and forwards them to servers in an internal network is called as Reverse Proxy Server. Generally, the reverse proxy servers are present in the same network where we have our App/Web servers.

Advantages of using Reverse Proxy Servers: The various advantages of using the proxy servers are as follows

1)      Filtering

2)      Caching

3)      Bypassing filters and censorship

4)      Logging and eavesdropping

5)      Gateways to private networks

6)      Accessing services anonymously

Fire wall: It provide filtering, autherization& Authentication services.

                  It can act as proxy servers.

      Mapping port requests.

Machine: A machine is a computer that host WebLogic server.

                  A machine runs a supported o.s platform.

Can host multiple WebLogic server instances.



WebLogic server Life Cycle:

Starting state: During the starting state  instances read the domain configuration data from its configuration directory. Whereas the Manager server will get their configuration data from Admin server. It is in this state that the instance the basic services such as the kernel and execute queues, the container service for logging and Node manager service. The server also deploy during this phase.

Stand by: In this state the server Instance will allow you to issue just to administrative requests. You can me the server state either running or shutdown state. Normally the server instance will automatically transition through the stand by state to next stage unless you start the instance with the start in stand by command.

Note: All ports are closed in this stat. But you can quickly transition to a running state.

Admin mode: The admin mode permits only Administrative task, deploying applications with those applications being able to only request from users with the admin and App tester roles. Running a server in admin mode is also useful when trying to diagnose problems with application gone badly.

Note: Servers will run in admin mode when there is problem with deployed application or JDBC connection pool.we can resume the server from Admin state to resume state.

Resuming state: This is purely transitional state the server instance goes through after it transitions automatically through Admin state or you issue the resume command after first placing the instance in the stand by or Admin state. You can do this state change from command line or through the Admin console.

Running state: This is off course final state the server instance reaches after you either issue a start up command or resume command to move the server out of the Admin or stand by state. It is in the running state that the server can accept the service client request for it services.

Click on 
WebLogic Server Installation (Step by step Installation)