Escolar Documentos
Profissional Documentos
Cultura Documentos
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
Select the source from which the domain will be created. You can create the domain by selecting from
the required components or by
selecting from a list of existing domain templates.
->1|Choose Weblogic Platform components
| You can choose the Weblogic component(s) that you want supported in your domain.
2|Choose custom template
| Choose this option if you want to use an existing template. This could be a custom created
template using the Template Builder.
Enter index number to select OR [Exit][Previous][Next]> Next
<- BEA WebLogic Configuration Wizard >
Application Template Selection:
Available Templates
|_____WebLogic Server (Required)x
|_____Workshop for WebLogic Platform [2]
|_____WebLogic Integration [3]
|_____WebLogic Portal [4]
|_____WebLogic Portal GroupSpace Framework [5]
|_____WebLogic Portal GroupSpace Application [6]
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> Next
<- BEA WebLogic Configuration Wizard >
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
| Name | Value |
_|________|_____________|
1| *Name: | base_domain |
Enter value for Name OR [Exit][Previous][Next]> babu
< BEA WebLogic Configuration Wizard ->
Edit Domain Information:
| Name | Value |
_|________|_______|
1| *Name: | babu |
Use above value or select another option:
1 Modify Name
2 Discard Changes
Enter option number to select OR [Exit][Previous][Next]> Next
By Bhramaiah
SAM Technologies
info@esamtech.com
A WebLogic domain already exists at that location. To replace the existing domain, delete it first.
Otherwise, please choose a different
directory.
Enter [Exit][Previous]> Previous
<-BEA WebLogic Configuration Wizard >
Edit Domain Information:
| Name | Value |
_|________|_______|
1| *Name: | babu |
Enter value for Name OR [Exit][Previous][Next]> gbabu
< BEA WebLogic Configuration Wizard >
Edit Domain Information:
| Name | Value |
_|________|_______|
1| *Name: | gbabu |
Use above value or select another option:
1 Modify Name
2 Discard Changes
Enter option number to select OR [Exit][Previous][Next]> Next
< BEA WebLogic Configuration Wizard >
Creating Domain
0%
25%
50%
75%
100%
[------------|------------|------------|------------]
[***************************************************]
**** Domain Created Successfully! ****
To create a domain using the weblogic.Server command:
By Bhramaiah
SAM Technologies
info@esamtech.com
When you are prompted for a username and password, enter any values you choose. You will
be prompted with:
Would you like the server to create a default configuration and boot? (y/n)
java -Dweblogic.Domain=Chicago weblogic.Server
creates a domain called "Chicago".
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
run on the same machine, or be located on different machines. You can increase a clusters 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.(Or)
Group of WebLogic Managed Server Instances that work together to provide high availability and
scalability for applications is called cluster. WebLogic Servers with in cluster can run on same machine
or different machines. These are also called as managed Server cluster.
The Tools for Creating and Configuring a WebLogic Cluster
The primary tools you have available to create or configure a WebLogic cluster are the Domain
Configuration Wizard and the Administration Console. Which tool you use depends on the type of
clustering architecture you want to employ and the capabilities of these tools to support your efforts.
The Domain Configuration Wizard is an excellent tool if you are creating a WebLogic cluster from
scratch. This tool presents you with options on the type of WebLogic domain you want to create. One
such option is a domain with an administration server and one or more managed servers that are
clustered. However, this option creates the administration server and the clustered WebLogic Server
instances on the same single server machine.
The Administration Console is a tool that you can use to configure a WebLogic cluster from existing
managed servers in a domain. For example, if your clustering architecture warrants the clustered
servers to be on separate server machines, the best approach would be to create the administration
server and managed servers independently on each of those machines using the Domain
Configuration Wizard. After the managed servers are created and registered with the domain's
administration server, you could use the Administration Console to graphically configure a cluster from
the existing managed servers.
Guidelines for Configuring Your WebLogic Cluster
Before you start creating your WebLogic cluster, it is worth reviewing the following guidelines for
creating a cluster:
You should try to use DNS names in a production environment to specify the location of the
managed servers that will comprise a WebLogic cluster. The use of IP addresses can result in
IP address translation errors if you are using a firewall to form a DMZ. However, if you do use
IP addresses, they should be permanently assigned to the server machine (static) and not
dynamically assigned.
The WebLogic cluster must have a unique IP address and listen port combination for each of
its managed server instances. The following are some examples:
o If managed server instances in a cluster share an IP address, as in the case of a nonmultihomed single server, a unique listen port number is assigned to each server
instance in the cluster.
Configuring a Cluster Using the Administration Console
This section provides a step-by-step guide showing how you can configure a WebLogic cluster using
the Administration Console. The assumptions for this exercise are that you already have a WebLogic
domain set up with two managed servers, and the network configuration for the WebLogic domain
adheres to the clustering guidelines discussed in the preceding section. The name of the WebLogic
domain, cluster and managed servers, and their network configurations can differ from those used in
the example because the steps to configure the WebLogic cluster still remain the same.
To learn how to set up and configure a WebLogic domain, see "Understanding WebLogic Domains,"
"Creating and Extending WebLogic Domains," and "Configuring the Network Resources for a WebLogic
Domain."
Configure Apache Webserver with Weblogic Server
Step 1) Make sure the Apache server runs on port 8080.( This is because sometimes IIS, or some
antivirus s/w runs on that port).This can be done by modifying the httpd.conf present at
D:\Program Files\Apache Group\Apache2\conf
Modify the Listen port to 8080
By Bhramaiah
SAM Technologies
info@esamtech.com
Listen 8080
Step 2) Copy the mod_wl_20.so from <bea_home>\wlserver_10.3\server\plugin\win\32 to
D:\Program Files\Apache Group\Apache2\modules
Step 3) Add these lines in the httpd.conf file
LoadModule weblogic_module modules/mod_wl_20.so
<Location />
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster localhost:7003,localhost:7005
Debug ON
WLLogFile c:/temp/wlproxy.log
WLTempDir c:/temp
</IfModule>
Step 4) Restart Apache and access the application deployed on the Cluster using
http://localhost:8080/YourApp
This will forward the request to the Weblogic Cluster
You can check the headers sent and received to WLS in wlproxy.log file.
4.What Kind of proxy Servers are using in your project ?what is the configuration file(s)?
Apache HTTP Server or
Configuring SunOne ( iPlanet) Webserver with Weblogic
Step 1). Create a Webserver running on port 8081 using the Admin Console of SunOne.
Step 2). Copy over the plugin present in the following directory
C:\bea103\wlserver_10.3\server\plugin\win\32\proxy61.dll
To the Sun One Installation Directory
C:\Sun\WebServer6.1\plugins\lib
Step 3). Load the plugins by adding the following lines in magnus.conf present in
C:\Sun\WebServer6.1\https-testserver\config
magnus.conf
Init fn=load-modules funcs=wl_proxy,wl_init shlib=C:/Sun/WebServer6.1/plugins/lib/
proxy61.dll
To forward request to a Standalone Server add the following lines to obj.conf file present in
the following directory
C:\Sun\WebServer6.1\https-testserver\config
By Bhramaiah
SAM Technologies
info@esamtech.com
obj.conf
1.
2.
3.
4.
5.
6.
7.
8.
References
What is Thread dump?
Thread Dump is a textual dump of all active threads and monitors of Java apps running in a Virtual
Machine.
When we will take Thread dump? (Scenarios)
By Bhramaiah
SAM Technologies
info@esamtech.com
1. Scenario 1: when server is hang Position, i.e. that time server will not respond to coming
requests.
1.
2.
3.
4.
5.
6.
By Bhramaiah
SAM Technologies
info@esamtech.com
(-m Means print both java and native frames (mixed mode))
5. By Using WLST Script, can contain extension of (.py)
connect(weblogic,weblogic,t3://hostname:port)
cd (Servers)
ls()
cd (AdminServer)
ls()
threadDump()
Execute this Script in console.
What can I Analysis with Thread Dumps?
We need to analyze the thread dumps for analyzing running threads and their states to identifying.
How can I analysis thread dumps?
For analyze thread dumps we have lots of tools to understand easily thread states
1. 1. samurai tool :
(Visit: http://yusuke.homeip.net/samurai/en/index.html)
In this tool you can identify all the Thread states by
Deadlocks and waiting state threads.
More Details:
$ java -jar samurai.jar
After running we will get a Screen like below
Goto Thread dump tab
When Samurai detects a thread dump in your log, a tab named Thread Dump will appear.
You can just click Thread dumps tab to see the analysis result.
Samurai colors idle threads in gray, blocked threds in red and running threds in green.
There are three result views and Samurai shows Table view by default.
In many case you are just interested in the table view and the sequence view. Use the table view to
decide which thread needs be inspected, the sequence view to understand the threads behavior.
You should takecare especially threds always in red.
Actions taken for Issue resolving
1. Classic Dead Locks : Look for the threads waiting for monitor entry
For Example :
ExecuteThread: 95 for queue: default daemon prio=5 tid=0411cf8 nid=06c waiting for
monitor entry [0xd0f80000..0xd0f819d8]
at weblogic.common.internal.ResourceAllocator.release(ResourceAllocator.java:766)
at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:590)
By Bhramaiah
SAM Technologies
info@esamtech.com
Reason: The above thread is waiting to acquire lock on Resource Allocator object. The next step is to
identify the thread that is holding the Resource Allocator object
ExecuteThread: 0 for queue: __weblogic_admin_rmi_queue daemon prio=5 tid=041b978
nid=077 waiting for monitor entry [0xd0480000..0xd04819d8]
at weblogic.jdbc.common.internal.ConnectionEnv.getPrepStmtCacheHits(ConnectionEnv.java:174)
at weblogic.common.internal.ResourceAllocator.getPrepStmtCacheHitCount
(ResourceAllocator.java:1525)
Reason: This thread is holding lock on source Allocator object, but is waiting for Connection Env
object. This is a classic deadlock.
2. Threads in wait() state:
A sample dump:
ExecuteThread: 10 for queue: SERV_EJB_QUEUE daemon prio=5 tid=0005607f0 nid=030 in
Object.wait() [83300000..83301998]
at java.lang.Object.wait(Native Method)
- waiting on <0xc357bf18> (a weblogic.ejb20.pool.StatelessSessionPool)
at weblogic.ejb20.pool.StatelessSessionPool.waitForBean(StatelessSessionPool.java:222)
Reason: The above thread would come out of wait() under two conditions
(Depending on application logic)
1) One of the thread available in the execute queue pool would call notify() on this object when an
instance is available. (If the wait() is indefinite).
This can cause the thread to hang for ever if server never does a notify() to this object.
2) If the timeout exceeds, the thread would throw an exception and back to execute queue thread
pool.
How to set heap size in weblogic?
There are two ways to increase the heap size in weblogic.
If you are using the nodemanager then Login to the weblogic Administration console, then click on
Servers --> ServerName --> General --> Remote Start Options and look for the Java Arguments
Here you can add -512Xmx -512Xms to the java arguments. If you want to increase the heap size
then alter these values from 512 to 1024 depending on your requirements.
If you do not have a nodemanager configured. Login the operating system , Under
$domain_home/bin directory look for setDomainEnv.sh and add the following -512Xmx -512Xms to
the java options.
These changes will require a restart of the JVM.
********************************************************************
By Bhramaiah
SAM Technologies
info@esamtech.com
8.What is perfomance tuning?how do you tune the perfomance step by step process ?Ans
OS Level to our Application Level?
Ans: Performance tuning WebLogic Server and your WebLogic Server application is a complex and
iterative process.
Tuning allows you to adjust resources to achieve your performance objectives.
The following sections provide a tuning roadmap and tuning tips for you can use to improve system
performance.
1. Understand Your Performance Objectives
2. Measure Your Performance Metrics
2.1. Monitor Disk and CPU Utilization
2.2. Monitor Data Transfers Across the Network
3. Locate Bottlenecks in Your System
4. Minimize Impact of Bottlenecks
Tune your DB
By Bhramaiah
SAM Technologies
info@esamtech.com
cd WL_HOME/user_projects/domains/base_domain/servers/AdminServer/data/ldap
rm DefaultAuthenticatormyrealmInit.initialized
7. Startup weblogic server using the newly created admin credential. (enter the info in
boot.properties)
8. Logon to /console with the newly created administrator.
9. Under Security Realms, change the password for the old admin.
10.what are Difference between local and global transactions
A transaction is atomic unit of Work.The tasks which are made into the transaction act as a unit which
can be executed successfully all,or if at least one task fails to its promise ,then the effect of all the
tasks are to be rollbacked.Thus transaction is committed or rolled backed.
Transactions can be divided into two categories.
1.Local Transactions:These transactions are confined to objects which reside inside one particular
JVM.Local transactions in java can be implemented using the JTA api.
2.Global Transactions:These transactions may encapsulate objects which are distributed on various
JVMs.Global transactions are implemented throught TWO-PHASE-COMMIT design implementation.
11.Differnences between Weblogic Server 8.x and 9.x
S no Weblogic Server 8.x
Supports JDK 1.4
The directory structure
Ex : like the config.xml location, cache and
staging folder paths, managed or admin
server paths
By Bhramaiah
SAM Technologies
info@esamtech.com
Supporting
Client-Side Store-and-Forward
1. Stage mode
2. Nostage mode
3. External Stage mode
The following table describes the behavior and best practices for using the different deployment
staging modes.
Staging Mode
Stage
NoStage
Behavior
The Administration Server first
copies the deployment unit
source files to the staging
directories of target servers.
The target servers then deploy
using their local copy of the
deployment files.
The Administration Server does
not copy deployment unit files.
Instead, all servers deploy using
the same physical copy of the
deployment files, which must be
directly accessible by the
Administration Server and
target servers.
With nostage deployments of
exploded archive directories,
WebLogic Server automatically
detects changes to a
deployments JSPs or Servlets
and refreshes the deployment.
When to Use
1. Deploying small or moderatesized applications to multiple
WebLogic Server instances.
2. Deploying small or moderatesized applications to a cluster.
1. Deploying to a single-server
domain.
2. Deploying to a cluster on a
multi-homed machine.
3. Deploying very large
applications to multiple targets
or to a cluster where
deployment files are available
on a shared directory.
4. Deploying exploded archive
directories that you want to
periodically redeploy after
changing content.
5. Deployments that require
dynamic update of selected
Deployment Descriptors via the
Administration Console.
By Bhramaiah
SAM Technologies
External Stage
info@esamtech.com
The Administration Server does
not copy deployment files.
Instead, the Administrator must
ensure that deployment files are
distributed to the correct
staging directory location before
deployment
With external stage
deployments, the Administration
Server requires a copy of the
deployment files for validation
purposes. Copies of the
deployment files that reside in
target servers staging
directories are not validated
before deployment.
1. If you have not already done so, in the Change Center of the Administration Console, click
Lock & Edit (see Use the Change Center).
2.
3.
4.
5.
6.
In the left pane of the Console, under Domain Structure, select the domain name.
Select Configuration > General and select the Production Mode check box.
Click Save, and then, to activate these changes, in the Change Center, click Activate Changes.
Shut down any servers that are currently running. See Start and stop servers.
Invoke the domains startWebLogic script. See Starting an Administration Server with a
Startup Script. The Administration Server starts in the new mode.
By Bhramaiah
SAM Technologies
info@esamtech.com
Production Mode
The default JDK for production domain is JRockit
If you use the demo certificates for SSL a warning is displayed
Auto deployment is disabled
Server instances rotate their log files when it reaches 5MB
Admin Server prompts for username and password during startup
The default maximum capacity for JDBC Datasource is 25
The debugFlag which is used to start the WebLogic Workshop Debugger is disabled
In addition to the above WebLogic Server 10gR3 adds a few more default configurations depending on
whether the domain is started in development or production mode.
1. First, download the your_domain_com.p7b certificate file from your DigiCert Account (from
the My Certificates tab, click the order number, then the blue download link).
2. Run the following command to install the certificate file to your keystore: keytool -import
-trustcacerts -alias server -file your_domain_com.p7b -keystore your_domain.jks You should
get a confirmation stating that the Certificate reply was installed in keystoreIf it asks if you
want to trust the certificate. Choose y or yes.
The installation of this file loads all the necessary certificates to your keystore. Now you just
need to configure your server to use it.
Configuring the Keystore for use in WebLogic
1. On your WebLogic server, expand the Servers node and choose the server you will be
configuring.
3. To enable your new keystore, click the Change link under Keystore Configuration.
4. Choose Custom Identity and Java Standard Trust as your keystore configuration type, then
click Continue.
5. Under Custom Identity Keystore File Name enter the full path to the your_domain.jks file on
your server.
8. You will again be asked to enter your keystore password and confirm.
9. Click Continue, and then Finish.
10. You will now need to go back under the Servers node and select the server you are
configuring.
11. Next, go to Configuration>Keystores and SSL, then click the Change link under Keystore
Configuration.
12. In the Configure SSL page, choose Key Stores as the method in which identity and trust is
stored for the WebLogic server.
13. Specify the Private Key Alias and Passphrase that were used when creating your
keystore.If you followed our instructions or used our command generator, server is your
alias. The passphrase is the keystore password.
14. Click Continue, then Finish.Reboot the WebLogic server. Your keystore should now be installed
and enabled
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
$ tail -n 50 /var/log/messages
This is probably one of the most used command by sysadmins.To view a growing log file and see only
the newer contents use tail -f as shown below.
The following example shows the content of the /var/log/syslog command in real-time.
Syntax: tail -f FILENAME
$ tail -f /var/log/syslog
Changes the permissions of file to be rwx for the owner, and rx for
the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)
chgrp user file
By Bhramaiah
SAM Technologies
chown cliff file
info@esamtech.com
Makes cliff the owner of dir and everything in its directory tree.
cat filename
more filename
Like more, but you can use Page-Up too. Not on all systems.
Edit a file using the vi editor. All UNIX systems will have vi in some form.
Edit a file using the emacs editor. Not all systems will have emacs.
Show the first few lines of a file.
**************************************************************
18. What is there in access log?
The server access log records all requests processed by the server. The location and content of the
access log are controlled by the CustomLog directive. The LogFormat directive can be used to simplify
the selection of the contents of the logs. This section describes how to configure the server to record
information in the access log.
The access log file contains ip address of where the request,Request MethodName,Rquest
URI,Protocol Version Numberand status codes
192.168.1.7[26/aug/2011:8:31:18:18-0600]post/benefits/servlet http/1.1 200 264
192.168.1.7___________ipaddress where the request getting
[26/aug/2011:8:31:18:18-0600]_______time stamp when we get the request
Post_________request method Name
benefits/servlet_______request uri
http/1.1___________http protocol number used by the server
200 264_________________status codes
By Bhramaiah
SAM Technologies
info@esamtech.com
1xx______________Information Message
2xx_____________Indicate success
3xx__________redirecting the client
4xx___________failure due to client
5xx___________failure due to Server
The location of the access file is :
C:\Program Files\Apache Software Foundation\Apache2.2\logs\ access
***********************************************************
19. What is server log in weblogic ?
The server log records information about events such as the startup and shutdown of servers, the
deployment of new applications, or the failure of one or more subsystems. The messages include
information about the time and date of the event as well as the ID of the user who initiated the event.
You can view and sort these server log messages to detect problems, track down the source of a fault,
and track system performance. You can also create client applications that listen for these messages
and respond automatically. For example, you can create an application that listens for messages
indicating a failed subsystem and sends email to a system administrator.
In the left pane of the Administration Console, expand the Servers folder and select the server.
(See Figure 70-8.)
In the right pane, select>Logging >Server.
In the File Name box, enter a path and filename for the server log.
Enter an absolute pathname or a pathname that is relative to the server's root directory. If you use
the Node Manager to start a Managed Server, the root directory is located on the computer that hosts
the Node Manager process. For more information, refer to "A Server's Root Directory."
For information about including a time stamp in the server log's file name, refer to Rotating Log Files.
Click Apply to apply your changes.
Restart the server.
The server writes all subsequent domain messages to the new file.
C:\bea\user_projects\domains\dev_test\servers\AdminServer\logs
Log file name is AdminServer.log00017
Here AdminServer is the name of the Admin Server
C:\bea\user_projects\domains\dev_test\servers\ms2\logs
Log file name
By Bhramaiah
SAM Technologies
info@esamtech.com
*************************************************************
20. Data Source Configuration in weblogic?
Data sources provide Database access and connection management.
Steps to create Data Source :
1.
2.
3.
4.
7. For Test Database Connection , click Test Configuration then Click Next to continue. .
8. Then Click to Finish finally Activate changes.
****************************************************************
21.How to deploy an application through command line ?
open the shell prompt go to
C:\bea\wlserver_10.3\server\bin
And run setWLSEnv.cmd
After use weblogic.Deployer to deploy the application
Syntax :
Java weblogic.Deployer -adminurl <admin url> -username <username> -password <password>
-name <ApplicationName> -targets <target server or cluster> -nostage
-deploy <path of the
source file>
*****************************************************************
22. What is OOM problem/memory leak,how to overcome this problem?
We Recommend These Resources
Permanent Generation
Class information is stored in the perm generation. Also constant strings are stored there. Strings
created dynamically in your application with String.intern() will also be stored in the perm generation.
Reflective objects (classes, methods, etc.) are stored in perm. It holds all of the reflective data for the
JVM
JVM process memory
The windows task manager just shows the memory usage of the java.exe task/process. It is not
unusual for the total memory consumption of the VM to exceed the value of -Xmx Managed Heap
(java heap, PERM, code cache) + NativeHEAP + ThreadMemory <= 2GB (PAS on windows)
Code-cache contains JIT code and hotspot code.
ThreadMemory = Thread_stack_size*Num_threads.ManagedHeap: Managed by the developer.
Java heap: This part of the memory is used when you create new java objects.
Perm: for
relfective calls etc.
By Bhramaiah
SAM Technologies
info@esamtech.com
What you see in the TaskManager is the total PAS, while what the profiler shows is the Java Heap and
the PERM(optionally)
Platforms
1.
2.
3.
4.
5.
Maximum PAS*
2 GB
3 GB
x86 / Win98/2000/NT/Me/XP
2 GB
4 GB
4 GB
If F is the fraction of a calculation that is sequential (i.e. cannot benefit from parallelization), and (1
F) is the fraction that can be parallelized, then the maximum speedup that can be achieved by using
N processors is:
1
------------ Amdahl's law
F + (1-F)/N
In the limit, as N -> infinity, the maximum speedup tends to 1/F. If F is only 10%, the problem can be
sped up by only a maximum of a factor of 10, no matter how large the value of N used.
So we assume that there is a scope of leveraging benefits of multiple CPUs or multithreading.All right,
enough of theory..........can it solve my problem??
A) GC outputs
-verbose:gc
This flag starts printing additional lines to the console, like given below
[GC 65620K -> 50747K(138432K), 0.0279446 secs]
[Full GC 46577K -> 18794K(126848K), 0.2040139 secs]
Combined size of live objects before(young+tenured) GC -> Combined size of live
objects(young+tenured) after GC (Total heap size, not counting the space in the permanent
generation
-XX:+PrintHeapAtGC : More details
-XX:+PrintGCTimeStamps will additionally print a time stamp at the start of each collection.
111.042: [GC 111.042: [DefNew: 8128K->8128K(8128K), 0.0000505 secs]
111.042: [Tenured: 18154K->2311K(24576K), 0.1290354 secs]
26282K->2311K(32704K), 0.1293306 secs]
The collection starts about 111 seconds into the execution of the application. The tenured generation
usage was reduced to about 10%
18154K->2311K(24576K)
B) hprof output file
java Xrunhprof:heap=sites,cpu=samples,depth=10,thread=y,doe=y
By Bhramaiah
SAM Technologies
info@esamtech.com
The heap=sites tells the profiler to write information about memory utilization on the heap, indicating
where it was allocated.
cpu=samples tells the profiler to do statistical sampling to determine CPU use.
depth=10 indicates the depth of the trace for threads.
thread=y tells the profiler to identify the threads in the stack traces.
doe=y tells the profiler to produce dump of profiling data on exit.
C) -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\OOM.txt
Dump the heap on OOM, and then analyze the OOM.txt (Binary file) with jhat tool (bundled with JDK)
The command below will launch http server @port 7777 . Open a browser with the URL
'http://localhost:7777' to see the results.
jhat -port 7777 c:\OOM.txt
By Bhramaiah
SAM Technologies
info@esamtech.com
3. GC parameters:
-Xminf [0-1], -XX:MinHeapFreeRatio [0-100]
sets the percentage of minimum free heap space - controls heap expansion rate
-Xmaxf [0-1], -XX:MaxHeapFreeRatio [0-100]
sets the percentage of maximum free heap space - controls when the VM will return unused
heap memory to the OS
-XX:NewRatio
sets the ratio of the old and new generations in the heap. A NewRatio of 5 sets the ratio of
new to old at 1:5, making the new generation occupy 1/6th of the overall heap
defaults: client 8, server 2
-XX:SurvivorRatio
sets the ratio of the survivor space to the eden in the new object area. A SurvivorRatio of 6
sets the ratio of the three spaces to 1:1:6, making each survivor space 1/8th of the new
object region
Garbage Collector Tuning:
By Bhramaiah
SAM Technologies
info@esamtech.com
1.
2.
3.
4.
Unless you have problems with pauses, try granting as much memory as possible to the
virtual machine
Setting -Xms and -Xmx to the same value .but be sure about the application behaviour
Be sure to increase the memory as you increase the number of processors, since allocation
can be parallelized
Dont forget to tune the Perm generation
Minimize the use of synchronization
Use multithreading only if it benefits. Be aware of the thread overheads. e.g a simple task like
counter incrementing from 1 to billion ....use single thread. Multiple threads will ruin to
mutiple of 10. I tested it out on dual CPU WinXP with 8 threads.
Avoid premature object creation. Creation should be as close to the actual place of use as
possible. Very basic concept that we tend to overlook.
JSPs are generally slower than servlets.
Too many custom CLs, reflection : increase Perm generation. Don't be PermGen-agnostic.
Soft References for memory leakages. They enable smart caches and yet do not load memory.
GC will flush out SoftReferences automatically if the JVM runs low on memory.
StringBuffer instead of String concat
By Bhramaiah
SAM Technologies
info@esamtech.com
XML APIs be careful SAX or DOM- make correct choice. Use precompiled xpaths for better
performance of the queries.
Difference between jdk 1.4 and jdk1.5
Generics: provides compile-time (static) type safety for collections and eliminates the need for
most typecasts (type conversion).
- Metadata: also called annotations; allows language constructs such as classes and methods to
be tagged with additional data, which can then be processed by metadata-aware utilities.
- Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive
wrapper classes (such as integer).
- Enumerations: the enum keyword creates a typesafe, ordered list of values (such as
day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant
integers or manually constructed classes (typesafe enum pattern).
- Swing: new skinnable look and feel, called synth.
- Var args: the last parameter of a method can now be declared using a type name followed by
three dots (e.g. Void drawtext(string... Lines)). In the calling code any number of parameters of
that type can be used and they are then placed in an array to be passed to the method, or
alternatively the calling code can pass an array of that type.
- Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over
each member of either an array or any iterable, such as the standard collection classesfix the
previously broken semantics of the java memory model, which defines how threads interact
through memory.
- Automatic stub generation for rmi objects.
- Static imports concurrency utilities in package java.util.concurrent.
- Scanner class for parsing data from various input streams and buffers.
- Assertions
- StringBuilder class (in java.lang package)
- Annotations
24.How to check the CPU utilization in UNIX ?
Under Sun Solaris UNIX (and other UNIX oses like HP-UX and *BSD oses) you can use following
commands to gather CPU information:
sar : System activity reporter
mpstat : Report per-processor or per-processor-set statistics
ps / top commands
UNIX sar command examples
General syntax is as follows:
sar t [n]
In the first instance, sar samples cumulative activity counters in the operating system at n intervals of
t seconds, where t should be 5 or greater. If t is specified with more than one option, all headers are
printed together and the output may be difficult to read.
Task: Display today's CPU activity, use
# sar
Task:Watching system activity evolve i.e. reports CPU Utilization
# sar -u 12 5
Where,
-u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 times.
Output includes:
SAM Technologies
info@esamtech.com
3. %wio: Percent of CPU running idle with a process waiting for block I/O
4. %idle: Percent of CPU that is idle
Task: You can watch CPU activity evolve for 10 minutes and save data
# sar -o file-name 60 10
Task: You can just sar and logout and let the report store in files
# nohup sar -A -o output-file 60 10 1>/dev/null 2>&1 &
Note to display data stored in output-file pass -f option to sar command:
# sar -f output-file
UNIX mpstat example
Type the following command to display per-processor statistics; 12 seconds apart; 5 times
# mpstat 12 5
You can also use traditional ps and top command:
# top
# ps -e -o pcpu -o pid -o user -o args
***************************************************************
25. How to check the disk space in UNIX?
A quick way to get a summary of the available and used disk space on your Linux system is to type in
the df command in a terminal window. The command df stands for "disk filesystem". With the -h
option (df -h) it shows the disk space in "human readable" form, which in this case means, it gives
you the units along with the numbers.
The du command on the other hand shows the disk space used by the files and directories in the
current directory. Again the -h option (df -h) makes the output easier to comprehend.
Type df -h or df -k to list free disk space:
$ df -h
OR
$ df k
Output:
Filesystem
/dev/sdb1
Size
20G
9.2G
varrun
393M
144k
varlock
393M
procbususb
udev
devshm
393M
393M
393M
9.6G 49% /
393M
393M
123k
1% /var/run
0% /var/lock
393M
1% /proc/bus/usb
123k
393M
1% /dev
393M
0% /dev/shm
************************************************************
By Bhramaiah
SAM Technologies
info@esamtech.com
Node Manageris Weblogic Server utility to start, stop and restartAdministration and Managed Server
Instances from remote location (There are other ways as well to start/stop Weblogic check here Node Manager is optional component).
1. Node Manager Process is associated with a Machine and NOT with specific Weblogic Domain (i.e.
Use one node manager for multiple domains on same machine)
2. There are two versions of Node Manager - Java-based and Script-based
Java-based node manager - runs with in JVM (Java Virtual Machine) Process and more secure than
script-based node manager. Configuration for java-based node manager are stored in
nodemanager.properties
Script-based node manager - is available for Linux and Unix systems only and is based on shell script.
3. There are multiple ways to access Node Manager
- From Administration Console : Environments -> Machines -> Configuration -> Node Manager
- JMX utilities (Java Management eXtension) more here
- WLST commands (WebLogic Scripting Tool)
4.Default port on which node manager listen for requests is localhost:5556, When you configure Node
Manager to accept commands from remote systems, you must uninstall the default Node Manager
service, then reinstall it to listen on a non-localhost (IPs other than 127.0.0.1) listen address.
5. Any domain created before creation of Node Manager Service will not be accessible via node
Manager(even after restarting node manager), solution is to run the WLST command nmEnroll to
enroll that domain with the Node Manager.
6. Any domains created after the Node Manager service has been installed should not have to be
enrolled against the Node Manager. The Node Manager should automatically be reachable by the
domain.
How to Configure Node Manager ?
1.Configure each computer (on which you wish to use Node Manager) as a Machine in WebLogic
By Bhramaiah
SAM Technologies
info@esamtech.com
Server
Environments -> Machines -> New (Add Machine) Use Link here
Environments -> Machines -> Machine Name (created above) -> Configuration -> Node Manager
2. Assign each server instance (Admin or Managed that you wish to control with Node Manager) to
Machine.
Environments -> Machines -> Machine Name (created above) -> Configuration -> Servers -> Add
(Add Server running on this node which you would like to monitor using Node Manager) for more
info Click here
3. Enroll domain (created before installation of Node Manager) to Node Manager
Windows
cd $BEA_HOME\user_projects\domains\<domain_name>\bin
setDomainEnv.cmd
java weblogic.WLST
wls> connect(weblogic,'weblogic, t3://mymachine.mydomain:7001)
wls> nmEnroll(C:\bea\user_projects\domains/<domainName>,
C:\bea\wlserver_<version>/common/nodemanager)
Unix /Linux
cd $BEA_HOME/user_projects/domains/<domain_name>/bin/
. setDomainEnv.sh
java weblogic.WLST
wls> connect(weblogic,'weblogic, t3://mymachine.mydomain:7001)
wls> nmEnroll($BEA_HOME/user_projects/domains/<domain_name>,
$BEA_HOME/wlserver_<version>/common/nodemanager)
where mymachine.mydomain:7001 is the reference to the Admin Server of the domain to which the
server and machine definition belongs
How to start Node Manager ?
$WL_HOME\server\bin\startNodeManager.sh (startNodeManager.cmd on Windows)
How to install Node Manager as Service on Windows ?
Use $WLS_HOME\server\bin\installNodeMgrSvc.cmd (Where default WLS_HOME location is
c:\bea\wlserver_<version>)
To uninstall Node Manager Service on windows use $WLS_HOME\server\bin\uninstallNodeMgrSvc.cmd
installNodeMgrSvc.cmd will create Windows server with name as Oracle WebLogic NodeManager
(C_bea_wlserver_<version>)
.
Important Configuration files
$WL_HOME/common/nodemanager/ nodemanager.properties,
nodemanager.domains, nm_data.properties
$DOMAIN_HOME/config/nodemanager/nm_password.properties
$DOMAIN_HOME/servers/<server_name>/data/nodemanager/ boot.properties, startup.properties,
server_name.addr, server_name.lck, server_name.pid, server_name.state
By Bhramaiah
SAM Technologies
info@esamtech.com
By Bhramaiah
SAM Technologies
info@esamtech.com
echo replies: 82
IcmpMsg:
InType0: 10
InType3: 410
InType8: 82
OutType0: 82
OutType3: 1313
OutType8: 11
Tcp:
8361 active connections openings
6846 passive connection openings
1 failed connection attempts
164 connection resets received
33 connections established
8305361 segments received
6688553 segments send out
640 segments retransmitted
0 bad segments received.
676 resets sent
Udp:
126083 packets received
1294 packets to unknown port received.
0 packet receive errors
130335 packets sent
UdpLite:
TcpExt:
5 packets pruned from receive queue because of socket buffer overrun
6792 TCP sockets finished time wait in fast timer
5681 delayed acks sent
Quick ack mode was activated 11637 times
150861 packets directly queued to recvmsg prequeue.
74333 bytes directly in process context from backlog
9141882 bytes directly received in process context from prequeue
3608274 packet headers predicted
42627 packets header predicted and directly queued to user
77132 acknowledgments not containing data payload received
374105 predicted acknowledgments
2 times recovered from packet loss by selective acknowledgements
77 congestion windows recovered without slow start after partial ack
1 TCP data loss events
17 timeouts after SACK recovery
2 fast retransmits
8 retransmits in slow start
236 other TCP timeouts
1453 packets collapsed in receive queue due to low socket buffer
11634 DSACKs sent for old packets
2 DSACKs sent for out of order packets
2 DSACKs received
77 connections reset due to unexpected data
50 connections aborted due to timeout
TCPDSACKIgnoredNoUndo: 1
TCPSackShiftFallback: 23
IpExt:
InBcastPkts: 4126
Under Solaris and other UNIX variants, the information provided by netstat differs depending upon
the platform. For example, under Solaris, you get detailed statistics for each protocol, and separate
By Bhramaiah
SAM Technologies
info@esamtech.com
information for IPv4 and IPv6 connections (see Listing 9). The output in the listing has been
truncated.
Listing 9. Using netstat on Solaris
$ netstat -s
RAWIP rawipInDatagrams = 440
rawipInErrors
rawipInCksumErrs =
0
rawipOutDatagrams
rawipOutErrors
=
0
=
0
= 91
UDP
udpInDatagrams
udpOutDatagrams
=
=
TCP
tcpRtoAlgorithm
=
4
tcpRtoMin
= 400
tcpRtoMax
= 60000
tcpMaxConn
= -1
tcpActiveOpens
= 1735
tcpPassiveOpens
= 54
tcpAttemptFails
=
2
tcpEstabResets
= 35
tcpCurrEstab
=
2
tcpOutSegs
=13771839
tcpOutDataSegs
=13975728 tcpOutDataBytes
=1648876686
tcpRetransSegs
= 90215
tcpRetransBytes
=130340273
tcpOutAck
=151539
tcpOutAckDelayed = 5570
tcpOutUrg
=
0
tcpOutWinUpdate
= 31
tcpOutWinProbe
= 86
tcpOutControl
= 3750
tcpOutRsts
= 63
tcpOutFastRetrans =
6
tcpInSegs
=7548720
tcpInAckSegs
=2882026 tcpInAckBytes
=1648874900
tcpInDupAck
=4413016 tcpInAckUnsent
=
0
tcpInInorderSegs =415007
tcpInInorderBytes =367832646
tcpInUnorderSegs = 7650
tcpInUnorderBytes =10389516
tcpInDupSegs
= 222
tcpInDupBytes
= 74649
tcpInPartDupSegs =
0
tcpInPartDupBytes =
0
= 15756
= 16515
udpInErrors
udpOutErrors
0
0
In all cases, you are looking for a high level of error packets, retransmissions, or dropped packet
transmission, all of which indicate that the network is busy. If the error rate is excessively high
compared to the packets transmitted or received, then it may indicate a fault with the network
hardware.
30.what is Certificate Signature Request ?
You must submit your request in a particular format called a Certificate Signature Request (CSR).
WebLogic Server includes a Certificate Request Generator servlet that creates a CSR. The Certificate
Request Generator servlet collects information from you and generates a private key file and a
certificate request file. You must then submit the CSR. Before you can use the Certificate Request
Generator servlet, WebLogic Server must be installed and running.
Start the Certificate Request Generator servlet (certificate.war). The .war file is automatically installed
when you start WebLogic Server. In a Web browser, enter the URL for the Certificate Request
Generator servlet as follows:
https://hostname:port/Certificate
hostname is the DNS name of the machine running WebLogic Server. port is the number of the port at
which WebLogic Server listens for SSL connections.
By Bhramaiah
SAM Technologies
info@esamtech.com
For example, if WebLogic Server is running on a machine named Networking4all and it is configured to
listen for SSL communications at the default port 7002 to run the Certificate Request Generator
servlet, you must enter the following URL in your Web browser:
https://Networking4all:7002/certificate
The Certificate Request Generator servlet loads a form in your web browser. Complete the form
displayed in your browser.
Click the Generate Request button. The Certificate Request Generator servlet displays messages
informing you if any required fields are empty or if any fields contain invalid values. Click the Back
button in your browser and correct any errors.
Note: Private Key Password If you don't not specify a password, you will get an unencyrpted RSA
private key. If you specify a password, you will get a PKCS-8 encrypted private key. When using
PKCS-8 encrypted private keys, you need to enable the Use Encrytped Keys field on the SSL tab of
the Server window in the Administration Console.
When all fields have been accepted, the Certificate Request Generator servlet generates the following
files in the startup directory of your WebLogic Server: mydomain_com-key.der-The private key file.
The name of this file should go into the Server Key File Name field on the SSL tab in the
Administration Console. mydomain_com-request.dem-The certificate request file, in binary format.
mydomain_com-request.pem-The CSR file that you submit.. It contains the same data as the .dem
file but is encoded in ASCII so that you can copy it into email or paste it into a Web form.
**********************************************************************
31.What netstat Command ?
netstat is a useful tool for checking your network configuration and activity. It is in fact a collection of
several tools lumped together. We discuss each of its functions in the following sections.
When you invoke netstat with the r flag, it displays the kernel routing table in the way we've been
doing with route. On vstout, it produces:
# netstat -nr
Kernel IP routing table
Destination Gateway
Genmask
Flags MSS Window irtt Iface
127.0.0.1
*
255.255.255.255 UH
00
0 lo
172.16.1.0 *
255.255.255.0 U
00
0 eth0
172.16.2.0 172.16.1.1 255.255.255.0 UG
00
0 eth0
The n option makes netstat print addresses as dotted quad IP numbers rather than the symbolic
host and network names. This option is especially useful when you want to avoid address lookups
over the network (e.g., to a DNS or NIS server).
The second column of netstat's output shows the gateway to which the routing entry points. If no
gateway is used, an asterisk is printed instead. The third column shows the generality of the route,
i.e., the network mask for this route. When given an IP address to find a suitable route for, the kernel
steps through each of the routing table entries, taking the bitwise AND of the address and the
genmask before comparing it to the target of the route.
The fourth column displays the following flags that describe the route:
G ------
By Bhramaiah
SAM Technologies
U ------
info@esamtech.com
H -----Only a single host can be reached through the route. For example, this is the case for the
loopback entry 127.0.0.1.
D ------ This route is dynamically created. It is set if the table entry has been generated by a
routing daemon like gated or by an ICMP redirect message (see the section Section 2.5 in Chapter
2).
M ------ This route is set if the table entry was modified by an ICMP redirect message.
! ------ The route is a reject route and datagrams will be dropped.
33. What is VAMSTAT command in solaris ?
vmstat - report virtual memory statistics
SYNOPSIS
vmstat [ -cisS ] [ disks ] [ interval [ count ] ]
vmstat delves into the system and reports certain statistics
kept about process, virtual memory, disk, trap and CPU
activity. Note: vmstat statistics are only supported for
certain devices.
-c
By Bhramaiah
SAM Technologies
info@esamtech.com
-i
-s
-S
This
By Bhramaiah
SAM Technologies
info@esamtech.com
Authorization
Once the system knows who the user is through
authentication, authorization is how the system decides
what the user can do.
A good example of this is using group permissions or the
difference between a normal user and the superuser on a
unix system.
36. Application is working but DB is not suppoting what kind of exception you will get?
Weblogic.application.ModuleException:
At weblogic.jdbc.module.JDBCModule.prepare<JDBCModule.java289>
******************************************************************
By Bhramaiah
SAM Technologies
info@esamtech.com
This short and sweet article mainly targets to present you on how to enable and disable your admin
console:
Disabling your Admin Console:
We can disable our weblogic admin console in two different ways
1)
Admin console
2)
1.
2.
3.
4.
5.
6.
By Bhramaiah
SAM Technologies
info@esamtech.com
activate()
disconnect()
exit()
40.how to findout the application status using WLST?
connect('weblogic','weblogic','t3://localhost:8001')
domainRuntime()
cd('AppRuntimeStateRuntime/AppRuntimeStateRuntime')
AppList = cmo.getApplicationIds()
print '####### Application ####### Application State\n'
print '***********************************************\n'
for App in AppList:
print '#######',App ,' #######', cmo.getIntendedState(App)
print '***********************************************\n'
41.How to find out the server status using WLST?
username = 'weblogic'
password = 'weblogic'
URL='t3://localhost:8001'
connect(username,password,URL)
domainRuntime()
cd('ServerRuntimes')
servers=domainRuntimeService.getServerRuntimes()
for server in servers:
serverName=server.getName();
print '**************************************************'
print '##############
serverName
###############'
print '**************************************************'
print '##### Server State
#####', server.getState()
#####', server.getListenPort()
By Bhramaiah
SAM Technologies
print '##### Server Health State
info@esamtech.com
#####', server.getHealthState()
*************************************************************
By Bhramaiah