Weblogic Administration Interview Questions
Q: What do you mean by weighted based server instance? How do you configure it?
Ans: The Weblogic Servers in the clustered environment could be routed in 6 ways ROUND-ROBIN,
WEIGHT-BASED, RANDOM and same algorithms with Affinity. Weight is defined as the number of the
requests incoming to a managed server that is default 100. As per the machine capacity and Operating
environments will make you to deside how much weight is suggested on that managed server. We can
control the incoming requests using weights increase or decrease, So, this way we can route all the
request to one of the managed server in the Cluster. This Weight differences can be used when there is
operating environment differences are there.
Q: How to enable EJB available to servlet? asume servlet on apache, ejb on Weblogic cluster.
Ans:Any external access to EJB is not allowed. if the apache webserver already configure as front-end.
then we need to look up by JNDI tree.
Q: What is the silent mode installation file contains root element? When do you require this mode of
installation?
Ans:The root element in silent.xml is <install>This kind of mode usually required in two different
situations.
Situation1 : Weblogic clusters could be installed/implemented only on homogenous environments. If
cluster1 is constructed with MgdServer1, MgdServer2if one server isusing Weblogic 7 environment and
other one on Weblogic 8.1 or higher this is not allowed.
Situation 2: When one huge project is migrated from one physical location to other, Where the
Application specialist must have the similar environment as the Production Server had. To prepare
Development work with similar kind environment we shall install on First system same as Production
Server rest of the developers systems could be installed with silent mode.
Q: What are the basic configuraiton requirements for a Cluster? or
Why do you need multicast address in Clustering?
Ans: The Multicast address is must for clustering, If server instance need to join the cluster it will use
multicast address. The Administrator server handles the web/resource request which is incoming to the
Weblogic server then the admin server will send poll messages for availability to handle the current
incoming request by which member server in the cluster with multicasting. The multicast address should
not conflict with the Network configurations on every member server. The range of multicast IP address
is : 224.0.0.0 to 239.255.255.255.The admin server sends a TTL (Time to Leave) packet,which will
acknowledges the readiness of a managed server. If more than one member server is available then it
will choose the member server with first come first server bases.
Q: What are all the ANT command options?
Ans:To view all options of ant command is simple, just use the following command :
prompt> ant -help
Note: This will work on Unix and Windows too iff PATH is pointing to ant specific jars
Q: What is the ANT version last you used? How to get it??
Ans: I am using Weblogic 8.1 it internally provides ant support which is 1.5.6 version.To get this simply
use :
prompt> ant -version
Q: How do you config eclipse with Weblogic?
Amazon.com Widgets
Ans:Weblogic version wise plug-ins are available for free download sites. Eg: lomboz tool it is a very
simple tool, my experience is that deployment on WL is very few steps required.Just we need to copy
the plug-in extracted to eclipse/plug-ins folder. Here we need to follow the correct J2EE specification for
easy deployments of application.
Q: what is the source to identifying the Connection pool failure? What is the remedy?
Ans: In WL 7/8 to identify the Connection pool failure we have 3 options:
1.The Connection pool hosting Server instance healthchecking by Monitoring tab where we need to find
the idle thread availability.2. Checking in the weblogic log of that corresponding server instance. Usually
we get broken pipe Exception.This could be generated due to overload on connection pool. To resolve
we can tune the execute threads for the corresponding server instance.3. Look for Thread dump and
identify the which thread is doing which task execution?
Q: What is Thread Dump? Why we need it? How do we get it?
Ans:Thread dump concept is used only by Admin users who operates the production server; it is the
dump of the behavior of the WebLogic server instance’s execute threads.When the thread dumps
helpful? If WLS execute threads misbehaving due to following reasonsMaybe you just need more
threads. Maybe you need some of your application to use a different queue. Maybe your application
needs tuning.There is a need of trouble shoots the issues due to various reasons:
1. Requests overloaded
2. Connection Pool fails
3. File cannot read/write for any application (which might be xml file too)
4. Queues are overloaded
or back-end legacy connection issues
Amazon.com Widgets
In windows CTRL + Break , There is another common method to get thread dump:a) Open a cmd window
(in Windows) or shell (in Unix/Linux)b) Set the proper java path and add weblogic.jar to the classpathc)
Run the following command script :prompt >java weblogic.Admin -url t3://host:port -username
weblogic -password weblogic THREAD_DUMP Here please replace with the correct host, port number,
username and password. You can get the thread dump from the standard output.
Best WebLogic (JVM ) Thread Dump analyzer are:
1. Samurai
2. Java TDA
3. Thread Dump Viewer
4. Eclipse lock analyzer plugin
Q: What is the procedure for Queues config? How to make them to free?
Ans:
1. The Queues configuration requires persistence storage which could be a File on operating system or a
DataSource.
2. The queue configuration requires JMSConnectionFactory, JMSServer, jms module Queue or topic as
per the application need
You can created using the Weblogic Administration console or using WLST in latest versions 9.x
onwards.
1. What are deployment descriptors?
Modules and applications have deployment descriptors—XML documents—that describe the contents
of the directory or JAR file. Deployment descriptors are text documents formatted with XML tags. The
J2EE specifications define standard, portable deployment descriptors for J2EE modules and applications.
2. What is the difference in the web.xml and weblogic.xml?
An application-specific XML-based deployment descriptor file named web.xml, which lists your
application's J2EE components and their configurations as J2EE modules. Each J2EE module is a
collection of one or more J2EE components of the same container type (Web or EJB) that are
represented by one component deployment descriptor for that type in the web.xml file.
A WebLogic-specific deployment descriptor file named weblogic.xml, which defines how named
resources in the web.xml file are mapped to WebLogic Server resources. Examples of weblogic.xml
attributes include HTTP session parameters, HTTP cookie parameters, JSP parameters, resource
references, security role assignments, and container attributes.
3. What is the default JVM used for Weblogic?
Sun Hotspot JDK default for Development installation, JRockit is for Production mode for WebLogic 11g
and 12c. Operating environment also factor to select the Certified JDK JVM. If you want to change you
need to specify it.
4. How to change from default JVM to other?
When you upgrade a domain to WebLogic Server 8.1, consider upgrading your JVM to JRockit. WebLogic
JRockit is a JVM designed for running server-side applications in Windows and Linux running on Intel
architectures. For server-side applications, JRockit has these advantages over other virtual machines:
It employs adaptive optimization, which detects and removes bottlenecks in the deployed application.
It is designed specifically for the special requirements of server-side applications, which tend to be
parallel and thread-intensive, to run for longer periods of time, and not to use graphical interfaces.
You can monitor JRockit using the WebLogic Server Administration Console.
Steps to change:
In the server start scripts, set JAVA_HOME (or equivalent) shell variables to point to the JRockit root
directory. For example, change:
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jdk131
where WL_HOME is the WebLogic Server 7.0 installation directory, to
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jrockit81_141_02
where WL_HOME is the WebLogic Server 8.1 installation directory.
Change the domain’s config.xml to use the JRockit javac.exe. For example, change
JavaCompiler="WL_HOME\jdk131\bin\javac"
where WL_HOME is the WebLogic Server 7.0 installation directory, to
JavaCompiler=WL_HOME\jrockit81_141_02\bin\javac”
where WL_HOME is the WebLogic Server 8.1 installation directory.
Remove from server start scripts any switches specific to the Sun JVM. For example, from the start
command:
echo on "%JAVA_HOME%\bin\java" -hotspot .... weblogic.Server delete “-hotspot”.
5.How to make a managed server?
v Backup the configuration by rename config.xml with config.xml_date
v Configure the changes in the startManagedWebLogic.sh /cmd with weblogic home and java
home and give the admin severs URL updated
v Go to weblogic admins console and add a managed server and give the IP and port of the
managed server. all the changes confirmed then start the server using
startManagedWebLogic.sh script present in the domain bin.
6. What is a license file?
http://support.bea.com/application_content/product_portlets/support_patterns/wlplat/LicensingPatte
rn.html
now you need to register with Oracle Support ID to get updated license xml file.
7. How to configure a DB connection pool?
Choose the DB type (Oracle, Sybase, Mysql, etc...).
Then choose the driver type for the DB.
Give the connection pool name.
Give the DB Service ID, schema name and password.
Then it will ask for testing the connection pool/DataSource.
After successful connection, it will ask you to create and deploy the connection pool target
to server or cluster. After creating new connection pool always point the jdbcstore to the
connection pool created. This is required because A JMS JDBC store will be used for persistent
messaging.
After each JDBC connection, we have to restart the server if there is startup classes dependancy
exists otherwise no restart required in WebLogic 9.x and higher versions.
8. What are the modes of operation for Weblogic server domains?
There are two modes: Development and production mode:
Development mode:
1. You use development mode while you are developing your applications. Development mode
uses a relaxed security configuration and enables you to auto-deploy applications.
2. You can use the demonstration digital certificates provided by the WebLogic Server security
services. With these certificates, you can design your application to work within environments
secured by SSL.
3. WebLogic Server instances can automatically deploy and update applications that reside in the
domain_name/applications directory.
4. When you start a server, the server automatically renames (rotates) its local server log file as
server-name.log.n. For the remainder of the server session, the server rotates its local log file
whenever the size of the file reaches 500 kilobytes.
5. The default number of threads available to Execute Queues is 15.
The default capacity is 15 JDBC connections.
Production mode:
1. You use production mode when your application is running in its final form. A production
domain uses full security and may use clusters or other advanced features.
2. A warning message is displayed if you use the demonstration digital certificates.
3. The auto-deployment feature is disabled, so you must use the WebLogic Server Administration
Console or the weblogic.Deployer tool.
4. A server rotates its local log file after the size of the file reaches 500 kilobytes.
5. The default number of threads available to Execute Queues is 25.
6. The default capacity is 25 JDBC connections.
9. What is JNDI?
Java Naming and Directory Interface
Applications use naming services to locate objects data sources, EJBs, JMS, MailSessions, and so on
within the WebLogic domain. A naming service associates names with objects and finds objects t3
protocol will be used. (The RMI registry is a good example of a naming service.)
JNDI provides a common-denominator interface to many existing naming services, such as LDAP
(Lightweight Directory Access Protocol) and DNS (Domain Name System). These naming services
maintain a set of bindings, which relate names to objects and provide the ability to look up objects by
name. JNDI allows the components in distributed applications to locate each other.
The WebLogic Server implementation of JNDI supplies methods that:
Give clients access to the WebLogic Server naming services
Make objects available in the WebLogic namespace
Retrieve objects from the WebLogic namespace
10. How to configure JMS?
Ø JMS (Java Message Service) is a standard API for accessing enterprise messaging systems.
Specifically, WebLogic JMS:
Ø Enables Java applications sharing a messaging system to exchange messages.
Ø Simplifies application development by providing a standard interface for creating, sending,
and receiving messages.
Ø Using the Administration Console, you define configuration attributes to:
1. Create JMS servers and target a WebLogic Server instance or a Migratable Target where the JMS
server will be deployed.
2. Create and/or customize values for JMS servers, connection factories, destinations (queues and
topics), JMS templates, destination sort order (using destination keys), persistent stores (file or JDBC),
paging stores, session pools, and connection consumers.
3. Define message and/or bytes thresholds and quotas, as well as a maximum allowable message size on
your JMS servers, destinations, and templates.
Enable any desired WebLogic JMS features, such as:
Server clustering using multiple connection factories.
Ø High availability and load balancing for destinations across a cluster by using distributed
destinations.
Ø Persistent messages and durable subscribers.
Ø Paging out message bodies during peak load periods to free up memory.
Ø Controlling message flow during peak load periods, including blocking message producers.
Ø Establishing a message expiration policy to ensure that expired messages are cleaned up
immediately.
Ø Preventing message quota errors by temporarily blocking message producers from sending
messages to a destination when it exceeds its specified maximum message quota.
Ø Concurrent message processing via session pools.
Oracle WebLogic 11g Server Interview Questions You'll Most Likely Be Asked
11. What is a domain template?
A domain template is a jar file default one is wls.jar file, which is
'/bea/weblogic81/common/templates/domains/, it has all the features that is required for the standard
weblogic domain, we can even create domain template of our own configuration. by this template we
dont have to configure every time we create a new domain.
By using template we can:
Create servers.
Clusters.
Machines.
Configure services such as JMS, JDBC, Applications
12. What are the Admin Default ports?
The non-SSL listen port for the Administration Server's default network configuration is 7001 by default.
The SSL listen port for the Administration Server's default network configuration is 7002 by default.
WebLogic Admin servers and Managed servers could communicate with Admin port which is separate
network channel. So that other communications can be run on different networks.
13. What are Weblogic clusters?
A WebLogic Server cluster consists of multiple WebLogic Server 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.
Benefits of clustering:
Scalability:
The capacity of an application deployed on a WebLogic Server cluster can be increased dynamically to
meet demand. You can add server instances to a cluster without interruption of service, the application
continues to run without impact to clients and end users.
High-Availability:
In a WebLogic Server cluster, application processing can continue when a server instance fails. You
"cluster" application components by deploying them on multiple server instances in the cluster, so, if a
server instance on which a component is running fails, another server instance on which that
component is deployed can continue application processing
1. Can you give the deployer utility syntax?
The syntax goes like this:
$ java weblogic.Deployer -adminurl http://admin:7001 -name appName -source /myapp/appName.ear -
targets [serverList] [-activate or other options]
2. How do you install Apache web server in UNIX and windows?
You will get a binaries for Apache website and you compile and build with the 4 steps
a. Extract the compressed file
b. Execute configure.sh file from the extracted folder
c. make
d. make install
http://wlabypani.blogspot.com/2009/11/apache-installation-configuaration.html
3 What is Oracle SID in Database?
It is a Service ID in Oracle database, that we need to use in configuring JDBC Connection pool.
4. What is listener in database?
In Oracle listener is that which is associated with a SID and host, port. It is configured in the
tnsnames.ora file. You can verify it by tnsping command.
5. What are the tuning techniques you applied?
Tunning for JVM - chanigng -Xmx, -Xms, MaxNewSize, MaxPermSize, and if required GC algorithms
Tuning in Threads/ThreadPool -- Defining Workmanager with maximum constraint
Tuning TCP/IP connections Interface address, backlog count,
Tuing JMS -- changing queue sizes as required
Tuing JDBC - initial count, maximum capacity, increase by number of connections
6. How do you troubleshoot if config.xml file will be deleted
First we look for is there any last good backup of configuration is availble on the Admin machine. If it is
not found then alternatively you can find it on remote machines where the managed servers running.
Best practice is whenever there is a configuration changes made before and after you need to take a
backup.That will help you such situation where you might need old configuration sometime.
7. How do u trouble shoot if managed server is in FAILED state?
If any managed server is in FAILED state there could be reasons as follows:
i) deployment failed
ii) JDBC DataSource issue
iii) JMS configuration issue
8. How to monitor webLogic using WLST?
First you need to connect to the adminServer. then you can use any Runtime MBean.
Using WLST we can monitor various Runtime MBeans such as ThreadPool, JVM, JDBC ConnectionPool,
JMS Server and Server Life Cycle for state of a WebLogic server instance.
9. Can you explain about bea guardian?
Gaurdian is only helpful when you have GUI. It is enables that all new patches available on Oracle site
can shown in the right downside corner shows.
10.What are monitoring tools you know?
There are wide varieties of monitoring tools available, such as:
a. HP-OVO
b. Introscope Willey
c. Patrol
d. Mercury and many more...
11. What are the difference between Connection pool and data source?
ConnectionPool is physically connects to the Database. where as Data Source is a logical resource that
can be used by developer or any other resource for accessing Connection of pools.
DataSource can be associated with JNDI name that is used for lookup from from any other client.
12. What are the difference in WebLogic 8.1 and 9.x?
Side by side deployment introduced in WL 9.x
deployment descriptors
JDK support 1.4 and 1.5 respectivly
console Look and feel changed Cuncurrent access is controlled with Change center 'Lock and Edit' ,
'Activate Changes', 'Undo All chnages' buttons.
ConnectionPool is included in DataSource configuration part.
JMS Uniform distributed destination is reduced configuration side.
JMX version change 1.2 so the MBean accessing methods simplified.
13. What is JMS and how do you configure it?
Java Messaging System it is a API supported by J2EE application server for messaging between diffent
resources. it can be used by MDB (Message Driven Beans). First you need to configure JMS System
resource, JMS module consists any one out of PTP, publisher/Subscriber type
14. What is cluster and how do you configure?
Cluster is a group of managed servers.
Using console
Usning WLST
You need to provide the Multicast address, Multicast port, Cluster Address which is nothing but the
listen addresses, listen port of all managed servers need to group together.
15. What is the use of multicast address?
In a WebLogic domain to broadcast the heart beat message to all cluster members. TTL will be send to
the multicast address, to this address all the cluster members are subscribers. If one of the Server
crashes that can be notified by all other members by missing 3 times heart -beat. So that secondary
server will takeover the request and start working with the replication data.
16. How to get thread dump and what the purpose of stuck thread?
Get the java process id, you can get it by jps or customized script for it.
kill -3 pid for unix env.
Ctrl+break for windows env.
When there is a Stuck Thread need to monitor the log for few minutes some times 2 or 3 stuck threads
hogging but after sometime it will be unstucked. If you take multiple thread dump for every 5 sec gap
and analyse with sumarai or Java Thread Analyzer tool you will get to know why it is stuck what is
causing the instances to mis behave that time.
17. What is nmenroll in WLST?
The nmEnroll() method is used for enroll the machine with the weblogic domains running on that. It is
name and its path.
the Nodemanager always get the domain information from the Administration server provided that it
should have enrolled in that machine.
18. Tell about ant scripts?
You can ANT Scripts are mostly used for deployment process in development environtments.
ANT can be used to
1. start WebLogic Server
2. deploy the application
3. Configure a single WebLogic server
4. invoking WLST script
19. Types of load balancing techniques and differences b/n them
There are Hardware loadblancer, Software loadbalancer BIG IP F5 is most leading load balancers in use.
Again the Software loadbalancing CMS, CSS Context Switch Servicing
Basically Load balances uses Round robin method to its connecting Webservers.
Plrease ref wikipedia.com for more details.
20. What is the important configuration file in apache?
The Apache configuration will be defined in the httpd.conf, if required segrigated weblogic.conf file can
be created.
SSL enable sites requires httpsd.conf
21. How do you provide load balancing?
In WebLogic Cluster side we have 3 basic types and each supports Affinity based also.
I) Round Robin
ii) Random
iii) Weight based
22. Why Data source is not there in Weblogic 9?
I just wonder about this question!! It is there under jdbc link
23. When do you use vi editor?
In UNIX environments we have vi editor for creating new file which can be shell or python or jython or
plain file.
I - insert mode
Esc - to come out of the mode
r - replace char
a - append to the line
O - insert above line
o - insert below line
dw - delete word
dd - delete line
x - delete char
/ - search a pattern
:set nu setup numbers etc...
24. What type of shell scripts you have created?
There are many bash scripts whihc I had developed
i) Finding a pattern in all log files.
ii) instance name assciated with PID
iii) Heap dump
iv) Multiple copy for produciton Code move
v) Many DB related scripts
vi) Log archiving scripts
vii) Daily DTS Collector scripts
25. What type of wlst scripts u have created?
WLST scripts
I) Thread Monitoring script
ii) JVM monitoring
iii) JMS monitoring
iv) DataSource monitoring
v) Site wise, Server wise, Domain wise scripts
26. How to test the port is existing or not in unix?
On the UNIX you can give the following command
netstat -na |grep <port>
Interview happen at NESS Technologies, India 2009
1. When do we go for jdrivers and XA drivers?Advantages?
This question is focused for weblogic Architect/developers. This choice is depends on the application if it
is having more transaction with Database requires reliable connections with the DB, more Entity Beans
on the ejb-tier then we need to choose JDriver when JDO is in application side. Transactional
consistency is mandatory for the application and response time is no matter then we choose XA.
2. Is there any disadvantages of using machines in cluster configuration?
Yes, If Weblogic domain not using the feature of NodeManager then it is a useless configuration.
3. What happens if we delete the log files when the server is running & when the server is not
running?
Better option is to NULLify the content of the log after archiving the logs. Nothing happen when we
delete a WebLogic server log files, When server is RUNNING, new logs will be generated w.r.t Server
instance and application logs depends on log4j.properties.
New loggging will be written if the file exists. It will always do appending to the log file. If the file is
removed then no appending happens. So that you don't know what is happening to the Server instance.
The other case, When NOT RUNNING not new log generated :)
4. Can we change the name of the log files?
When we want to change the log file names while running. If we change at run time WebLogic will
creates new log file again.
Using WLST, specifying logger with edit, save we can change it in the domain level also. Ref:
Unnikrishnan pillai blog.
5. What is the actual procedure of the application deployment in realtime? Basic reqiurement?
If there is no deployment tools in use then no-stage mode is preferred for production. Application code
will be deployed when target managed server is restarted. Admin server need not to copy the code to
remote machine. But you need to place the code in the code directory.
Production Redeployment can be done with weblogic.Deployer command also.
Latest version prefers to use deployment plan.
Realtime in the sense development or in Production? If it is Development procedure is simple we can
use hot deployment.
the number of components of the application are scheduled in sequance of deployment order.
for entity-ejbs some times requires restart of the server.
6. Why datasources ,JMS need JNDI?
JNDI is a light weight directory which is used to lookup from other resources. Entity EJB lookup for
DataSource, Message Driven
Beans lookup for JMS. Servlets, JSP web compoents lookup for JDBC connections for few actions. which
is not recommmend in real time.
7.Benefits of jRockit over jdk?
JRockit JVM strongly built with Aspect of Programming, POJO
JRockt don't have separate class loading in JVM space. Sun JDK JVM have a dedicated memory space for
it, that is PermSize.
JRockit performance is good once it is in RUNNING.
Sun JDK is faster than JRockit at launching time.
GC options are varies in both.
Please visit: http;//wlabypani.blogspot.com
8.What is Bootup Process?
StartWebLogic.sh script flow need to explain...
CLASSPATH
MEMARGS
GC parameters
to start the weblogic.Server class
check authentication if user, password given script takes from it. if not
check for boot.properties
Domain bootup process is like this...
Admin Server -> EJB TIER servers -> Web - Tier
9. How do u identify weblogic health in production?
Main Threads...
checking ThreadPool state for the WebLogic instance.
This depends on the client capacity ... if Client is willing to spend much on monitoring no downtime then
Introscope,
HP-OVO some more tools are available. for me I m using WLST for JVM, Idle, Hogging thread count
program which I had published in my blog.
10. What are the action to be taken when server is crash ?core file is not genetated what to do?
if sever is crash u cannot do anything after words :) if u got alerts you can managed to get Heapdumps as
you told.
reason pstack, jmap, pmap requires process id.
If third party package installed in Solaris then you can use dbx command for further investigation.
In solaries we use pstack and pmap command to take long stack and to find which thread library causes
the problem instead of using debbuger.. For linux is there any command that do the same tasks..pmap
is working in linux but there is no pstack command..after a long search i found one command which is
equal to pstack ...i.e lsstack ( equal to pstack).. but it is not working...
11. Difference between Weblogic previous 8.1 and 9.2 above versions such as ,10.3?
This you can ans only when you read release notes of each one.
already given weblogic interview questions 3
WLS Management from 6.0 to 8.1 WLS Management from 9.0 & above
Proprietary Remotable APIs to access
MBeanServer
Standards based, JSR 160. Deprecated MBeanHome &
RemoteMBeanServer
One MBeanServer, hosted all MBeans 4 MBeanServers, each MBS hosts MBeans depending on
functionality
Non schema based config.xml Schema based config.xml
Many broken links in MBean hierarchy All MBeans completely Linked, making the hierarchy
traversable
MBeanHome - Factory for creation/deletion
of all MBeans
Each parent MBean serves as a Factory to create/delete its
Child MBeans
Configuration change mechanism is atomic Introduction of transaction semantics to configuration
change
No control over configuration changes and
often unpredictable
Need a lock on configuration to make a change, more
control (can undo changes, stop edits etc)
AdminMBeanHome provided the federated
view of the Domain
DomainRuntime MBeanServer provides the federated view
of the Domain
CommandLine administration via
weblogic.Admin Deprecated weblogic.Admin, introduced WLST
WebLogic Domain Name in MBean's
ObjectName, ex:
mydomain:Name=myserver,Type=Server
Changed to com.bea, ex:
com.bea:Name=myserver,Type=Server
config.xml represented all WLS
configuration
{domain_dir}/config directory represents WLS
configuration i.e config is spread across multiple xml files
(JMS, JDBC & WLDF config in different files)
None Service MBeans to get to the root Mbeans
Execute Queues control Thread pool control Work Manager gives more effective and efficient Thread
pool control, like JVM crash can be controlled,
Welogic console combination of Applet and
webpage less in synchroniztion, no
possibility to extention of console.
New WebLogic console in Portals and easy to extention of
the console
No that much integrated Newly introduced webLogic Diagnostics Framework WLDF
is more useful for diagnostics
At a time single version archive is allowed Deployment can be done with application version wise
for deployment from commandline
JMS only two types JMS new types introduced for more flexibility Store and
Forward (SAF), distributed destination
Domain Templates are excellent feature for creating
multiple domains for a development.
Node Manager can start even Admin Server and the
commands can be given from WLST
12. What is Tivoli?why we use?How it works?
Tivoli is a IBM product for profiling tool WebLogic was having similar tool Merqury.
13. In order to see last 20 files what is the command?
At your Unix prompt you can give as follows:
ls -lrt | tail -20
14. In order to see last 20 days files what is the command ?
Simple way is using find command with ctime option and specify days signs +20
Custom Search
15. If SSL certificates are expired what to do?
Two options:
1. Using temporary demo certificates.
2. Get new renewal from CA(Certifying Authority) like verisign.
16. How to select where and which driver we have to use?
This is a typical question. This is obsolutely depends on application context.
Major impacting factors
i) load capacity number of connections
ii) Application contains PreparedStatements, CallableStatements preferable is OCI if it is Oracle. (DB
vendor specific driver)
iii) Thin Driver is preferable for certain number of connections only. But is most widely used with Oracle
RAC and Grid databases.
17. How to monitor the incoming traffic for webserver?
HP OVO, Patrol, access logs of web servers. By looking in the access logs of the web-server.
18. How to find network outages in environment?
Basically ping command will give required output if not outage can be predictable, In WebLogic instance
to instance inter-communication breakage will be indicated by BEA-000117 error code.
netstat -na |grep using port can be used for identifying the instance is responding or not.
19. How you will analyse threads state using samurai tool?
By getting the Thread dump for the impacted WebLogic instance. Normally, thread state could be
ACTIVE, STANDBY, STUCK, If the state is same for many thread dumps then need to check about that
thread.
Check for the 'wait', 'lock' keywords with find option, verify how the threads impacting, does it leads to
dead-lock? It is GUI tool which clearly shows in RED color which are the impacting threads in wait state.
20. Basic requirement for datasouce and connection pools?
Amazon.com Widgets
The Basic need for Connection Pool and DataSource are:
1. connection to the adminserver
2. JDBC Driver name, connecting parameters such as DataSource name, DATABASE schema details
(user,password, hostname, port, SID)
3. Target the connection pool to a 'server' or 'cluster'.
4. Finally verify the connection pool by testing it.
What is the difference between TRUNC and DELETE in SQL commands?
TRUNC
faster
dependent tables cannot work
DELETE
slow
row-by-row
cannot applicable for large tables
http://www.softstuff-consulting.com/kbase/showkb.asp?id=15
Amazon.com
Hi All, This is my first experience of attending the WebLogic System Administrator Interview. Here I am
going to share with you, it was held at Verizon.
1. Explain your work at Current Organization ?
I had responded to this keeping in a brief description of Middleware Administration activities... This is
common and general question by the interviewer, explained the work that I have been performing at
current project. Like WebLogic Installation, Domain creation, Deployment, Clustering, Trouble shooting
activities etc.
I said that I am good at Shell Scripting.
2. What is the first line in Shell Scripting ?
Ans: Shebang (#! /bin/sh) It is an interpreter directive to the program loader.
3. Give some examples of Unix commands like top, netstat etc.,
These commands are discussed in previous interview questions already so here I am leaving it for
navigate :)
4. What is the major configuration file in WebLogic ?
Ans: The WebLogic whole configuration stored into a repository file Config.xml in config folder present
in the domain directory.
5. What is error 404 and error 500 ?
Ans: These are the common issues encounter when web application have trouble. The error code 404 -
Page not found this says there is no page on the server when browser client requesting, this can happen
when application is not deployed properly or not in active state.
500- Internal server error This error occurs when there is a communication issue between server's
intermediate services
6. How many Administration servers and managed servers should be there?
Ans: In a WebLogic domain there must be a single Admin server and there can be as many as managed
servers as per the need and capacity limitations of the environment.
7. Difference between weblogic 9.2 and 11g ?
Ans: The major differences are
* JDK Version support WebLogic 9.2 supports JDK 1.5, whereas WebLogic 11g supports JDK 1.6
* More control provided in the Change Center of the Weblogic 11g console
* SAF feature is added in the JMS server for WebLogic 11g
* More focus given for hot deployment and deployment strategies : production pre-deployment
strategy, Production re-deployment strategy with weblogic.Deployer utility and also available in WLST.
What do you mean by hot deployment, clustering, Unix processes and commands were also asked.
Thank you,
Kishore.
https://sites.google.com/site/weblogicadminsite/weblogic-issues/weblogic-interview/WLA-Interview-
Questions--2
http://weblogicserveradministration.blogspot.in/2012/10/weblogic-interviewquestions.
html
Stay tuned for the answers of all questions and for many more questions :)
What is admin server ? what is the difference between admin and managed server ?
Admin server is the central domain configuration interface which is used to create,delete and
configure the resources of a domain like managed server, machine, cluster, data source, work
managers etc.
There is no difference between Admin and Managed server except admin interface application
by default deployed on admin server which is used to configure the domain resources. Apart
from that a admin server is same as a managed server, you can deploy and create other relative
resources on admin server also as you do on managed server.
How to access admin console ?
ssl enabled admin console accessed as :
https://<hostname_or_ip_address_where_admin_server_running>:<port_on_which_admin_se
rver_is_running>/console
Example - https://localhost:7001/console
non ssl admin console accessed as :
http://<hostname_or_ip_address_where_admin_server_running>:<port_on_which_admin_ser
ver_is_running>/console
Example - http://localhost:7001/console
Note : - By default weblogic admin server configured on port 7001 and SSL is not enabled.
How to check pid of a weblogic server ?
To check the process of a particular managed or admin server you can use
ps -ef | grep -i <name_of_your_admin_or_manager_server>|grep -v grep
( grep -v grep will suppress your command in the output )
Example -
ps -ef|grep -i wci_m1|grep -v grep
Above command will show you the process details of managed server with name wci_m1 from
where you can get process id, see output below, here process id is 32121
some people use
ps -ef|grep -i "weblogic.Name=wci_m1"|grep -v grep
both are same, you can use anyone
To check process id of weblogic server on window
On Window, you can go to task manager, under view tab select column option, select PID
option.
How many admin consoles possible in a single domain ?
only one.
What is the default port of admin server ?
7001
What is config.xml ?
config.xml is the central configuration repository for a domain. every resource you have
configured from admin console or by command line or by any other tool registered under this
file.
WLS 9.x onwards, this file contain references to other xml configuration files also those are
under your domain/config folder ( further sub folder under it for respective resources ) since
wls 9.x onwards concept of modules are introduced for sub resources like data source, jms etc
otherwise prior to 9.x ( 8.x or older ) every configuration was stored under this single config.xml
file.
What is boot.properties file ?
boot.properties is the file used by admin or managed server during startup for username and
password. it exist under your domain/servers/server_name/security folder.
( Below information is for some advance users )
To specify a customer directory for this file you can use
-Dweblogic.system.BootIdentityFile=[location]/boot.properties
When you create a domain in development mode then it creates automatically during startup
of admin server but if you create a domain in production mode then you need to define
it explicitly otherwise on every reboot of admin server it will prompt you for username and
password.
So in production mode -
Start admin server by manually passing the username and password
stop it ( press cntrl+c on the started session )
go to your domain/servers/your_admin_server/
create a folder "security"
go inside security and create a file "boot.properties" with below contents
username=your_admin_username
password=your_admin_password
now start the admin server, it will not prompt you for username & password further.
If you are going to start your managed servers from admin console then no need to create this
file for managed server but if you are going to start managed servers via startManagedweblogic
script then you need to follow the same above procedure for each managed server.
How to start admin and managed server ?
check my blog page http://weblogicserveradministration.blogspot.com/2010/10/start-stopweblogic-
servers.html
What is node manager ? what are the benefits of node manager ?
How to set classpath ?
What is weblogic.jar file ?
What is cluster ? what are the benefits of a cluster ?
What are the different cluster algorithm and difference between them ?
What is cluster address ?
What is Multicast ?
What is unicast ?
Whart is the difference between multicast and unicast ?
What is the difference between vertical and horizontol clustering ?
What is JMS ?
What is a JMS server ?
What is SSL or what is the purpose of SSL ?
How to deploy an application ?
What are different staging modes and differences between them ?
What are the different forms of weblogic deployment files ?
What are the difference between jar, war and ear files ?
What is the difference between web.xml and weblogic.xml ?
What is virtual host ?
What is a machine ?
What is JNDI ?
What is t3 or functioning of t3 ?
What is MSI mode ?
What is connection pool ?
What is data source ?
What is the difference between Data Source and Multi Data Source ?
What is heap and how to define max and min heap size ?
what is the difference between heapdump, memorydump and thread dump ?
What is the impact on Managed server if admin server goes down ?
Is that possible to start Managed server if admin server is not running ?
How to change the weblogic password ?
What are deployment descriptors ?
What is autodeployment ?
What is exploded form of deployment ?
What is the difference between production and development mode ?
What are the differences between weblogic 10g and 11g versions ?
How to configure apache with weblogic ?
What are startup and shutdown classes ?
What is session replication and how to enable it ?
What is MBEAN ?
What is the difference between .out and .log file ?
Keywords : weblogic server interview questions, weblogic interview questions, weblogic
interview questions blog, weblogic interview questions, weblogic Administration interview
questions, Weblogic interview questions and answer, Weblogic Interview Questions & Answers
Q1) If we have only 10 users for a particular application, can Admin server do the job of
Managed server?
Ans: Yes, but generally Admin server is not used to deploy any application.
Q2) Does Admin server directs( distributes) end user requests to Managed servers?
Ans: No. Request from Load balancer go directly to Managed server. Admin server doesn’t
interfere in end user requests.
Q3) If Admin server goes down, what will happen to end user requests?
Ans: Nothing. As they are responded by managed server, even if Admin server goes down, end
user request will continue.
But the moment Managed server need to contact Admin server for any info, and it find Admin
server not available, managed server will go in INDEPENDENCE MODE. It is not good and
centralized config.xml is not maintained. So, for 15-20 min, even if Admin server went down,
request will run.
Q4) If in adomain, only one server is there, it is Admin server or manager server?
Ans: Admin server
Q5) How the know if the weblogic server running is Admin server or Managed server?
Ans: 1. $ ps -ef|grep -i weblogic.server
or ps -ef|grep -i java
Managed server have “Dweblogic.management.server=<admin url>” in the parameter
provided.
Admin server doesn’t have it.
2. From config.xml
3. From Admin console
Note: i. to find which values are passed to server and what to JVM, here is the way
starting witrh D –> parameter and value passed to weblogic server
starting with X –> parameter and value passed to Java/ JVM
- See more at: http://www.weblogicbeginner.com/weblogic-interview-questions-
1/#sthash.S0GOWsng.dpuf
1. Questions in an interview are mostly based upon 2 things.
i. what you say … like your answers to questions like
Tell me something about yourself ?
What is your daily activities/responsibilities?
OR your answer to any other technical question.
ii. What is the need of the team you are giving the interview?
If they just want someone who can do simple routine activities , then probably interview
questions will be very simple and basic questions will be asked, but if they want someone in
very responsible position technically, then as expected , it will be tough. Many times,
companies employ external consultant to do this mission critical interviews.
90% of interviews lies somewhere in between these two extremes.
Don’t worry. They are also human beings. No body knows everything. What is more important
is interest to learn and determination to win. Problem solving and never say die.. attitude is
most important in software industry whether it is technical problem or man-management
problem.
Cheers!!!
*************************************************************
Q1) What is your database for Weblogic server (WL) or what is the default database for WL
server?
Ans: Point base is the default database for WLS. It comes with Weblogic software bundle. But,
we can implement any database oracle, DB2, point base etc…
Q2) If my admin server is not available, can i still start my managed servers for that domain?
Ans: Yes
Lets understand this. Admin server,Managed servers all are JVM. All can start/stop
independently. Only thing is we cannot change servers configuration until Admin server is
available. It is called Independence mode. It is not a advisable one, though.
Q3) If my database becomes unreachable or get restarted, will connection pool still stick
around?
Ans: Yes
It is independent of its ability to communicate with DBMS. All the connections in the pool may
become defunct, but the connection pool exist.
Q4) Can you tell difference between JMS topic and JMS queue?
Ans: Queues delivers messages to one consumer, topic to multiple.
Q5) Weblogic is currently owned by which company and originally by which? or What is the full
form of BEA?
Ans: This is not a technical question, but simply to understand general awareness of the
people/organization behind the software.
Originally Weblogic was owned by BEASystem. Later purchased by Oracle Inc. 3 Guys named
Bill, Ed Scott and Alfred founded it in 1995. So they took first letter of their name. thats it!!!!
Simplicity right!!!
Q6) How will find the version of Weblogic server?
Ans: Version can be found in log files or config.xml easily. By command also we can do it
$ java weblogic.version
For detailed version info
$java weblogic.version -verbose
Q7) Tell one recent error you got and how did you solved it?
Ans: This is a super offer in plate question. If he asked it, you have a good chance to get
selected. What is the trick?
Always Always keep in mind 4 – 5 common/uncommon error and their good solutions. You can
make very good impression.
I will tell more in coming post. In fact even a scenario like high CPU load article i have posted
some time back is good one.
Here is one more…
We were trying to make a domain, but when we ran config.sh, it showed some java error.
/usr/lib/jvm/java….No such file or directory .
On investigation , we found it is pointing to wrong java location. Actually we forgot to run env
setting file.
we ran commEnv.sh and than ran config.sh . It resolved the issue.
Q8) What is JNDI?
Ans: Java Naming and Directory interface. This is a favorite question. Don’t know why. Read
mode and more on it…
Any way, JNDI and Cluster , there 2 are ever HOT topics for interview.
Q9) What is autodeployment? What is it used for and how to turn it off?
Ans: There was a option Hotdeployment in earlier version. Now its Autodeployment.
In simple words, any deploy able files put in autodeploy folder ( $DOMAIN_HOME/autodeploy)
are automatically deployed. Libraries cannot be deployed using autodeploy feature.
It is generally used for development purposes and is available only when server is started in
Development mode. To turn it off, simply remove ths files in the folder or change to production
mode.
Q10) What is cross-cluster replication?
Ans: It is the ability provided by WL to replicate HTTP sessions across two clusters in separate
domains.
Here some direct interview questions. Generally few indirect questions are also asked like in
above question, some one may ask.. we need to replicate http session across domains, it is
possible. If not why and if yes, how?
++++++++++++++++++++
Q11) In how many ways you can do configuration changes?
Q12) How can we make Node-manager to start during system startup?
Q13) What are Log filters and their uses?
Q14) Have you done any deployment? can you explain it in brief?
Q15) What type of information will be in web.xml, weblogic.xml and application.xml?
Q16) Is it possible to refresh static component of a already deployed application without
required to redeploy whole application? — yes
Q17) How to edit config.xml file?
Q18) What is a connection pool and connection object?
Q19) What is JMS? Tell some practical uses of it
Q20) What is persistent Messaging? Any practical example you can give.
- See more at: http://www.weblogicbeginner.com/weblogic-server-admin-interview-questionspasrt-
2/#sthash.vCbzwQv0.dpuf
Weblogic: 10g R3 –> It is called 11g
============================
Q1) What is Weblogic server?
A weblogic server is a instance of java process executing in a JVM. Please note each java
process runs on a JVM.
Application server is a single process running in OS. We can have multiple servers, application
servers running on same piece of hardware.
Two Type of servers:
1. Administration server:
2. Managed server:
Q2) What is a Admin. server?
=====================
Every domain have one and only one admin server. It is the central point of control for the web
domain.
It runs Weblogic admin console.
It is in charge of congfig.xml. Config.xml contains configuration info about domain.
Q3) What is a Managed server?
======================
-A domain can have zero or more managed server. i.e any server in a domain which is not a
admin server is a managed server.
- contacts admin server for config info.
- in prod env, we host application on Managed servers, not on admin server, though admin
server can also host applications.
- Independent of other servers in domain ( unless in a cluster)
- can have multiple Managed servers in a domain.
Admin server stores the master copy of the domain config, including config for all Managed
server.Each Managed server stores local copy of domain config.
First Admin server is started. It read config.xml and build all JMX Mbeans needed for entire
domain.
Then Manged servers are started .They contact admin server for each one’s JMX Mbeans.
When any config change is done, the admin server send the changes to Managed server.
So, to do any changes, we need to contact Admin server through console or WLST. Admin
server will push those changes to Managed servers.
Q4) What is a Machine in Weblogic server?
=============================
A computer that hosts the WL server instances.
Used by node manager to restart a failed managed server.
Note: A ( WebLogic) WL server is nothing , but a Java application running in JVM. It is a process.
Q50 What is a Cluster?
================
A cluster is a logical group of WLServers, acting together for high availability and Load
Balancing.
It is transparent to a client.
Note:
1. A cluster cannot span domain i.e. all the servers in a cluster must be in same domain.
2. Only Managed server can make up a cluster.
3. All servers in a cluster must be same version level, though they can run on different machines
with different OS.
Q6) What is aDomain?
===============
Llogically related group of WL server resources that are managed as a single unit.
It is administrative boundary for all servers, admin server, managed
servers,clusters,applications,services etc.
We can have dev,test, prod domains. Or Domain that span different organizational
boundaries. Likes a domain for HR resources application.
It is transparent to applications and can be configure even after applications are deployed or
are in prod env.
So, Domain is just administrative feature.
Note:
- Each domain must have its one Admin server.
- Any given admin or managed server or cluster can belong to only one Domain
- Managed servers in a domain must run same WL server version and Admin server must have
same or higher WL server version.
So , a domain have only one admin server and an admin server serves only one domain.
Q7) What is a Node Manager?
=====================
-Node manager is a utility or process running on a physical server that enables starting,
stopping,suspending or restarting admin and managed server remotely.
-It is not associated with a domain, though can start any server that reside on same physical
server.
-it is required if we use Admin console to start servers
- required for whole server migration and for some configuration of automatic server migration.
two version:
1. java-based
2. Script based.
=========
After weblogic installation some files we have are:
1. Oracle home: cd /u01/app/oracle/product/Middleware
2. registry.dat or registry.xml :–record of all Oracle products
3. utils:– Additional Jar files
4. wlserver_10.3:– weblogic server 10.3 home
5. logs :– Installation logs
6. Modules:–jar files installed in Oracle home
cd wlserver_10.3
1. common: common files shared by wl server 10.3 components including template Jar files.
2. samples: sample codes and resources
3. server: server software components i.e. executable,db files, XML jar files. alternative JDBC
files,WL server Jar files ,
plug-ins
4. uninstall: code to uninstall WL server 10.3
=====
to set env variables:
1. setWLsenv.sh ( WL_HOME/server/bin ) — set WL_HOME, JAVA_HOME,PATH,CLASSPATH
2. it calls commEnv.sh ( WL_HOME/common/bin —set common env variables BEA_HOME,
ANT_HOME, POINTBASE_HOME
=====
to know the java version.
java -version
- See more at: http://www.weblogicbeginner.com/weblogic-concepts-1/#sthash.GxI3aB1I.dpuf
Steps to create Weblogic Domain.
Before creation , lets have some liltle Q/A to make things more clear. Basic Weblogic server
architecture you can find here.
Q1) Under one BEA_HOME, can we have multiple WL_HOME ( Weblogic homes) ?
Ans: Yes, we can have. But, generally not done. One BEA_HOME–> One WL_HOME.
Q2) In how many modes a WL server can be started?
Ans: Two modes
i. Development mode –> Default
ii. Production mode –> Ask username/password while starting/stopping Admin server.
Q3) Can a BEA_HOME have multiple DOMANIN_HOMEs ?
Ans: Yes
Also, A box can have multiple BEA_HOMEs.
Q4) How to find domain version?
Ans: By Config.xml. Evey domain will have its own config.xml and this file contains all the
information. Admin server and all Managed server’s name,port, ip address etc . In fact, we can
change Admin server from config.xml.
<admin-server-name> –>server_name< — change here.
Q5) Where is username/password stored ?
Ans: SerializedSystemIni.dat in encrypted form.
Actually, username/password can be stored in a file or in DB. But if stored in DB, it must be up
for authentication. So, generally username/password is stored in a file.
Q6) What is DOMAIN_HOME location?
And: Default: $BEA_HOME/user_projects/domains/
In companies: $HOME/domains/ $HOME is home path of user.
Q7) How to create a domain ?
Ans: There are 3 ways to do it.
1. GUI i.e. Graphical mode
2. Console mode
3. Silent mode, Template based
8. Steps to create Weblogic Domain in GUI mode.
We suggest, first create a domain in GUI mode, so that you will get accustomed to options
available. Then you can easily do it in console or template mode. In companies, console mode is
most preferred.
1. $ cd $BEA_HOME/$WL_HOME/common/bin
2. $ ./config.sh
Installer will appear.
3. Select “Create a new WebLogic Domain”
4. Select ” Base this domain on an existing template”
Note: Under $WL_HOME/common/template/domain/ we have a file called wls.jar
It is template for single server domain — mydomain, myserver . Prot: 7001
5. Give Admin username,password and confirm it. Then click Next.
Remember this username and password always.
6. Select whether you want to start Admin server in “development” or “Production” mode.
You can later change this setting by following this.
Also, Select java kit either SUN JDK or JRockit. Note, bith option will be available only if you
have installed both while installing Weblogic server. You can in fact select any other JDK also, if
available.
7. Select “Yes” and then click Next to do some Customization.
8. For RDBMS security store database, select ” I don’t want to change anything here” and click
Next . These advanced option we will discuss later.
9. Give Admin server Name, listen address i.e. ip address, port number and click Next.
e.g.
Name: goodbank_admin
Listen address: 192.165.123.1
Listen port: 8001
10. Now we have to configure Managed server.
Give Managed servers name,listen address and port numbers and then click Next.
11. Click Next as we not configuring Cluster now.
12. Click Next as we not configuring Machines now.
13. Review the selections made till now and then click Next.
14. Here we give Domain name and DOMAIN_HOME path.
e.g. Domain Name: Goodbank_domain
Domain Location: /home/wluser/domains
click Next.
15. Click Done.
Congratulations !!! you just created a domain with managed servers and non-default
DOMAIN_HOME path.
Q9) Last, but not the least, Can we create 2 Domains with same name in same box?
Ans: Yes, we can. DOMAIN_HOME path should be different. If given same path, second
installation will corrupt files of first domain.
- See more at: http://www.weblogicbeginner.com/how-to-create-a-domain-in-weblogic-server-
11g/#sthash.kEam5xC3.dpuf
1. What is a domain in weblogic server?
An Oracle WebLogic Server administration domain is a logically related group of Oracle
WebLogic Server resources. Domains include a special Oracle WebLogic Server instance called
the Administration Server, which is the central point from which you configure and manage all
resources in the domain. Usually, you configure a domain to include additional Oracle WebLogic
Server instances called Managed Servers.
2. What is an administration server?
The Administration Server operates as a central point of control for the configuration of the
entire domain. It maintains the domain’s configuration documents and helps sync changes in
the configuration documents to Managed Servers. You can also use the Administration Server
as a central location that helps monitor all resources in a domain.
3. What is a managed server?
Managed Servers host business applications, application components, Web services, and their
associated resources. Managed Servers maintain its own read-only copy of the domain’s
configuration document. When a Managed Server starts up, it connects to the domain’s
Administration Server to synchronize its version of the configuration document with the
document that the Administration Server maintains.
4. What will happen if an administration server fails?
The failure of the administration server does not have any impact on the managed server.
However, the domain configuration cannot be changed in the failed state as the admin server
controls the domain configuration.
5. What are deployment descriptors?
Deployment descriptors are XML files that describe the runtime behaviour for the deployment
unit or the application. These XML file contains information such as the context root of the web
application, the parameters to be set on application start up and the mapping of the portable
names of an application’s resources to the application Server’s resources. These descriptors lie
in the WEB-INF or the META-INFdirectories.
6. What is MSI mode?
MSI mode, if enabled, helps in starting the managed server without starting the Admin server.
With this option enabled, managed server looks for the msi-config.xml and creates an Mbean
out of it.
7. What all possible ways can be used to stat the webogic server?
a). Using the startWeblogic.sh script.
b). Using Node Manager
c). Using weblogic.admin start command
d). As a windows service usingbeasvc.exe
8. What is the difference between web.xml and weblogic.xml?
The web.xml file provides configuration and deployment information for the Web components
that comprise a Web application. Examples of Web components are servlet parameters, servlet
and JavaServer Pages (JSP) definitions, and Uniform Resource Locators (URL) mappings. This is
located in the WEB-INF directory.
Weblogic.xml is the configuration file for all the applications lying in the domain created. It lies
in the META-INF directory and contains parameters such as auth-filter, charset-params,
container-descriptor, context-root, description etc.
9. What do you know about weblogic classloading?
A classloader is part of JVM that loads classes into memory. Classloader is responsible for
finding the classes at runtime.
Weblogic uses the following classloaders:
Bootstrap classloader (JVM): Loads internal classes for JVM
Extensions classloader (JVM): Loads JARs placed in the extensions directory
Application classloader (WebLogic): Loads the EAR/WAR/EJB
10. What is a connection pool?
Connection pool is a named collection of identical JDBC connections to a database. This is done
for the purpose of efficiency so as to reduce the overhead of creating connection objects at
runtime.
11. What is JNDI?
JNDI or the Java Naming and Directory Interface is a naming service used to locate objects in
datasources, JMS, MailSessions etc. It is a kind of abstraction that the clients use while
connecting to the database. So the client looks for the JNDI to get the connection to the
database.
12. What is JMS?
JMS or the Java Messaging Service helps the application sin a domain to communicate with one
another. It simplifies the application development in weblogic by providing a set of methods
through its API that help in creating, sending and receiving messages accross enterprise
applications.
13. What is the difference between a JNDI and a datasource?
JNDI or the Java Naming and Directory Interface is a naming service used to locate objects in
datasources, JMS, MailSessions etc. Datasource is an object used to access the connections in
the pool. JNDI physically connects to the database whereas the datasource is a logical resource.
14. What is a weblogic server cluster?
Weblogic server cluster is a set of multiple weblogic servers running in parallel with each other
to provide increased scalability, reliability and high availability. A cluster gives the end-user the
feel of a single weblogic instance while multiple weblogic servers may be running
simultaneously in the background. All cluster related information/parameters are defined in the
weblogic.xml.
15. Is that possible to start Managed server if admin server is not running ?
Yes, if MSI is enabled.
16. What are the differene modes of Weblogic server?
In development mode, there is an application poller. This is a simple utility that polls the
“<domain>/applications” directory every 3secs (default). If it finds a different version of
application in the directory, then weblogic would redeploy the app automatically.
In production mode application poller is turned off. User would either have to deploy from
console or run weblogic.Deployer utility.
17. What is a virtual host?
A configured host name that routes requests for a particular DNS name to a WebLogic Server
instance or cluster.
18. What are the different staging modes?
Stage: The Administration Server first copies the deployment unit source files to the staging
directories of target servers. (The staging directory is named stage by default, and it resides
under the target server’s root directory.)
The target servers then deploy using their local copy of the deployment files.
NoStage: 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.
External_Stage: External_stage mode is similar to stage mode, in that target servers deploy
using local copies of the deployment files. However, the Administration Server does not
automatically copy the deployment files to targeted servers in external_stage mode; instead,
you must copy the files to the staging directory of each target server before deployment. You
can perform the copy manually or use automated scripts.
Q: - How do I increase WebLogic Server memory?
Increase the allocation of Java heap memory for WebLogic Server. (Set the minimum and the
maximum to the same size.) Start WebLogic Server with the -ms32m option to increase the
allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves
performance and allows WebLogic Server to handle more simultaneous connections. You can
increase this value if necessary.
Q: - Can I start a Managed Server if the Administration Server is unavailable?
By default, if a Managed Server is unable to connect to the specified Administration Server
during startup, it can retrieve its configuration by reading a configuration file and other files
directly. You cannot change the server's configuration until the Administration Server is
available. A Managed Server that starts in this way is running in Maindexindex1naged Server
Independence mode.
Q: - How are notifications made when a server is added to a cluster?
The WebLogic Server cluster broadcasts the availability of a new server instance each time a
new instance joins the cluster. Cluster-aware stubs also periodically update their list of available
server instances.
Q: - What happens when a failure occurs and the stub cannot connect to a WebLogic Server
instance?
When the failure occurs, the stub removes the failed server instance from its list. If there are no
servers left in its list, the stub uses DNS again to find a running server and obtain a current list
of running instances. Also, the stub periodically refreshes its list of available server instances in
the cluster; this allows the stub to take advantage of new servers as they are added to the
cluster.
Q: - Can I enable requests to a JDBC connection pool for a database connection to wait until a
connection is available?
No, there's no way to allow a request to wait for a pool connection, and from the system point
of view there should not be. Each requests that waits for a connection ties up one of the fixed
number of execute threads in the server, which could otherwise be running another server
task. Too many waiting requests could tie up all of the execute threads and freeze the server.
Q: - How do I use multibyte character sets with WebLogic jDriver for Informix?
Currently, multibyte character sets are not supported for the WebLogic jDriver for Informix
driver.
Q: - How do I increase WebLogic Server memory?
Increase the allocation of Java heap memory for WebLogic Server. (Set the minimum and the
maximum to the same size.) Start WebLogic Server with the -ms32m option to increase the
allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves
performance and allows WebLogic Server to handle more simultaneous connections. You can
increase this value if necessary.
Q: - Can I configure the messaging bridge to automatically downgrade the quality of service if
the Exactly-once service isn't available on either the source or target bridge destination?
Yes, just make sure to select the QOS Degradation Allowed check box on the Messaging Bridge
> Configuration > General administration console page.
Q: - How do I restrict access to servlets and JSPs?
The Java Servlet API Specification v2.2 allows you to declaratively restrict access to specific
Servlets and JSPs using the Web Application Deployment descriptor. Section 13.3.2 of the
specification has an example deployment descriptor that uses declarative security. For more
information, see Programming WebLogic HTTP Servlets.
Weblogic Important Question
Q.How many types of weblogic installation ?
Ans:- There are 3 types of weblogic installation.
(a) Grapical Mode (interactive GUI based)
(b) Console Mode (interactive Text Based)
(c) Silent Mode ( Non Interactive method using .xml properties file (-mode =console -silent_xml
=properties_xml_file).
Q. Difference between Unicast and Multicast?
Ans:- Unicast:- Unicast is a one-to one connection between the client and the server.
In cluster, In this concept one server 1st called server always acts like leader, every member
interact with leader, 1st server when brings up it is a Leader.
The main difference between Unicast and Multicast is as follows
Unicast:
Say you have three servers (MS-1,MS-2,MS-3) in a cluster now if they have to communicate
with each other they have to ping (i.e. heartbeats ) the cluster master for informing him that he
is alive.
If MS-1 is the master then MS-2 and MS-3 would send the ping to MS-1
Multicast:
Here there is no cluster master each server has to ping each other to inform everyone that I am
alive.
So MS-1 would send the ping to MS-2 & MS-3 same way MS-2 would send the ping to MS-1 &
MS-3 and MS-3 would ping MS-1 & MS-3.
Thus if you see in multicast the congestion in sending the pings are more compared to unicast
which makes multicast much heavier, thus WLS recommends using Unicast of less congestion in
the network.
Multicast is a very old concept in this concept all managed server talks to eachother in every
fraction of seond to show that they are alive.
Q. What is Cluster and Advantages of clustering?
Cluster:- “cluster is nothing but group or set of managed server so that we can handle tha
task to avoid overloading. “Group of weblogic managed server instance that work together to
provide Scalablity and High Availability”.
A WebLogic Server cluster provides these benefits:
Scalability
The capacity of an application deployed on a WebLogic Server cluster can be increased
dynamically to meet demand. You can add server instances to a cluster without interruption
of service—the application continues to run without impact to clients and end users.
High-Availability
In a WebLogic Server cluster, application processing can continue when a server instance
fails. You “cluster” application components by deploying them on multiple server instances in
the cluster—so, if a server instance on which a component is running fails, another server
instance on which that component is deployed can continue application processing.
The choice to cluster WebLogic Server instances is transparent to application developers and
clients. However, understanding the technical infrastructure that enables clustering will help
programmers and administrators maximize the scalability and availability of their applications.
5.Different between stage and no stage deployment?
Stage Deployment:- Admin server Having the physical copy and it will distribute to remaining
instances.
Staged deployment will copy your deployment units onto the deployment servers, place
them into the $WL_HOME/servers/SERVER_NAME/stage directory and deploy them from
there.
In stage mode, the Administration Server copies the deployment files from their original
location on the Administration Server machine to the staging directories of each target
server. For example, if you deploy a Java EE Application to three servers in a cluster using
stage mode, the Administration Server copies the deployment files to directories on each of
the three server machines. Each server then deploys the Java EE Application using its local
copy of the archive files.
When copying files to the staging directory, the Administration Server creates a subdirectory
with the same name as the deployment name. So if you deployed using the command:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mytestear -stage -targets mycluster
-deploy c:\bea\wlserver_10.0\samples\server\medrecd\dist\physicianEar
a new directory, mytestear, would be created in the staging directory of each server
in mycluster. If you do not specify a deployment name, a default deployment name (and staging
subdirectory) is used:
For exploded archive deployments, the deployment name and staging subdirectory
are the name of the directory you deployed (physicianEar in the example above).
For archived deployments, the default deployment name is the name of the archive
file without the extension. For example, if you deploy physicianEar.ear, the
deployment name and staging subdirectory are physicianEar.
The Administration Console uses stage mode as the default mode when deploying to more than
one WebLogic Server instance. weblogic.Deployer uses the target server’s staging mode as the
default, and Managed Servers use stage mode by default.
Stage mode ensures that each server has a local copy of the deployment files on hand, even if a
network outage makes the Administration Server unreachable. However, if you are deploying
very large applications to multiple servers or to a cluster, the time required to copy files to
target servers can be considerable. Consider nostage mode to avoid the overhead of copying
large files to multiple servers.
Syntax for Stage Mode
To use stage mode, specify -stage as an option to weblogic.Deployer, as in:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mydeploymentname
-targets myserver1,myserver2,myserver3 -stage
-deploy c:\localfiles\myapp.ear
No Stage Deployment:- Using Nostage Mode Deployment
In nostage mode, the Administration Server does not copy the archive files from their source
location. Instead, each target server must access the archive files from a single source directory
for deployment. The staging directory of target servers is ignored for nostage deployments.
For example, if you deploy a Java EE Application to three servers in a cluster, each server must
be able to access the same application archive files (from a shared or network-mounted
directory) to deploy the application.
Note:
The source for the deployment files in nostage mode is the path provided by the user at
deployment time (as opposed to stage mode, where the source is the path in each
server’s staging directory). However, even in nostage mode, WebLogic Server copies out
parts of the deployment to temporary directories. This enables users to update entire
archived deployments or parts of archived deployments.
In nostage mode, the Web application container automatically detects changes to JSPs and
servlets. Nostage also allows you to later update only parts of an application by updating those
parts in one file system location and then redeploying.
The Administration Console uses nostage mode as the default when deploying only to the
Administration Server (for example, in a single-server domain). weblogic.Deployer uses the
target server’s staging mode, and Administration Servers use nostage mode by default. You can
also select nostage mode if you run a cluster of server instances on the same machine, or if you
are deploying very large applications to multiple machines that have access to a shared
directory. Deploying very large applications in nostage mode saves time during deployment
because no files are copied.
Syntax for Nostage Mode
To use nostage mode, specify -nostage as an option to weblogic.Deployer, as in:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mydeploymentname
-targets myserver1,myserver2,myserver3 -nostage
-deploy c:\localfiles\myapp.ear
6.Use of heap:-
JVM Heap Size and Garbage Collection
Garbage collection is the JVM’s process of freeing up unused Java objects in the Java heap.The
Java heap is where the objects of a Java program live. It is a repository for live objects, dead
objects, and free memory. When an object can no longer be reached from any pointer in the
running program, it is considered “garbage” and ready for collection.
The JVM heap size determines how often and how long the VM spends collecting garbage. An
acceptable rate for garbage collection is application-specific and should be adjusted after
analyzing the actual time and frequency of garbage collections. If you set a large heap size, full
garbage collection is slower, but it occurs less frequently. If you set your heap size in
accordance with your memory needs, full garbage collection is faster, but occurs more
frequently.
The goal of tuning your heap size is to minimize the time that your JVM spends doing garbage
collection while maximizing the number of clients that WebLogic Server can handle at a given
time. To ensure maximum performance during benchmarking, you might set high heap size
values to ensure that garbage collection does not occur during the entire run of the benchmark.
You might see the following Java error if you are running out of heap space:
java.lang.OutOfMemoryError <<no stack trace available>>
java.lang.OutOfMemoryError <<no stack trace available>>
Exception in thread "main"
To modify heap space values, see Specifying Heap Size Values.
To configure WebLogic Server to detect automatically when you are running out of heap space
and to address low memory conditions in the server, see Automatically Logging Low Memory
Conditions.
9.States of the Server?
Ans:-There are 9 states of server:-
Shutdown
Starting
Standby
Resuming
Running
Suspending
Shutting down
Failed
Unknown
The series of states through which a WebLogic Server instance can transition is called
the server life cycle.
The Server Life Cycle:-
Q.Use of Stub?
Ans:-
Clients that connect to a WebLogic Server cluster and look up a clustered object obtain a
replica-aware stub for the object. “This stub contains the list of available server instances
that host implementations of the object. The stub also contains the load balancing logic for
distributing the load among its host servers”.
Q.What happens when a failure occurs and the stub cannot connect to a WebLogic Server
instance?
Ans:-When the failure occurs, the stub removes the failed server instance from its list. If
there are no servers left in its list, the stubb uses DNS again to find a running server and
obtain a current list of running instances. Also, the stub periodically refreshes its list of
available server instances in the cluster; this allows the stub to take advantage of new
servers as they are added to the cluster.
Q. How to check port number?
Ans:- netstat -na |grep connected (to find the ports connected in Linux box.)
netstat -na |grep listen (to find the listening ports in HP-UX,Solaris)
Q. Check the version of java.
Ans:- [root@h1vm /]# java -version run this command in linux to know the java version.
1). If two managed servers is there Same Domain is configured in both servers, but one physical
server is crashed then how can you create a domain with the same configuration?
2). Give me the real time scenario to configure weight based algorithm in a cluster?
3). If some servers in cluster are running some of them are down is it deployment is possible?
4). Is it possible two different versions of the same application deploy at the same time?
5). How to recover password in weblogic?
6). How to recover boot.properties?
7). How to recover serializedini.dat, if the file is corrupted?
8). How admin server knows that the managed server is down?
9). What you can do if multicast buffer is full and how you know that?
10). What is the Max amount of information that can be saved in a session object?
11). How do u differentiate a out of memory and memory leak issue?
In this article I will briefly discuss how I conduct interviews for WebLogic Administration roles.
When conducting interviews I prefer to avoid difficult questions, and instead ask fairly simple
questions and look at how well the candidate answers. I would prefer to hire someone who can
clearly and concisely explain how to do a simple task than someone who knows every single
thing about a particular technology.
I explain at the beginning of the interview, it’s acceptable if they are not able to answer every
question; I use their answers to help decide if they will be a good fit for the team and the role.
Here are some of the questions I like to ask after I’ve given them a description of the role on
offer.
Non-Technical Questions
Which of your previous roles do you think have give you experience that could be
important for this role?
Tell me what is involved in a typical day in this role?
Describe the kind of infrastructure you worked with in this role?
On a scale of 1 to 10, with 1 being “no knowledge” and 10 being “know everything”,
how would you rate your own skills? (I don’t look for people who think they “know
everything”).
What are some of the things you need to learn more about?
Technical Questions
If you were trying to access an application via a HTTP proxy and were getting a 404
error, how would you go about determining why you were getting this error?
Describe how you would go about configuring a WebLogic server to give an application
access to a database.
How many threads does a managed server make available to an application? (expect
different answers for different versions of WebLogic)
What kind of problems would you expect to encounter when trying to increase a
managed server’s maximum heap size to 3 GB? (Problems on 32-bit operating systems).
If an application was suffering short periodic freezes, and no errors were appearing in
the logs, can you suggest a possible cause? (Garbage collection)
How could you prevent these periodic lock-ups?
What are the ways you could check when garbage collection is occurring?
If you start an admin server as a Windows service, where is that server’s classpath
defined? (Windows Registry)
If you start a managed server via a node manager, where is that server’s classpath
defined? (config.xml)
If a managed server is crashing with a StackOverflow exception, what could be the
cause?
Describe how you would go about configuring a JMS queue in a WebLogic cluster. (i.e. a
distributed queue).
What is application server?
An application server is a software framework dedicated to the efficient execution of
procedures (scripts, routines, programs …) for supporting the construction of applications. The
term was created in the context of web applications. In these, the application server acts as a
set of components accessible to the software developer through an API defined by the platform
itself. These components are usually performed in the same machine where the web server is
running, and their main job is to support the construction of dynamic pages.
What is the Domain in Weblogic serve?
1) Domain is a logically related group of Oracle WebLogic Server resources that are managed as
a single unit
2) Domain Provides one point of administration
3) Can logically separate:
A) Development, test, and production applications
B) Organizational divisions
What is the server?
A server is an instance of weblogic.Server executing in a Java Virtual Machine (JVM).
A server:
1) Runs on a designated Oracle WebLogic Server machine
2) Has a dedicated amount of RAM
3) Is multithreaded
Two types of servers:
1) Administration Server
2) Managed Server
What is the Administration server?
Administration server is central point of control for a domain. It stores the configuration
information and logs for a domain. And it runs the Weblogic Administration console.
What is the Managed Server?
Managed server is a server in a domain that is not the Administration server. It contacts the
administration server for configuration information. It runs business application in a production
environment. It is independent of all other Managed servers in a domain (unless they are not in
a cluster). You can have many managed servers in a domain. Individual managed servers are
typically added for capacity and application isolation.
How Administration server and Managed servers will interact?
The Administration Server stores the master copy of the domain configuration, including the
configuration for all Managed Servers in the domain. Each Managed Server stores a local copy
of the domain configuration file. When a Managed Server starts, it connects to the
Administration Server to synchronize the configuration. When the configuration is changed, the
Administration Server sends the changed configuration to the Managed Servers.
What is the MSI mode in Weblogic? How can you enable and disable this option?
MSI is nothing but Managed Server Independence.
By default, Managed Servers can function independently of the Administration Server.
A Managed Server instance can start in MSI mode if the Administration Server is
unavailable.
Configure MSI mode from the Administration Console.
To start a Managed Server in MSI mode, perform the following:
o Ensure that the Managed Server’s root directory contains the config
subdirectory.
o If the config subdirectory does not exist, copy it from the Administration Server’s
root directory.
o Start the Managed Server at the command line or by using a script.
Environment > Servers > Server_Name > Tuning > Advanced > Managed Server
Independence Enabled check box.
Describe how you might run a WLST script?
11). How will you enable and disable the domain configuration lock?
The Administration Console Change Center provides a way to lock a domain configuration so
you can make changes to the configuration while preventing other accounts from making
changes during your edit session.
The domain configuration locking feature is always enabled in production domains. It can be
enabled or disabled in development domains. It is disabled by default when you create a new
development domain.
To enable or disable the domain configuration locking feature in a development domain:
In the banner toolbar region at the top of the right pane of the Console, click
Preferences.
Click User Preferences.
Select or clear Automatically Acquire Lock and Activate Changes to enable or disable the
feature.
Click Save.
After you finish
When you enable domain configuration locking, you must use the Change Center to lock and
edit for the domain configuration.
12). What are Dynamic and Non-Dynamic Changes in the Weblogic Console? What is the
difference?
Some changes you make in the Administration Console take place immediately when you
activate them. Other changes require you to restart the server or module affected by the
change. These latter changes are called non-dynamic changes. Non-dynamic changes are
indicated in the Administration Console with this warning icon,.
Changes to dynamic configuration attributes become available once they are activated, without
restarting the affected server or system restart. These changes are made available to the server
and run-time hierarchies once they are activated. Changes to non-dynamic configuration
attributes require that the affected servers or system resources be restarted before they
become effective.
If a change is made to a non-dynamic configuration setting, no changes to dynamic
configuration settings will take effect until after restart. This is to assure that a batch of updates
having a combination of dynamic and non-dynamic attribute edits will not be partially
activated.
Note that WebLogic Server’s change management process applies to changes in domain and
server configuration data, not to security or application data.
13). What is the information is going to store in the “security” folder of the Domain directory
contents?
This directory holds the security-related files that are the same for every WebLogic Server
instance in the domain:
SerializedSystemIni.dat
This directory also holds security-related files that are only needed by the domain’s
Administration Server:
DefaultAuthorizerInit.ldift
DefaultAuthenticatorInit.ldift
DefaultRoleMapperInit.ldift
14). What is the use of SerializedSystemIni.dat file in Weblogic?
It is important to protect passwords that are used to access resources in a WebLogic Server
domain. In the past, usernames and passwords were stored in clear text in a WebLogic security
realm. Now all the passwords in a WebLogic Server domain are hashed. The
SerializedSystemIni.dat file contains the hashes for the passwords. It is associated with a
specific WebLogic Server domain so it cannot be moved from domain to domain.
If the SerializedSystemIni.dat file is destroyed or corrupted, you must reconfigure the WebLogic
Server domain. Therefore, you should take the following precautions:
Make a backup copy of the SerializedSystemIni.dat file and put it in a safe location.
Set permissions on the SerializedSystemIni.dat file such that the system administrator of a
WebLogic Server deployment has write and read privileges and no other users have any
privileges.
15). How many ways you can change the configuration changes?
The change management features of WLS:
o Enable you to distribute configuration changes throughout a domain securely,
consistently, and predictably
o Are the same, regardless of whether you are using:
The WLS Administration Console
The WebLogic Scripting Tool (WLST)
The Java Management Extension (JMX) APIs
16). What is the uses of WLST in Weblogic?
o The WLS command-line tools are useful:
For automating common administration activities
As an alternative to the Administration Console
When graphical tools are not supported
o WLST provides a command-line interface for:
Creating new WLS domains
Retrieving and updating WLS domain configurations
Deploying applications
Obtaining run-time server statistics
17). How many WLST modules are there? Explain?
o Online mode:
Connected to a running server
Access to all WLS configuration and run-time attributes
Create and activate change sessions similar to the WLS console
o Offline mode:
Domain not running
Access to only persisted domain configuration (config.xml)
Create or update domains similar to using the Configuration Wizard
18). What is the Node Manager (NM)? Explain briefly?
Node Manager (NM):
o Starts and stops Managed Servers remotely: server, domain, and cluster
o Available as either a Java-based or (for UNIX or Linux) a script-based process
o Monitors and acts on server health
o Runs on the same computers as the Managed Servers
o Can be run automatically in the background, as a Windows service or a UNIX
daemon
19). How many versions of Node Managers are available?
o There are two versions of Node Manager:
Java-based Node Manager
Script-based Node Manager
o Java-based Node Manager runs within a Java Virtual Machine (JVM) process.
o Script-based Node Manager (used only for UNIX and Linux systems) does not
have as much security, but provides the ability to remotely manage servers over
a network using Secure Shell (SSH).
20). How Node Manager will work with the Weblogic Server? How will you configure Node
Manager in WLS?
o Node Manager must run on each computer that hosts the WLS instances that
you want to control with Node Manager.
o You should configure each computer as a machine in Oracle WebLogic Server,
and assign each server instance, which is to be controlled by Node Manager, to
the machine that the server instance runs on.
o Node Manager should run as an operating system service, so that it
automatically restarts upon system failure or reboot.
1). How are new threads assigned?
Ans:
As work enters a Weblogic Server, it is placed in an execute queue. This work is then
assigned to a thread within the queue that performs the work.
By default, a new server instance is configured with a default execute queue,
weblogic.kernel.default, that contains 15 threads (in development) and 25 threads (in
production).
In addition, Weblogic Server provides two other pre-configured queues:
weblogic.admin.HTTP—Available only on Administration Servers, this queue is reserved for
communicating with the Administration Console; you cannot reconfigure it.
weblogic.admin.RMI—Both Administration Servers and Managed Servers have this queue; it is
reserved for administrative traffic; you cannot reconfigure it.
Unless you configure additional execute queues, and assign applications to them, web
applications and RMI objects use weblogic.kernel.default.
2). Is there an ability to configure the container to kill stuck threads after X amount of time?
Ans:
Currently, Weblogic reports that a thread is stuck after X amount of time, but the thread
keeps running. Once the thread is stuck or processing it cannot be killed.
If they are not stuck or processing the request then they are called idle thread that is
waiting for request (waitforrequest() method: A thread invokes this method when it is
waiting for work to be assigned to it by its manager).
3). Is there a way to manually kill a stuck thread?
Ans:
No, once thread is created it would be reused but cannot be killed.
4). Why does the user “WLS Kernel” own so many threads?
Ans:
WLS Kernel owns only the number of the threads which are configured as a default.
5). What is “WLS Kernel” doing with these threads?
Ans:
As specified earlier it is kept in default execute queue and then assigned to a thread
within the queue that performs the work.
6). Can we make these threads available to the application?
Ans:
No we cannot do that.
I often get mails from people asking what are the questions generally asked in Weblogic by
interviewers.
Generally for an Administrator’s positions, in addition to Weblogic questions, there are a lot of
Unix questions and a few questions related to process and case handling.
These are the important questions that I cover while interviewing.
1. How do you differentiate between a server hang and server crash issue?
When a Server crahes, the JAVA process no longer exists. When the Server is hung, it stops
responding.
We can use the weblogic.ADMIN utilty to ping the server. In case of a hang situation we can
take multiple thread dumps and analyze the cause of hang.
2. What can be the various reasons for a server crash?
a) Native IO
b) SSL Native Libraries
c) JVM
d) Supported Configuration
e) JDBC Driver issue
3. How do you troubleshoot a crash?
JVM crash generates a hs_err_pid file. We need to look into the stack trace of the hs_err_pid file
.
If the thread is from a native io, we need to disable native io.
if the 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 optimzed code, we can turn of optimization.
If the stack is from native calls of application, its a bug with the application and it has to b
modified.
4. Ho do you troubleshoot Server Hang?
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 CTLR Break on Windows.
Analyze the thread dump to find the root cause.
5. What can be the reasons of Server hang?
Memory leak, databse query taking a long time to return, Deadlock.
6. What is memory leak?
Memory leak is when objects are not romved from the heap even when they are not required.
7. What are the various causes for OUT OF MEMORY?
a) Insufficient heap size, not able to match the extra load.
b) Objects licing too long, like HTTP Sessions.
c) Memory leak in application code.
d) Full GC not happening due to JVM Bug.
8. How to troubleshoot and 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.
9. When does High CPU Usage occur?
It occurs when one process or one thread utilizes unexpectedly high proportion of CPU.
10. How to troubleshoot it?
In Solaris environment, we need to take pstack and prstack and see what the threads are doing.
In Windows we need to use pslist and process explorer.
11. What is Clustering and what is achieved through it?
Clustering is the grouping together of servers for the purpose of high availability and scalability.
Load balancing and Failover is achieved.
12. How does Cluster Communication Happen?
Members of the Cluster communicate over the Cluster Multicast IP and Port by sending periodic
heart beat messages.
13. What is the difference between the Sun JVM and BEA JRockit JVM?
The most well know JVM is the implementation from Sun. The Sun JVM is called HotSpot. The
Sun JVM is shipped in the Java Developer’s Kit (JDK) and Java Runtime Environment (JRE)
from Sun.
The BEA JRockit JVM from BEA systems is optimized for reliability and performance for
server side applications. To achieve this, BEA JRockit JVM uses technologies such as code
generation, hot spot detection, code optimization, advanced garbage collection algorithms and
tight operating system integration.
14. TUning JVM Parameters.
If you have a single processor, single thread machine then you should use the serial collector
(default for some configurations, can be enabled explicitly for with -XX:+UseSerialGC). For
multiprocessor machines where your workload is basically CPU bound, use the parallel collector.
This is enabled by default if you use the -server flag, or you can enable it explicitly with -
XX:+UseParallelGC. If you’d rather keep the GC pauses shorter at the expense of using more
total CPU time for GC, and you have more than one CPU, you can use the concurrent collector (-
XX:+UseConcMarkSweepGC). Note that the concurrent collector tends to require more RAM
allocated to the JVM than the serial or parallel collectors for a given workload because some
memory fragmentation can occur.
15. How do you do performance tuning of WLS?
It can be categorized in 4 parts.
a. Application Tuning.
jsp precompilation, ejb pool size cache..
b. OS Tuning
Setting tcp ip parameter.
tcp_time_wait_interval
tcp_conn_req_max_q
c. Core Server Tuning.
tune workmanager, tune chuck size and chunck pool size, using performance packs, conenction
backlog buffering.
d. JVM Tuning
tuning gc strategy, monitoring garbage collection..
Weblogic Admin
Saturday, July 10, 2010
Weblogic Administrator Interview Questions
1)How do I provide user credentials for starting a server?
When you create a domain, the Configuration Wizard prompts you to provide the username and
password for an initial administrative user. If you create the domain in development mode, the
wizard saves the username and encrypted password in a boot identity file. A WebLogic Server
instance can refer to a boot identity file during its startup process. If a server instance does not
find such a file, it prompts you to enter credentials.
If you create a domain in production mode, or if you want to change user credentials in an
existing boot identity file, you can create a new boot identity file.
2)Can I start a Managed Server if the Administration Server is unavailable?
By default, if a Managed Server is unable to connect to the specified Administration Server
during startup, it can retrieve its configuration by reading a configuration file and other files
directly. You cannot change the server's configuration until the Administration Server is
available. A Managed Server that starts in this way is running in Managed Server Independence
mode.
3)What is the function of T3 in WebLogic Server?
T3 provides a framework for WebLogic Server messages that support for enhancements. These
enhancements include abbreviations and features, such as object replacement, that work in the
context of WebLogic Server clusters and HTTP and other product tunneling. T3 predates Java
Object Serialization and RMI, while closely tracking and leveraging these specifications. T3 is a
superset of Java Object. Serialization or RMI; anything you can do in Java Object Serialization
and RMI can be done over T3. T3 is mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional protocols that
can be used to communicate between other processes and WebLogic Server. It depends on what
you want to do. For example, when you want to communicate between a browser and WebLogic
Server-use HTTP, or an ORB and WebLogic Server-IIOP.
4)How do you set the classpath?
WebLogic Server installs the following script that you can use to set the classpath that a server
requires:
WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
WL_HOME/server/bin/setWLSEnv.sh (on UNIX)
5)How do stubs work in a WebLogic Server cluster?
Clients that connect to a WebLogic Server cluster and look up a clustered object obtain a replicaaware
stub for the object. This stub contains the list of available server instances that host
implementations of the object. The stub also contains the load balancing logic for distributing the
load among its host servers.
What happens when a failure occurs and the stub cannot connect to a WebLogic Server instance?
When the failure occurs, the stub removes the failed server instance from its list. If there are no
servers left in its list, the stubb uses DNS again to find a running server and obtain a current list
of running instances. Also, the stub periodically refreshes its list of available server instances in
the cluster; this allows the stub to take advantage of new servers as they are added to the cluster.
6)How does a server know when another server is unavailable?
WebLogic Server uses two mechanisms to determine if a given server instance is unavailable.
Each WebLogic Server instance in a cluster uses multicast to broadcast regular "heartbeat"
messages that advertise its availability. By monitoring heartbeat messages, server instances in a
cluster determine when a server instance has failed. The other server instances will drop a server
instance from the cluster, if they do not receive three consecutive heartbeats from that server
instance
WebLogic Server also monitors socket errors to determine the availability of a server instance.
For example, if server instance A has an open socket to server instance B, and the socket
unexpectedly closes, server A assumes that server B is offline.
7)How are notifications made when a server is added to a cluster?
The WebLogic Server cluster broadcasts the availability of a new server instance each time a
new instance joins the cluster. Cluster-aware stubs also periodically update their list of available
server instances.
8)How do clients handle DNS requests to failed servers?
If a server fails and DNS continues to send requests to the unavailable machine, this can waste
bandwidth. For a Java client application, this problem occurs only during startup. WebLogic
Server caches the DNS entries and removes the unavailable ones, to prevent the client from
accessing a failed server twice.
Failed servers can be more of a problem for browser-based clients, because they always use
DNS. To avoid unnecessary DNS requests with browser-based clients, use a third-party loadbalancer
such as Resonate, BigIP, Alteon, and LocalDirector. These products mask multiple
DNS addresses as a single address. They also provide more sophisticated load-balancing options
than round-robin, and they keep track of failed servers to avoid routing unnecessary requests.
9)How many WebLogic Servers can I have on a multi-cpu machine?
There are many possible configurations and each has its own advantages and disadvantages.
BEA WebLogic Server has no built-in limit for the number of server instances that can reside in
a cluster. Large, multi-processor servers such as Sun Microsystems, Inc. Sun Enterprise 10000,
therefore, can host very large clusters or multiple clusters.
In most cases, WebLogic Server clusters scale best when deployed with one WebLogic Server
instance for every two CPUs. However, as with all capacity planning, you should test the actual
deployment with your target web applications to determine the optimal number and distribution
of server instances.
10)How can I set deployment order for applications?
WebLogic Server allows you to select the load order for applications. WebLogic Server deploys
server-level resources (first JDBC and then JMS) before deploying applications. Applications are
deployed in this order: connectors, then EJBs, then Web Applications. If the application is an
EAR, the individual components are loaded in the order in which they are declared in the
application.xml deployment descriptor.
What is difference between welogic server and WebSphere?
WebLogic is one of the leading J2EE™ application servers in today’s marketplace. Monitoring
WebLogic for its performance and availability becomes inevitable. Applications Manager, a tool
for monitoring the performance and availability of applications and servers, helps in BEA
WebLogic Management. WebSphere is IBM's powerful J2EE application server that enables
businesses and organizations to build robust, Web-based applications. WebSphere, a transactionoriented
web server, allows you to develop, launch, and integrate powerful e-business
applications—customer management systems, transaction processing, infrastructure adjustment,
and many others. This high-performance server provides solutions for connecting people,
systems, and applications with your internal and external resources.
In cluster , the load balancing that simply redirect the client request to any available server
in weblogic server cluster. Suppose assume we have 4 managed servers and one admin
server. can we trace that request is going to which managed server in the cluster? is it
possible to tell that request is going to which ipaddr/managed server?
whenever the request gets routed from any Load balancer or Web-server to any application
server, the routed request contains a header part which includes information of the server like
Port, Listen address etc based on which it routes to its appropriate server hosting application.
And we can trace this information in web-server log file.
Diff b/w managed server and non managed server? can u briefly explain?
Managed servers are the servers which have one and only one separate Admin server.
Admin server manages all the configurations and resources
for managed servers. No managed server could only be Admin server.
what is digital certificate?
For the purposes of digital signing of documents, verification of digital signatures, and
handling digital certificates in the Java platform, the Java
Cryptography Architecture (JCA) is used. JCA is a specification that gives the
programmers a standard way to access cryptographic services, digital
signatures, and digital certificates.
The Most Important Classes in JCA
java.security.KeyStore
java.security.PublicKey
java.security.PrivateKey
java.security.Cert.Certificate
Digital certifiacte is an electronic document which uses a digital signature to bind together
a public key with an identity — information such as the
name of a person or an organization, their address, and so forth. The certificate can be
used to verify that a public key belongs to an individual.
what is core dump? diff b/w core dump and c dump?
Core dump consists of the recorded state of the working memory of a computer program at
a specific time, generally when the program has
terminated abnormally.A copy of the data stored in the core memory of a computer,
usually used for debugging purposes.
What is advantage if silent mode installation ?
for this sailent mode of installation you need to specify the log file and xml file. The
difference between command and sailent mode is command
-mode=console i.e here step by step are visible but in sailent mode every thing is
configured.
The biggest advantage of silent mode installation is that it is non-interactive and hence
your intervention is not required during installation.
All the parameters to be used during installation are defined in xml file (usually silent.xml)
eg:./filename.bin -mode=silent -silent_xml=silent.xml
What is Connection Pool ?
Answer 1
Pool: Maintain equal instance of objects is called Pool
Connection Pool : the connection objects maintain in the form pool is called connection
pool.
Advantages of Connection Pool: the Connection is very precies . application need
connections getting connections from db and close connection's
it's normal process. if we use connection pool no need hit every time db , get from server(in
con pool) , in the middle server will get the some amount
connections that give the connections . server will take physical connection to db , server
will give to logical connection to application if need more
connections server will increase connections are maintained que process.
Answer 2
Pool: Maintain equal instance of objects is called Pool
Connection Pool : the connection objects maintain in the form pool is called connection
pool.
Adv Con Pool: the Connection is very precies . application need connections getting
connections from db and close.
What is the difference between Connection Pool and data source?
The Connection pool means equals instance of connections and it refereed Data Source
object.
What does 'stub' mean in weblogic server?
clients that connect to a WLS instances and look like a single clustered object obtain a
replica-aware-stub of the object. The stub contains the list of
all the available server instancesof the object.It also has a load balancing logic to distribute
the load across the multiple hosts.
What is managed server ?
Any WebLogic Server instance apart from Administration Server is called as Managed
Servers. This is weblogic server where you deploy your
application (Though you can deploy your application in Administration server as well but
it is not recommended in production/UAT instance).
A weblogic server instance is called managed server.An administration have no of manager
servers.
How to find the heap memory of managedServer?
1. For weblogic 8 you can get the details from
/weblogic81/common/bin/startManagedWebLogic.sh Here there is a parameter set in the
script with
memory details.
2. you can varify it from out file of that server by searching Xms and Xms keyword. in ant
cersion of WLS.
3. use the below command .ps -auwwwx | grep .In the output you will find parameters Xms
and Xmx for heap size.
in which file/script we need to change the heap size?.What is the variable name to search to
change the heap size ?
In start up script,we can change ms and mx value.we can change the heap size in Javaw.exe
file, which is located in bin folder.
what is WLS T3 protocol?
Answer 1. Weblogic's implementationof the RMI specification uses a proprietary wireprotocol
known as T3. javasoft's reference implementation of
RMI uses a proprietary protocol called JRMP. weblogic developed T3 because they needed
a scalable,efficient protocol for building enterprise-class
destributed object systems with java.
Answer 2. T3 provides a framework for WebLogic Server messages that support for
enhancements. These enhancements include abbreviations and
features, such as object replacement, that work in the context of WebLogic Server clusters
and HTTP and other product tunneling. T3 predates Java
Object Serialization and RMI, while closely tracking and leveraging these specifications.
T3 is a superset of Java Object. Serialization or RMI;
anything you can do in Java Object Serialization and RMI can be done over T3. T3 is
mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional
protocols that can be used to communicate between other
processes and WebLogic Server. It depends on what you want to do. For example, when
you want to communicate between a browser and
WebLogic Server-use HTTP, or an ORB and WebLogic Server-IIOP.
Answer 3. T3 protocal is used to communicate betwen the EJB's in the wl serevr instances.
Answer 4. T3 is an optimized protocol used to transport data between WebLogic Server
and other Java programs,including clients and other
WebLogic Servers. WebLogic Server keeps track of every Java Virtual Machine (JVM)
with which it connects, and creates a single T3 connection to
carry all traffic for a JVM.For example, if a Java client accesses an enterprise bean and a
JDBC connection pool on WebLogic Server, a single
network connection is established between the WebLogic Server JVM and the client JVM.
The EJB and JDBC services can be written as if they had
sole use of a dedicated network connection because the T3 protocol invisibly multiplexes
packets on the single connection.
T3 is an efficient protocol for Java-to-Java applications because it avoids unnecessary
network connection events and uses fewer OS resources.
The protocol also has internal enhancements that minimize packet sizes
What happens when database down in weblogic ?
Answer 1 : Connection pool staus changes to suspended.it tries to poll the connection. It
depends on the configuration of connection pool .I will log
an error if
application tires to use the connection pool.
Answer 2 : using connection pool we can retrive the value in the database.
Answer # 3 : in app server u will diffine that connect to which data base according to that
connection will be establised and u can get data from data
base.if the data base is not working then u will get a error page(related to database).if u
want to give 100% availability for clint then u can use failover
concept and place the data in to different databases and give instructions for u r
application that if one data base is fail to serve the data after
partucular time the request will rediirect to another database where data is present.
Answer # 4 : in WLSS 9.2 When DB is down the connection pool/Data source will go to
SUSPENDED state waiting to re-establish the connection
with DB. when DB is up it will automaticaly re-connect with DB . but in the middle if you
re-cycle the server. the server will go to ADMIN mode.
Answer # 5 : Impact only particular application which is using failure database. Mean
while we need to untarget the failure database to aviod erros in
logs. Once DB back needs to target the same.
How to set Connection Pool size in Weblogic Server ?
we can set connection pool size in weblogic server through admin console.At first you have
to login to the adminserver and after putting username
and password you will see connectionpool within service configuration,then you have to go
through the connectionpool and there will be two tab one is
configuration and another will be monitoring.From monitoring tab you can view
maxcapasity and highconnection of connectionpool(jdbc).From that
you can customize the value .
What is multicast Address?
an address that can be used to send the messages to the same host addresses but in different
network addresses.that addresses can be referred
as multicast address.The multicast addresses are in the range 224.0.0.0 to 239.255.255.255.
how can we handle if server is hang? and how to handle out of memory in weblogic?
When a Server is hanging, we can ping the server using java weblogic.Admin
t3://server:port PING. If the server can respond to the ping, it may be
that the application is hanging and not the server itself.
We can use -verbose gc flag to check whether the server is doing the proper garbage
collection or not.
Also we can analyze the thread dumps to check out which thread are actually stucking.
where can we set classpath, which will reflect to whole domain ?
right click on my computer icon->advanced->environment
variables.here you will find to panels
1.path and
2.classpth.
1. go to path click on add
a)name: name of the path variable.
b)value: Absolute path of your bin folder or your application path.
what is the differencees between work manager and executequeue?
1.Unlike execute queues, all WorkManagers share a common thread pool and a prioritybased
queue.
2. The size of the thread pool is determined automatically by the kernel and resized as
needed.
3.WorkManagers become very lightweight, and customers can create WorkManagers
without worrying about the size of the
thread pool.
4.Thread dumps look much cleaner with fewer threads. In the new model, it is possible to
specify different service-level agreements (SLAs) such as
fair shares or response-time goals for the same servlet invocation depending on the user
associated with the invocation.
5.In earlier releases, each servlet or RMI request was associated with a dispatch policy that
mapped to an execute queue.Requests without an
explicit dispatch policy use the server-wide default execute queue. In WebLogic Server 9.0,
requests are still associated with a dispatch policy but
are mapped to a WorkManager instead of to an execute queue.
6.Execute queues are always global whereas WorkManagers are always application scoped.
Even WorkManagers defined globally in the console are
application scoped during runtime. This means that each application gets into own runtime
instance that is distinct from others, but all of them share
the same characteristics like fair-share goals.
7. Another advantage is Thread Count Self-tuning. One of the major differences between
execute queues and the new thread scheduling model is
that the thread count does not need to be set. In earlier releases, customers defined new
thread pools and configured their size to avoid deadlocks
and provide differentiated service. It is quite difficult to determine the exact number of
threads needed in production to achieve optimal throughput
and avoid deadlocks. WebLogic Server 9.0 is self-tuned, dynamically adjusting the number
of threads to avoid deadlocks and
achieve optimal throughput subject to concurrency constraints. It also meets objectives for
differentiated service. These objectives are stated as fair
shares and response-time goals as explained in the next section.
8. Execute Queue concepts used till 8.1+ weblogic releases. Work Manager came from
Weblogic 9+.
dIFFERNCE BETWEEN VERSIONS 8.X,9.X,10.X ?
There are various differences ranging from 8.X,9.X,10.X
1. Changes made in console UI.
2. The node Manager uses the port no 5555 in 8.x and in 10.x it uses 5556.
3. Every functionality should be done only after hitting LOCK AND EDIT option in the
version of 10x, Where as it is not needed in the version of 8.x.
4. There is no need of creating Connection pools in 10.x . Datasource itself directs requests
where as Connection pools should be created in the
version 8.x.
8.x-----------------------------------------9.x and 10.x
1)In 8 no loc& edit option--------1)In 9 lock & edit option
2)here Execute ques are there-----2)here work managers
3)here you can use in node manager portno:-5556--3)5557
What is config.xml.booted file ?
Config.xml.booted file is a replica of config.xml file. It is stored inside the root file of the
admin server.When your msi-config.xml is not running on
independent mode and your config.xml file is destroyed or currupted for any cause,then
you can start your managed server by taking the
configuration from this file.
What is config.xml?
it is heart of the weblogic server and its maintains the all the info about managed and
admin server details like Ipadd,portno...etc, and whenever you
update the admin console that info is updated in config.xml and while restart the
server,server will get details from config.xml only and using we can
deploy the application nothing but hard deployment.
What is DataSource ?how can its associated with connection pools ?
DataSoource is an Interface that is an alternative to Driver manager.It has methods :
getConnection()
getConnection(username,pwd)
...and many more..
Through JNDI it connects with database.Or It takes from Connection pool.
1. What is the difference between URL instance and URLConnection instance? - A URL instance
represents the location of a resource, and a URLConnection instance represents a link for accessing or
communicating with the resource at the location.
2. What are the two important TCP Socket classes? - Socket and ServerSocket. ServerSocket is used for
normal two-way socket communication. Socket class allows us to read and write through the sockets.
getInputStream() and getOutputStream() are the two methods available in Socket class.
3. What technologies are included in J2EE? - The primary technologies in J2EE are: Enterprise
JavaBeansTM (EJBsTM), JavaServer PagesTM (JSPsTM), Java Servlets, the Java Naming and Directory
InterfaceTM (JNDITM), the Java Transaction API (JTA), CORBA, and the JDBCTM data access API.
4. What is the Java Authentication and Authorization Service (JAAS) 1.0? - The Java Authentication
and Authorization Service (JAAS) provides a way for a J2EE application to authenticate and authorize a
specific user or group of users to run it. JAAS is a Java programing language version of the standard
Pluggable Authentication Module (PAM) framework that extends the Java 2 platform security architecture to
support user-based authorization.
5. What’s the difference between JNDI lookup(), list(), listBindings(), and search()? - lookup()
attempts to find the specified object in the given context. I.e., it looks for a single, specific object and either
finds it in the current context or it fails. list() attempts to return an enumeration of all of the
NameClassPair’s of all of the objects in the current context. I.e., it’s a listing of all of the objects in the
current context but only returns the object’s name and the name of the class to which the object belongs.
listBindings() attempts to return an enumeration of the Binding’s of all of the objects in the current context.
I.e., it’s a listing of all of the objects in the current context with the object’s name, its class name, and a
reference to the object itself. search() attempts to return an enumeration of all of the objects matching a
given set of search criteria. It can search across multiple contexts (or not). It can return whatever attributes
of the objects that you desire. It’s by far the most complex and powerful of these options but is also the most
expensive.
6. Components of JNDI - Naming Interface- The naming interface organizes information hierarchically and
maps human-friendly names to addresses or objects that are machine-friendly. It allows access to named
objects through multiple namespaces. Directory Interface - JNDI includes a directory service interface that
provides access to directory objects, which can contain attributes, thereby providing attribute-based
searching and schema support. Service Provider Interface - JNDI comes with the SPI, which supports the
protocols provided by third parties.
7. What is the Max amount of information that can be saved in a Session Object? - As such there is
no limit on the amount of information that can be saved in a Session Object. Only the RAM available on the
server machine is the limitation. The only limit is the Session ID length(Identifier), which should not exceed
more than 4K. If the data to be store is very huge, then it’s preferred to save it to a temporary file onto hard
disk, rather than saving it in session. Internally if the amount of data being saved in Session exceeds the
predefined limit, most of the servers write it to a temporary cache on Hard disk.
8. Must my bean-managed persistence mechanism use the WebLogic JTS driver? - BEA
recommend that you use the TxDataSource for bean-managed persistence.
9. Do EJBs have to be homogeneously deployed across a cluster? Why? - Yes. Beginning with
WebLogic Server version 6.0, EJBs must be homogeneously deployed across a cluster for the following
reasons:
To keep clustering EJBs simple
To avoid cross server calls which results in more efficiency. If EJBs are not deployed on all servers,
cross server calls are much more likely.
To ensure that every EJB is available locally
To ensure that all classes are loaded in an undeployable way
Every server must have access to each EJB’s classes so that it can be bound into the local JNDI tree.
If only a subset of the servers deploys the bean, the other servers will have to load the bean’s classes in
their respective system classpaths which makes it impossible to undeploy the beans.
10. Is an XSLT processor bundled in WebLogic Server? - Yes, an XSLT processor, based on Apache’s
Xalan 2.0.1 processor, in WebLogic Server 6.1.
11. I plugged in a version of Apache Xalan that I downloaded from the Apache Web site, and now
I get errors when I try to transform documents. What is the problem? - You must ensure that the
version of Apache Xalan you download from the Apache Web site is compatible with Apache Xerces version
1.3.1. Because you cannot plug in a different version of Apache Xerces , the only version of Apache Xerces
that is compatible with WebLogic Server 6.1 is 1.3.1. The built-in parser (based on version 1.3.1 of Apache
Xerces) and transformer (based on version 2.0.1 of Apache Xalan) have been modified by BEA to be
compatible with each other.
12. How do I increase WebLogic Server memory? - Increase the allocation of Java heap memory for
WebLogic Server. (Set the minimum and the maximum to the same size.) Start WebLogic Server with the -
ms32m option to increase the allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves performance and
allows WebLogic Server to handle more simultaneous connections. You can increase this value if necessary.
13. What causes Java.io exceptions in the log file of WebLogic Server? - You may see messages like
these in the log file:
(Windows NT) java.io.IOException Connection Reset by Peer java.io.EOFException
Connection Reset by Peer (Solaris) java.io.Exception: Broken pipe
These messages occur when you are using servlets. A client initiates an HTTP request, and then performs a
series of actions on the browser:
Click Stop or enter equivalent command or keystrokes
Click Refresh or enter equivalent command or keystrokes
Send a new HTTP request.
The messages indicate that WebLogic Server has detected and recovered from an interrupted HTTP request.
14. What is the function of T3 in WebLogic Server? - T3 provides a framework for WebLogic Server
messages that support for enhancements. These enhancements include abbreviations and features, such as
object replacement, that work in the context of WebLogic Server clusters and HTTP and other product
tunneling. T3 predates Java Object Serialization and RMI, while closely tracking and leveraging these
specifications. T3 is a superset of Java Object. Serialization or RMI; anything you can do in Java Object
Serialization and RMI can be done over T3. T3 is mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional protocols that can be used
to communicate between other processes and WebLogic Server. It depends on what you want to do. For
example, when you want to communicate between a browser and WebLogic Server-use HTTP, or an ORB
and WebLogic Server-IIOP.
15. What are the enhancements in EJB 2.0 specification with respect to Asynchronous
communication? - EJB 2.0 mandates integration between JMS and EJB. We have specified the
integration of Enterprise JavaBeans with the Java Message Service, and have introduced message-driven
beans. A message-driven bean is a stateless component that is invoked by the container as a result of the
arrival of a JMS message. The goal of the message-driven bean model is to make developing an enterprise
bean that is asynchronously invoked to handle the processing of incoming JMS messages as simple as
developing the same functionality in any other JMS MessageListener.
16. What are the enhancements in EJB 2.0 with respect to CMP? - EJB 2.0 extends CMP to include far
more robust modeling capability, with support for declarative management of relationships between entity
EJBs. Developers no longer need to re-establish relationships between the various beans that make up their
application — the container will restore the connections automatically as beans are loaded, allowing bean
developers to navigate between beans much as they would between any standard Java objects.
EJB 2.0 also introduces for the first time a portable query language, based on the abstract schema, not on
the more complex database schema. This provides a database and vendor-independent way to find entity
beans at run time, based on a wide variety of search criteria.
17. Can you briefly describe local interfaces? - EJB was originally designed around remote invocation
using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard
CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing
applications without consideration for the deployment scenario, and was a strong feature in support of a goal
of component reuse in J2EE. Many developers are using EJBs locally - that is, some or all of their EJB calls
are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a
local interface mechanism. The local interface may be defined for a bean during development, to allow
streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved
with RMI like marshalling etc. This facility will thus improve the performance of applications in which colocation
is planned. Local interfaces also provide the foundation for container-managed relationships among
entity beans with container-managed persistence.
18. What are the special design care that must be taken when you work with local interfaces? - It
is important to understand that the calling semantics of local interfaces are different from those of remote
interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local
interfaces use call-by-reference. This means that in order to use local interfaces safely, application
developers need to carefully consider potential deployment scenarios up front, then decide which interfaces
can be local and which remote, and finally, develop the application code with these choices in mind. While
EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices,
especially when changing requirements and component reuse are taken into account, need to be factored
into the design decision.
19. What happens if remove( ) is never invoked on a session bean? - In case of a stateless session bean
it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed
by the container. In case of stateful session bean, the bean may be kept in cache till either the session times
out, in which case the bean is removed or when there is a requirement for memory in which case the data is
cached and the bean is sent to free pool.
20. What is the difference between creating a distributed application using RMI and using a EJB
architecture? - It is possible to create the same application using RMI and EJB. But in case of EJB the
container provides the requisite services to the component if we use the proper syntax. It thus helps in easier
development and lesser error and use of proven code and methodology. But the investment on application
server is mandatory in that case. But this investment is warranted because it results in less complex and
maintainable code to the client, which is what the end client wants. Almost all the leading application servers
provide load balancing and performance tuning techniques. In case of RMI we have to code the services and
include in the program the way to invoke these services.
21. Why would a client application use JTA transactions? - One possible example would be a scenario in
which a client needs to employ two (or more) session beans, where each session bean is deployed on a
different EJB server and each bean performs operations against external resources (for example, a database)
and/or is managing one or more entity beans. In this scenario, the client’s logic could required an all-ornothing
guarantee for the operations performed by the session beans; hence, the session bean usage could be
bundled together with a JTA UserTransaction object. In the previous scenario, however, the client
application developer should address the question of whether or not it would be better to encapsulate these
operations in yet another session bean, and allow the session bean to handle the transactions via the EJB
container. In general, lightweight clients are easier to maintain than heavyweight clients. Also, EJB
environments are ideally suited for transaction management.
Context c = new InitialContext(); UserTransaction ut = (UserTransaction)
c.lookup("java:comp/UserTransaction"); ut.begin(); // perform multiple
operations... ut.commit() ...
22. Can the bean class implement the EJBObject class directly? If not why? - It is better not to do it
will make the Bean class a remote object and its methods can be accessed without the containers? security,
and transaction implementations if our code by mistake passed it in one of its parameters. Its just a good
design practice.
23. What does isIdentical() method return in case of different type of beans? - Stateless - true
always. Stateful - depends whether the references point to the same session object. Entity - Depends whether
the primary key is the same and the home is same.
24. How should you type cast a remote object? Why? - A client program that is intended to be
interoperable with all compliant EJB Container implementations must use the
javax.rmi.PortableRemoteObject.narrow(…) method to perform type-narrowing of the client-side
representations of the remote home and remote interfaces. Programs using the cast operator for narrowing
the remote and remote home interfaces are likely to fail if the Container implementation uses RMI-IIOP as
the underlying communication transport.
25. What should you do in a passive method? - You try to make all nontransient variables, which are not
one of the following to null. For the given list the container takes care of serializing and restoring the object
when activated. Serializable objects, null, UserTransaction, SessionContext, JNDI contexts in the beans
context, reference to other beans, references to connection pools.
Things that must be handled explicitly are like a open database connection etc. These must be closed and set
to null and retrieved back in the activate method.
What is BEA Weblogic?
BEA WebLogic is a J2EE application server and also an HTTP web server by BEA Systems
of San Jose, California, for Unix, Linux, Microsoft Windows, and other platforms. WebLogic
supports Oracle, DB2, Microsoft SQL Server, and other JDBC-compliant databases.
WebLogic Server supports WS-Security and is compliant with J2EE 1.3.
BEA WebLogic Server is part of the BEA WebLogic Platform™. The other parts of
WebLogic Platform are:
* Portal, which includes Commerce Server and Personalization Server (which is built on a
BEA-produced Rete rules engine),
* WebLogic Integration,
* WebLogic Workshop, an IDE for Java, and
* JRockit, a JVM for Intel CPUs.
WebLogic Server includes .NET interoperability and supports the following native
integration capabilities:
* Native enterprise-grade JMS messaging
* J2EE Connector Architecture
* WebLogic/Tuxedo Connector
* COM+ Connectivity
* CORBA connectivity
* IBM WebSphere MQ connectivity
BEA WebLogic Server Process Edition also includes Business Process Management and
Data Mapping functionality.
WebLogic supports security policies managed by Security Administrators. The BEA
WebLogic Server Security Model includes:
* Separate application business logic from security code
* Complete scope of security coverage for all J2EE and non-J2EE components
Which of the following statements are true regarding MDBs (Message Driven
Beans) on version 6.0 of WebLogic App Server?
a. MDBs support concurrent processing for both Topics and Queues.
b. MDBs support concurrent processing for only Topics.
c. MDBs support concurrent processing for only Queues.
d. MDBs support concurrent processing neither Topics nor Queues.
Choice A is correct. MDBs support concurrent processing for both Topics and
Queues. Previously, only concurrent processing for Queues was supported. To ensure
concurrency, change the weblogic-ejb-jar.xml deployment descriptor max-beans-infree-
pool setting to >1. If this element is set to more than one, the container will
spawn as many threads as specified. WebLogic Server maintains a free pool of EJBs
for every stateless session bean and message driven bean class.
The max-beans-in-free-pool element defines the size of this pool. By default, maxbeans-
in-free-pool has no limit; the maximum number of beans in the free pool is
limited only by the available memory.
Can I use a "native" two-tier driver for a browser applet?
No. Within an unsigned applet, you cannot load native libraries over the wire, access
the local file system, or connect to any host except the host from which you loaded the
applet. The applet security manager enforces these restrictions on applets as protection
against applets being able to do unsavory things to unsuspecting users.
If you are trying to use jDriver for Oracle from an applet, then you are violating the
first restriction. Your applet will fail when it attempts to load the native (non-Java
layer) library that allows jDriver for Oracle to make calls into the non-Java Oracle
client libraries. If you look at the exception that is generated, you will see that your
applet fails in java.lang.System.loadLibrary, because the security manager determined
that you were attempting to load a local library and halted the applet.
You can, however, use the WebLogic JTS or Pool driver for JDBC connectivity in
applets. When you use one of these WebLogic multitier JDBC drivers, you need one
copy of WebLogic jDriver for Oracle (or any other two-tier JDBC driver) for the
connection between the WebLogic Server and the DBMS.
I'm using a WebLogic multitier driver in an applet as an interface to a DBMS. If I run
the class using the Sun Appletviewer on my local machine, I have no problems. But
when I try to run the applet in a Netscape browser, it will not connect.
If Appletviewer works and Netscape does not, it is an indication that you are violating
a Netscape security restriction. In this case, the violation is that an applet cannot open
a socket to a machine other than the one from which it loaded the applet. To solve this
problem, you will have to serve your applet code from the same machine that hosts
the DBMS.
In addition, the IP naming format you use in the applet CODEBASE and the
constructor for the T3Client must match. That is, you can't use dot-notation in one
place and a domain name in the other.
I tried to run two of the applets in the examples directory of the distribution. I installed the
WebLogic classes on my local machine (NT server) and on another machine (a Windows 95
client). I am not using any browsers, just trying to run the applets with Appletviewer. The applets
work fine when I run Appletviewer from the NT server, but do not work at all from the Windows 95
client.
There are two possible problems: Either the CODEBASE tag is not properly set in the
applet HTML file, or the class files are not properly loaded on the HTTP server.
The applet works on the NT server because you installed the WebLogic distribution on your
NT server. Even if the applet cannot successfully load the necessary classes from the
HTTP server, it does find them in your local CLASSPATH. But when you try to run it from
the Windows 95 client, the applet must load the classes over the wire from the HTTP
server, and if you haven't installed them correctly, it will fail.
The two primary cluster services provided by WebLogic Server are?
a. Http Session State Clustering
b. File Service Clustering
c. Time Service Clustering
d. Object Clustering
e. Event Clustering
Choices A and D are correct. A WebLogic Server cluster is a group of servers that
work together to provide a more scalable and reliable application platform than a
single server. A clustered service is an API or interface that is available on multiple
servers in the cluster. HTTP session state clustering and object clustering are the two
primary cluster services that WebLogic Server provides. WebLogic Server also
provides cluster support for JMS destinations and JDBC connections. WebLogic
Server provides clustering support for servlets and JSPs by replicating the HTTP
session state of clients that access clustered servlets and JSPs. To benefit from HTTP
session state clustering, you must ensure that the session state is persistent, either by
configure in-memory replication, file system persistence, or JDBC persistence. If an
object is clustered, instances of the object are deployed on all WebLogic Servers in
the cluster. The client has a choice about which instance of the object to call. This is
Object Clustering. The APIs and internal services that cannot be clustered in
WebLogic Server version6.0 are File services, Time services, WebLogic Events,
Workspaces and ZAC.
How do stubs work in a WebLogic Server cluster?
Clients that connect to a WebLogic Server cluster and look up a clustered object
obtain a replica-aware stub for the object. This stub contains the list of available
server instances that host implementations of the object. The stub also contains the
load balancing logic for distributing the load among its host servers.
What happens when a failure occurs and the stub cannot connect to a WebLogic Server instance?
When the failure occurs, the stub removes the failed server instance from its list. If
there are no servers left in its list, the stub uses DNS again to find a running server
and obtain a current list of running instances. Also, the stub periodically refreshes its
list of available server instances in the cluster; this allows the stub to take advantage
of new servers as they are added to the cluster.
Why did my JDBC code throw a rollback SQLException?
Your JDBC code may throw the following exception:
"The coordinator has rolled back the transaction.
No further JDBC access is allowed within this transaction."
The WebLogic JTS JDBC driver throws this exception when the current JDBC
connection transaction rolls back prior to or during the JDBC call. This exception
indicates that the transaction in which the JDBC connection was participating was
rolled back at some point prior to or during the JDBC call.
The rollback may have happened in an earlier EJB invoke that was part of the
transaction, or the rollback may have occurred because the transaction timed out. In
either case, the transaction will be rolled back, the connection returned to the pool and
the database resources released. In order to proceed, the JTS JDBC connection must
be closed and reopened in a new transaction.
Must my bean-managed persistence mechanism use the WebLogic JTS driver?
Use the TxDataSource for bean-managed persistence.
Why is there no polymorphic-type response from a create() or find() method?
The EJB Specification prohibits this behavior, and the weblogic.ejbc compiler checks
for this behavior and prohibits any polymorphic type of response from a create() or
find() method.
The reason the create() and find() methods are not polymorphic is similar to the
reason constructors are not polymorphic in Java. The derived classes generally do not
know or cannot initialize the base class properly.
Must EJBs be homogeneously deployed across a cluster? Why?
Yes. Beginning with WebLogic Server version 6.0, EJBs must be homogeneously
deployed across a cluster for the following reasons:
* To keep clustering EJBs simple
* To avoid cross server calls which results in more efficiency. If EJBs are not
deployed on all servers, cross server calls are much more likely.
* To ensure that every EJB is available locally
* To ensure that all classes are loaded in an undeployable way
* Every server must have access to each EJB's classes so that it can be bound into the
local JNDI tree. If only a subset of the servers deploys the bean, the other servers will
have to load the bean's classes in their respective system classpaths which makes it
impossible to undeploy the beans.
Which of the following are recommended practices to be performed in the
ejbPassivate() method of a stateful session bean?
a. Close any open resources, like database connections
b. All non-transient, non-serializable fields(except some special types) should be set
to null.
c. All transient fields should be set to null
d. Make all database connection reference fields transient
e. All primitive type fields should be set to null
Choices A, B and D are correct. When a bean is about to be passivated, its ejbPassivate()
method is invoked, alerting the bean instance that it is about to enter the Passivated state.
At this time, the bean instance should close any open resources and set all non transient,
non serializable fields to null. This will prevent problems from occurring when the bean is
serialized. Transient fields will simply be ignored.Serializable fields will be saved. Open
resources such as sockets or JDBC connections must be closed whenever the bean is
passivated. In stateful session beans, open resources will not be maintained for the life of
the bean instance. When a stateful session bean is passivated, any open resource can
cause problems with the activation mechanism.
A bean's conversational state may consist of only primitive values, objects that are
serializable, and the following special types-SessionContext, EJBhome, EJBObject,
UserTransaction and Context (only when it references the JNDI ENC) . The types in this list
(and their subtypes) are handled specially by the passivation mechanism. They don't need
to be serializable; they will be maintained through passivation and restored automatically to
the bean instance when it is activated
While packaging the Web Application DefaultWebApp for deployment into the
WebLogic server, the home and remote interfaces of the enterprise beans used by
the servlets should reside in which directory?
a. DefaultWebApp/META_INF/classes
b. DefaultWebApp/META_INF/lib
c. DefaultWebApp/WEB_INF/lib
d. DefaultWebApp/WEB_INF/classes
e. DefaultWebApp/classes
Choice D is correct. When packaging a web application create META-INF and WEB-INF subdirectories in
the application directory to hold deployment descriptors and compiled Java classes. All servlet classes
and helper classes should reside in the WEB-INF/classes subdirectory. The home and remote interface
classes for enterprise beans used by the servlets into the WEB-INF/classes subdirectory.
All the HTML files, JSP files, images, and any other files that these Web pages reference should exist in
the application directory, maintaining the directory structure for referenced files. The META_INF directory
contains the deployment descriptors for the enterprise beans, but not the classes.
How do I set up my CLASSPATH?
Setting up your CLASSPATH correctly depends on what you are trying to do. The most common tasks
are described below:
* Starting WebLogic Server. See Setting the Classpath Option in the Starting and Stopping WebLogic
Servers section of the Administration Guide. In addition, your WebLogic distribution includes shell scripts
that you can use to start the server. These scripts, which are located in the domain directories under the
config directory of your WebLogic Server distribution, automatically set up the CLASSPATH variable in
the shell before starting the server.
Why do I get the following exception when viewing the JNDI tree?
isSerializable(class.javax.naming.Binding)
java.io.NotSerializableException:
java.io.PrintWriter at
java.io.ObjectOutputStream.OutputObject
The Weblogic Server JNDI implementation requires objects to be serializable, not referencable. A
PrintWriter cannot be serialized and therefore should be declared transient.
When deploying a resource adapter (.rar) to WebLogic Server, are its classes placed
in the WebLogic classpath?
For instance, I am deploying an EJB and a resource adapter (.rar), the EJB has no
dependencies on the .rar because the EJB is writing to the common client interface
(CCI). The EJB client application has sends/marshals as parameter classes that are
defined in the .rar. For some reason the EJB's class loader hierarchy cannot find the
definition of this .rar-specific class, even though the .rar is deploying successfully. I
receive the following error on the EJB client:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception
is:
java.lang.ClassNotFoundException:
com.mycompany.InteractionSpecImpl
When you pass an instance of com.myclientcompany.server.eai.InteractionSpecImpl as an argument to
your EJB, the appServer needs to de-serialize (unmarshal) the object under the EJB context, and it needs
the required class for unmarshalling, inside the ejb-jar(raTester.jar). So if you include the
interactionspecimpl class in your ejb-jar file, then you do not need to include those classes in your
server's classpath.
How is security handled in the WebLogic J2EE Connector Architecture?
Due to the fact that the current configuration and packaging requirements for resource adapters in
WebLogic Server require the hand-editing of the weblogic-ra.xml file, any new passwords specified in the
security-principal-map entries are done in clear-text.
BEA understands the importance of protecting security passwords. Hence, we provide a Converter Tool
that allows for the encryption of all passwords present in the weblogic-ra.xml file. The Converter Tool is
shipped in the standard weblogic.jar file.
Can I enable requests to a JDBC connection pool for a database connection to wait
until a connection is available?
No, there's no way to allow a request to wait for a pool connection, and from the system point of view
there should not be. Each requests that waits for a connection ties up one of the fixed number of execute
threads in the server, which could otherwise be running another server task. Too many waiting requests
could tie up all of the execute threads and freeze the server.
How do I use multibyte character sets with WebLogic jDriver for Informix?
Currently, multibyte character sets are not supported for the WebLogic jDriver for Informix driver.
How do I connect to an SQL Server instance that is running on a machine with
multiple instances of SQL Server 2000?
Each instance of MS SQL Server must be listening on a different port. So, you can use the port number in
the properties that you pass to the getConnection() method or, in case of connection pools, you can
specify the port property in the following properties:
server=machineName
port=instancePort
To find the port number where each MS SQL Server instance is running, run the server network utility (in
the Microsoft SQL Server program group), select the server instance, select TCP/IP, and click the
properties button.
Why does FOR UPDATE in Oracle 8 cause an ORA-01002 error?
The Oracle 8 server generates an ORA-01002:fetch out of sequence error message when you use a FOR
UPDATE statement with AUTOCOMMIT turned on (which is the default state when using JDBC). This is
known to happen on Oracle 8.0 and 8.1 on Solaris and on Oracle 8.1 on Windows NT. If you turn
AUTOCOMMIT off, you will not receive this error. Because this problem is due to a change in the Oracle
8 server, you should contact Oracle support for more information.
What causes an OCIW32.dll error?
You may receive the following error message when using your JDBC driver for Oracle: "The ordinal 40
could not be loaded in the dynamic link library OCIW32.dll." This problem is caused by an out-of-date
version of OCIW32.DLL in your system directory. Some programs install this file in the system directory in
order to run. If you remove this file from the system directory you should no longer receive this error.
What transaction isolation levels does the WebLogic jDriver for Oracle support?
Your servlet application may use Oracle Thin Drivers to access a database that includes BLOB fields. If
you install and try to use WebLogic jDriver for Oracle and the same code fails and produces an exception
similar to the following:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
The Stack Trace:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
at
com.roguewave.jdbtools.v2_0.jdbc.JDBCServer.createConnection
(JDBCServer.java :46)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection_
(ConnectionPool.jav a:412)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection
(ConnectionPool.java :109)
Setting the Isolation_level to 1 in the code that calls the RogueWave JDBCServer class works with the
Oracle thin driver but fails with WebLogic jDriver for Oracle.
WebLogic jDriver for Oracle supports the following transaction isolation levels:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
According to the Oracle documentation, the Oracle DBMS only supports these two isolation levels. Unlike
other JDBC drivers, WebLogic's drivers throw an exception if you try to use an isolation level that is
unsupported. Some drivers silently ignore attempts to set an unsupported isolation level. WebLogic
suggests testing whether the Oracle thin driver is not just ignoring settings for unsupported isolation
events.
How do I use OS Authentication with WebLogic jDriver for Oracle and Connection
Pools?
Using OS authentication in connection pools essentially means that you are using the
UserId of the user who started WebLogic Server. OS authentication is available on NT and
UNIX, but not on Solaris. This means that database security will rely strictly on the
security of WebLogic; that is, if you are allowed to make a client connection to the
WebLogic Server and access the pool, then you can get to the database.
You can do this with WebLogic jDriver for Oracle because Oracle uses the process owner to
determine who is attempting the connection. In the case of WebLogic JDBC, this is always
the user that started the WebLogic Server.
To set up your Oracle instance to use this feature, your DBA needs to follow these basic
steps. The full procedure is described in more detail in your Oracle documentation.
1. Add the following line to the INIT[sid].ORA file:
OS_AUTHENT_PREFIX = OPS$
Note that the string "OPS$" is arbitrary and up to the DBA.
2. Log in to the Oracle server as SYSTEM.
3. Create a user named OPS$userid, where userid is some operating system login ID. This
user should be granted the standard privileges (for example, CONNECT and RESOURCE).
4. Once the userid is set up, you can connect with WebLogic jDriver for Oracle by
specifying "/" as the username property and "" as the password property. Here is an
example for testing this connection with the dbping utility:
$ java utils.dbping ORACLE "/" "" myserver
Here is a code example for WebLogic jDriver for Oracle:
Properties props = new Properties();
props.put("user", "/");
props.put("password", "");
props.put("server", "myserver");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:oracle",
props);
1. Use the Administration Console to set the attribute for your connection pool. The
following code is an example of a JDBC connection pool configuration using the WebLogic
jDriver for Oracle:
<JDBCConnectionPool
Name="myPool"
Targets="myserver,server1"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="1"
MaxCapacity="10"
CapacityIncrement="2"
Properties="databaseName=myOracleDB"
What type of object is returned by ResultSet.getObject()?
WebLogic jDriver for Oracle always returns a Java object that preserves the precision of
the data retrieved. WebLogic jDriver for Oracle returns the following from the getObject()
method:
* For columns of types NUMBER(n) and NUMBER(m,n): a Double is returned if the defined
precision of the column can be represented by a Double; otherwise BigDecimal is returned.
* For columns of type NUMBER: Because there is no explicit precision, the Java type to
return is determined based on the actual value in each row, and this may vary from row to
row. An Integer is returned if the value has a zero-valued fractional component and the
value can be represented by an integer.
For example, 1.0000 will be an integer. A long is returned for a value such as
123456789123.00000. If a value has a non-zero fractional component, a Double is
returned if the precision of the value can be represented by a Double; otherwise a
BigDecimal is returned.
How do I limit the number of Oracle database connections generated by WebLogic
Server?
You can use connection pools to limit the number of Oracle database connections
generated by WebLogic Server in response to client requests. Connection pools allow T3
applications to share a fixed number of database connections. For information on how to
set up connection pools,
How do I call Oracle stored procedures that take no parameters?
Here is what we use that works:
CallableStatement cstmt = conn.prepareCall("Begin procName;
END;");
cstmt.execute();
where procName is the name of an Oracle stored procedure. This is standard Oracle SQL
syntax that works with any Oracle DBMS. You might also use the following syntax:
CallableStatement cstmt = conn.prepareCall("{call procName};");
cstmt.execute();
This code, which conforms to the Java Extended SQL spec, will work with any DBMS, not
just Oracle.
Why do I get unexpected characters from 8-bit character sets in WebLogic jDriver
for Oracle?
If you are using an Oracle database with an 8-bit character set on Solaris, make sure you
set NLS_LANG to the proper value on the client. If NLS_LANG is unset, it defaults to a 7-
bit ASCII character set, and tries to map characters greater than ASCII 128 to a
reasonable approximation (for example, á, à, â would all map to a). Other characters are
mapped to a question mark (?).
How do I learn what codesets are available in Oracle?
To find out what codesets you currently have available in Oracle, execute the following
SQL query from SQLPlus at the command line:
SQL> SELECT value FROM v$nls_valid_values WHERE parameter='CHARACTERSET';
The response lists of all codesets currently installed on your system. This listing will look
something like the following shortened list:
VALUE
---------------
US7ASCII
WE8DEC
WE8HP
US8PC437
WE8EBCDIC37
WE8EBCDIC500
WE8EBCDIC285
...
If you want to constrain the value in the query to a specific codeset you are searching for,
you might use a SQL query like the following:
SQL> SELECT value FROM v$nls_valid_values
WHERE parameter='CHARACTERSET' and VALUE='AL24UTFFSS';
This would produce the following response if the codeset is installed:
VALUE
-------------------
AL24UTFFSS
You can use Oracle's installation tools to install additional codesets. Contact Oracle for
more information.
How many deployment descriptor files does a CMP entity bean deployed on the
WebLogic Server have?
a. One J2EE specific deployment descriptor and two WebLogic specific deployment
descriptors
b. One J2EE specific deployment descriptor and one WebLogic specific deployment
descriptors
c. One J2EE specific deployment descriptor only
d. One WebLogic specific deployment descriptor only
Choice A is correct. Deployment descriptors are text documents formatted with XML tags.
The J2EE specifications define standard, portable deployment descriptors for J2EE
components and applications. BEA defines additional WebLogic-specific deployment
descriptors required to deploy a component or application in the WebLogic Server
environment.
When packaging an enterprise bean, we need to create an ejb-jar.xml deployment
descriptor in the META-INF subdirectory and add entries for the bean. We also need to
create a weblogic-ejb-jar.xml deployment descriptor in the META-INF subdirectory and add
entries for the bean. If the bean is an entity bean with container-managed persistence,
first we create a weblogic-rdbms-cmp-jar-bean_name.xml deployment descriptor in the
META-INF directory with entries for the bean. Then we map the bean to this CMP
deployment descriptor with a attribute in the weblogic-ejb-jar.xml file.
Why do I get an error while trying to retrieve the text for ORA-12705?
This error occurs when you have not set the ORACLE_home environment variable properly
— a common mistake. In order to use WebLogic jDriver for Oracle, the Oracle client
software needs to be installed and ORACLE_home must be set.
You may also see this error message if you try to use WebLogic jDriver for Oracle's
internationalization capabilities with a language/codeset combination that is not installed
on your system. If you get the ORA-12705 error with the correct error text, then either you
have set NLS_LANG improperly, or you do not have the right codesets installed on your
system.
Why do I run out of resources during updates with Oracle's database link?
When you use Oracle's database link to update your database, you may get error
"maximum number of temporary table locks exceeded" even if you close your result sets
and statements when you finish.
The database link is an object in the local database that allows you to access tables, views,
and such in a remote database. The database link is controlled by the Oracle server, so the
driver has no control over its use of resources. The link appears to perform the commit
(since other processes could see the records that were being created), but it doesn't free
any resources until the connection is closed. The solution is to remove the database link
and use the JDBC driver to do your selects, inserts, and updates.
How do I prevent errors when running t3dbping?
When you are testing your Oracle database connections under UNIX, you can run
SQL*PLUS and can successfully ping the database using utils.dbping. However, when you
use the multitier utils.t3dbping utility, you receive an ORA-12154 error message.
First, make sure that your ORACLE_home environment variable is correctly set to point to
your Oracle installation. This variable must be set in the environment where the WebLogic
server is running.
In the C-shell issue the following command:
$ setenv ORACLE_home path
where path is the path to your Oracle installation.
In the Bourne shell, issue the following commands:
$ ORACLE_home=path
$ export ORACLE_home
Where path is the path to your Oracle installation. When you ping your database
using the two-tier utils.dbping utility, the JDBC driver loads the database client
library and establishes the connection to the database. When you use the multitier
utils.t3dbping utility, the WebLogic Server loads a two-tier driver and uses it to
establish a database connection. In both cases, the same method is used to
connect to the database. SQL*PLUS works because it doesn't require
ORACLE_home to find the client libraries.
If you are still experiencing problems, try this:
1. Open a command shell.
2. Run the two-tier version of utils.dbping in this shell.
3. Start WebLogic in this shell from the command line:
$ java -ms32m -mx32m weblogic.server
4. Open a second command shell.
5. Run the utils.t3dbping in the second shell against the server running in the first
command shell.
If this procedure doesn't work, please send the output from these commands to WebLogic
technical support.
Why does executing the PreparedStatement class cause a "TRUNC fails: ORA-00932:
inconsistent datatypes" error?
According to Oracle Metalink Bug Database Doc ID: 144784.1, in the absence of explicit
data typecasting, OCI assumes that a bind variable is a CHAR data type. If the SQL
statement intends to use the bind variable as a DATE data type, but OCI thought it was a
CHAR, the SQL parser will have a conflict in data types. The fix is to explicitly use data
conversion functions to convert the bind variables in the problem queries. For example, a
select string of
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(?)";
should be changed to:
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(TO_DATE(?))";
Why am I getting an "ORA-01000: maximum open cursors exceeded" error, even
though I closed all ResultSet, Statement, and Connection objects?
This is an Oracle issue. According to Oracle's documentation, dynamic cursors can remain
open from run to run in a session and are not closeable when a procedure closes. To work
around this issue, you can increase the number of open cursors allowed in the database
or you can reset the connection pool (close and reopen database connections in the
connection pool).
To reset the connection pool, you can untarget and retarget the connection pool using the
Administration Console. You can also use the reset() method through the JMX API or the
RESET_POOL command on the WebLogic Server command line interface.
An instance of stateful session EJB when accessed simultaneously from more than
one clients on same VM results in RemoteException or EJBException. In case the
client is a Servlet thread, which of the following techniques can be used to avoid
RemoteException/EJBException?
a. Not possible.
b. Store the reference to the EJB instance as an instance variable of Servlet class.
c. Store the reference to the EJB instance as a local variable of Servlet class.
d. Make the Servlet client to be remote instead of internal to WebLogic server.
Choice C is the correct choice. An instance of a stateful session EJB can be accessed from
only one client virtual machine at a time. Multiple client threads from the same virtual
machine can access the same instance of a stateful session EJB, but they must do so in a
serial fashion. If a client-invoked business method is in progress on an instance when
another client-invoked call, from the same or different client, arrives at the same instance
of a stateful session bean class, the container may throw the java.rmi.RemoteException to
the second client , if the client is a remote client, or the javax.ejb.EJBException, if the
client is a local client. Thus choice D is incorrect.
To avoid any exception, each Servlet should store a reference to a particular EJB instance
in a local variable of the Servlet's service() method. Please note that variables local to
methods like service(), doGet(), doPost() are not shared between different requests and are
automatically thread safe. Thus choice C is correct. An instance variable unlike local
variable is shared. Thus Choice B is incorrect.
An implication of this rule is that an application cannot make loop back calls to a session
bean instance.
This restriction does not apply to a stateless session bean because the container routes
each request to a different instance of the session bean class.
Are there C/C++ interfaces to WLS JMS?
No, this is not supported.
* Write your own interfaces using JNI.
* Setup a Servlet that your C/C++ client calls to generate a JMS message. You should
spawn multiple threads in C++ and use multiple posts to pass messages via http.
How do I start WLS and configure JMS?
On Windows, start WLS 6.X by selecting Start -< Programs -< BEA WebLogic E-Business
Platform -< WebLogic Server 6.X -< Start Default Server and enter the administrator
password.
On Windows, to configure JMS, start the console by selecting Start -< Programs -< BEA
WebLogic E-Business Platform -< WebLogic Server 6.X -< Start Default Console.
1. In the console tree view on the left, select JMS.
2. If you want persistent messages, first create a Store - Select Stores. In the window on
the right, Select Create a new JMSFile Store for a file store, give it a name, give it a
directory, select create. If you want a JDBCStore, you first need to create a JDBC
connection pool by selecting JDBC in the tree view, Connection Pools, create a new JDBC
Connection Pool. Select Targets, select a Target server, select the arrow that points to the
right and select Apply. Then go back to Stores, Create a new JMSJDBCStore.
3. If you want to use a template, first create a Template - Select Templates. You need a
template to create temporary queues. Select Create a new JMS Template, give it a name,
select create, then you can move to the Thresholds &Quotas tab or the Override tab. Select
Apply when done with your changes.
4. Select Servers. Select Create a new JMSServer, give it a name, select a Store if you
created one, select a template if you created one, Select Create. Now you can move to the
other tabs, make changes, select Apply. In particular, you must select Targets, select a
Target server, select the arrow that points to the right, and select Apply. This is the server
on which JMS will boot.
5. Create Destinations - from the tree view in the left panel, select the + in front of JMS,
select the + in front of Servers, select the + in front of your server, select Destinations,
Select Create a new JMSQueue or Create a new JMSTopic, fill in the first page and Select
Create, then you can select, fill in, and Apply other tabs.
6. Create Connection Factories - on left tree view, open JMS. Select Connection Factory.
Select Create a new JMS Connection Factory on the right panel. Type in the name and
JNDI name. Select Create (lower right hand corner). Select the Targets tab. Select the
name of the server on which you want to deploy the connection factory. Select the arrow
pointing to the right - the server moves to chosen. Then select Apply (lower right hand
corner).
How do I configure JMS security?
The correct way to set up security for JMS is to go to the console, select ACLs in the tree
view, then create some access control lists.
1. Set the ACL name which should be weblogic.jms.queue.QUEUENAME or
weblogic.jms.topic.TOPICNAME.
2. Select Create.
3. Enter the New Permission of send or receive.
4. Select Create.
5. Enter a comma separated list of users or groups.
6. Select Grant Permission.
7. Select "saved to the realm implementation" to save your changes.
8. Select Yes.
This will update the fileRealm.properties file with lines that look like the following:
acl.send.weblogic.jms.queue.TestQueue1=user1
acl.receive.weblogic.jms.queue.TestQueue1=user1
If you don't have an ACL for a queue or topic, security is wide open.
There are also ACL's for accessing the JNDI context; the JNDI context is a requirement for
initially accessing JMS. See the JNDI documentation.
Can I still use the default connection factories supported in WebLogic Release 5.1?
Yes. The following two names for the default connection factories have been deprecated:
javax.jms.QueueConnectionFactory
javax.jms.TopicConnectionFactory.
However, these connection factories are still defined and usable in this release for
backwards compatibility.
WebLogic JMS 6.1 defines one connection factory, by default:
weblogic.jms.ConnectionFactory
You have to Enable the JMS default connection factories. Go to the console->your server-
>tuning->click on the check box Enable Default JMS Connection Factories.
You can also specify user-defined connection factories using the Administration Console.
Why does JMSSession.createTopic or JMSSession.createQueue fail to create a
destination in WLS JMS 6.1 (it worked in 5.1)?
In WLS 5.1 createTopic() or createQueue() creates the destination permanently in the
database if it doesn't already exist, but does not modify the weblogic.properties file.
According to the JavaSoft JMS specification version 1.0.2 regarding createQueue() and
createTopic(), they are not for creating destinations dynamically. They are used to retrieve
the destination referenced by using a string name instead of using JNDI lookup. The
destination has to be in your config.xml file first. This change is documented in WLS 6.0
since it behaves differently than the previous release. You can use the WLS JMS helper
class (weblogic.jms.extensions.JMSHelper) or the console to create destinations at the run
time (note that there was a bug in 6.0 that caused a problem when the server restarted;
this is fixed in Service Pack 1). These mechanisms create the destination and also modify
the configuration file.
For more information on the JMSHelper classes, see the subsection called Creating
Destinations Dynamically in Programming WebLogic JMS.
The following program creates a Topic.
import java.io.*;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.*;
import weblogic.jms.extensions.JMSHelper;
class t {
public final static String
JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
public final static String JMS_SERVER_NAME="TestJMSServer";
public final static String DEST_JNDI_PREFIX="javax.destination.";
static public void main(String [] args) throws Exception {
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(env);
String topicName = "JMSHelperTestQueue01";
String topicJNDI = DEST_JNDI_PREFIX + topicName;
System.out.println("topic name=" + topicName + ", jndi=" +
topicJNDI);
JMSHelper.createPermanentTopicAsync(ctx, JMS_SERVER_NAME,
topicName,
topicJNDI);
} catch (JMSException e) {
e.printStackTrace();
}
}
}
How do I programmatically get a list of Queues or Topics?
The following program uses Mbeans:
import weblogic.management.*;
import weblogic.management.configuration.*;
InitialContext ic = new InitialContext();
MBeanhome home = (MBeanhome)ic.lookup(MBeanhome.ADMIN_JNDI_NAME);
for(Iterator i = o.getMBeansByType("JMSTopic").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("topic name found: " + wmb.getName());
}
for(Iterator i = o.getMBeansByType("JMSQueue").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("queue name found: " + wmb.getName());
}
How do I use a temporary destination?
You must create a template on every JMSServer where you want to be able to create
temporary destinations. You can specify multiple JMSServer entries to support
TemporaryTemplate and the system will load balance among those JMS servers to setup
the temporary destination. See How do I start WLS and configure JMS? for a description
about how to configure JMS. The resulting template definition looks something like the
following:
<JMSTemplate Name="MyTemplate"/>
The JMSServer is defined something like:
After the template name, you can set any queue/topic attribute you want in the template
(not including a JNDI name or topic multicast settings). The template is at the outer most
level; that is, it should not be nested in your .
Temporary destinations can only be consumed by the creating connection. Using topics,
you create your temporary topic and subscribe to that temporary topic. If you want
someone to publish to that temporary topic, you need to tell that someone what your topic
is. You can send them a message and include your temporary topic in the JMSReplyTo
field. The creator of the TemporaryTopic and the subscriber must be one in the same.
import javax.jms.TopicSession;
TemporaryTopic myTopic = mySession.createTemporaryTopic();
TopicSubscriber = mySession.createSubscriber(myTopic);
Temporary topics do not get names and cannot be subscribed to by other connections.
When you create a temporary topic, the JMS provider returns a javax.jms.Topic. You then
need to advertise that topic to other parties (those who want to publish to the topic),
putting it in your JMSReplyTo field so that they can respond. In general, no one else can
subscribe to the topic. You advertise the topic any way you want. Topics are serializable
(or, in our case, externalizable), which allows you to pass them around in RMI calls,
through a file, binding it to a name in JNDI, etc. In short, create the topic at the
subscriber side and advertise so that others can publish. You can get multiple subscribers
on the same connection and get concurrent processing using multiple sessions.
Can two JMS servers share the same persistent store?
No. Each JMS server must have its own unique persistent store. Two file-based JMS
persistent stores may share the same directory, but their messages will be stored in
different files. In this case, the filenames will contain different prefixes.
Two JDBC-based JMS persistent stores may share the same database, but they must be
configured to use a different Prefix Name which will be prepended to the database tables.
For more information on configuring the JDBC Prefix Name, see "JMS JDBC Stores" in the
Administration Console Online Help. If they are configured with the same Prefix Name,
persistent messages will be corrupted and/or lost.
Which types of JDBC databases does WebLogic JMS support?
The JMS database can be any database that is accessible through a JDBC driver.
WebLogic supports and provides JDBC drivers for the following databases:
* Cloudscape
* Informix
* Microsoft SQL (MSSQL) Server (Versions 6.5 and 7)
* Oracle (Version 8.1.6)
* Sybase (Version 12)
How do I use a third-party JDBC driver with JMS?
If your JDBC driver is not included in the list of drivers in the question about JDBC
databases supported by WebLogic JMS, then the tables required by JMS must be created
manually.
Note: WebLogic Server only guarantees support for the JDBC drivers included in the
previous list. Support for any other JDBC driver is not guaranteed.
The .ddl files located in the weblogic/jms/ddl directory of the weblogic.jar file may be used
as templates. Use the jar utility supplied with the JDK to extract them to the
weblogic/jms/ddl directory using the following command:
jar xf weblogic.jar weblogic/jms/ddl
Note: If you omit the second parameter (weblogic/jms/ddl), the entire jar file is extracted.
Follow the procedures in JDBC Database Utility in Programming WebLogic JMS to
manually create the database tables for the JDBC store.
Another option is to consider using a file store instead of a JDBC store. File stores are
easier to configure and may provide significantly better performance.
The Multicast TTL setting for a cluster in the WebLogic Admin console sets which
of the following values?
a. Maximum time taken for multicast messages to reach their final destination
b. The number of routers a multicast message can pass through before the packet
can be discarded
c. The multicast address to be used by the messages sent from the cluster
d. Minimum time taken for broadcasting a multicast message from the cluster
Choice B is correct. The Multicast TTL(TTL-Time to Live) setting specifies the number of
routers a multicast message can pass through before the packet can be discarded. To
configure the multicast TTL for a cluster, you should change the Multicast TTL value in
the WebLogic Server administration console. This sets the number of network hops a
multicast message makes before the packet can be discarded.
If you choose to distribute a cluster over a WAN (or across multiple subnets), you must
plan and configure your network topology to ensure that multicast messages are reliably
transmitted to all servers in the cluster. One of the requirements to be met by the network
is that the multicast Time To Live (TTL) value must be high enough to ensure that routers
do not discard multicast packets before they reach their final destination.
Which of the following algorithms is used by the WebLogic Server as the default
load balancing strategy for clustered object stubs when no algorithm is specified ?
a. Round-robin
b. Weight-based
c. Random
d. None of the above
8. Choice A is correct. The basic idea behind load balancing is that by distributing the load
proportionally among all the servers in the cluster, the servers can each run at full
capacity. WebLogic Server clusters support several algorithms for load balancing clustered
objects. The particular algorithm you choose is maintained within the replica-aware stub
obtained for the clustered object. Configurable algorithms for load balancing clustered
objects are: Round-robin, Weight-based and Random.
WebLogic Server uses the round-robin algorithm as the default load balancing strategy for
clustered object stubs when no algorithm is specified. Round-robin is the only load
balancing strategy used by WebLogic proxy plug-ins for HTTP session state clustering. The
round-robin algorithm cycles through a list of WebLogic Server instances in order. For
clustered objects, the server list consists of WebLogic Server instances that host the
clustered object. For proxy plug-ins, the list consists of all WebLogic Servers that host the
clustered servlet or JSP.
How do I use persistence?
Use the following guidelines:
1. Make sure the JMSServer you are using has a store configured. The JMSServer
configuration entry in the config.xml file should contain a line of the form
Store=""
Note that if JMS boots without a store configured, it is assumed the customer did not want
one, and persistent messages are silently downgraded to non-persistent (as specified for
JMS 1.0.2).
2. Make sure you are not using "Message.setJMSDeliveryMode". This is overwritten, as it is
a vendor-only method.
3. Make sure you are calling either:
QueueSender.send(msg, deliveryMode, ...)
-- or --
QueueSender.setDeliveryMode(deliveryMode)
-- or --
set the DefaultDeliveryMode mode on connection factory in the config.xml file to persistent
(the QueueSender.setDeliver/send overrides this value). Similarly, for topics, you would
set this via the TopicPublisher.
4. Make sure you don't have "DeliveryModeOverride" set to Non-Persistent on the
Destination in the config.xml file.
5. If you are using pub/sub, only durable subscriptions persist messages. Non-durable
subscriptions have no need to persist messages, as by definition they only exist for the life
of the server.
6. If you are using JDBC, the JDBC tables, JMSSTATE and JMSSTORE, are created
automatically when the JMS server boots. The DDL files used to create the tables are
stored in weblogic.jar in weblogic/jms/ddl. The example configuration below shows a
JDBC store for Oracle (client version 8.1.7 or later is needed to run with WLS 6.1 on JDK
1.3). To manually create the tables (also deleting any existing tables), run java
utils.Schema as described in the previous question.
See the question, "How do I start WLS and configure JMS?" for a description of how to
configure JMS.
Here is a sample config.xml file resulting from configuring JMS. It should look similar to
yours. If you want JMS to use a file store instead of a database, just change JDBCStore to
FileStore in the JMSServer section.
ListenPort="7001" DefaultProtocol="t3"
ThreadPoolSize="8" >
GuestDisabled="false" />
FileRealm="defaultFileRealm" />
<FileRealm Name="defaultFileRealm"
/>
TemporaryTemplate="TestTemplate1"
Targets="myserver" Store="JDBCStore">
JNDIName="jms.queue.TestQueue1"
Template="TestTemplate1"
/>
<JMSTemplate Name="TestTemplate1"
/>
<JMSFileStore Name="FileStore"
Directory="myfilestore"
JMSServer="TestJMSServer"
/>
ConnectionPool="testpool2"
JMSServer="TestJMSServer"
/>
<JDBCConnectionPool Name="testpool2"
Targets="myserver"
URL="jdbc:weblogic:oracle"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="0"
MaxCapacity="1"
CapacityIncrement="1"
Properties="user=SCOTT;password=tiger;server=bay816"
/>
The following is a sample class that sends
a Topic message on construction:
import javax.naming.*;
import javax.jms.*;
import java.util.Hashtable;
public class t
{
public final static String DESTINATION="jms.topic.TestTopic1";
private TopicConnectionFactory connectionFactory;
private TopicConnection connection;
private TopicSession session;
private TopicPublisher producer;
private TextMessage message;
private Topic destination;
public t()
{
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
InitialContext ctx = new InitialContext(env);
destination = (Topic) ctx.lookup(DESTINATION);
connectionFactory = (TopicConnectionFactory)
ctx.lookup("javax.jms.TopicConnectionFactory");
connection = (TopicConnection)
connectionFactory.createTopicConnection();
session = (TopicSession) connection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
producer = (TopicPublisher) session.createPublisher(destination);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
message = (TextMessage) session.createTextMessage();
message.setText("hello world");
producer.publish(message);
} catch (Exception e) {
}
}
}
How does a file store compare with a JDBC store?
The following are some similarities and differences between file stores and JDBC stores:
* Both have the same transaction semantics, including rolling back transactions (e.g.,
received messages are put back on the queue).
* Both have the same application interface (no difference in application code).
* The file store should be much faster.
* JDBC may make it easier to handle failure recovery since the JDBC interface can access
the database from any client machine; with the file store, the disk must be shared or
migrated.
* File store reliability is limited to reliability of disk and O/S; run it on Veritas or a RAID 5
system. Database reliability may be higher.
* File stores will require more memory, but perhaps not significantly more; it depends on
how fragmented the file store gets, if the application works roughly
* FIFO it shouldn't get very fragmented at all.
* File stores generate no additional network traffic, database stores do if the database
server is on a different JVM or machine.
How do the WLS JMS 6.1 server/destination message maximum and threshold
values work?
The byte and message maximum values are quotas - not flow control. Message quotas
prevent a WebLogic JMS server from filling up with messages and possibly running out of
memory, causing unexpected results. When you reach your quota, JMS prevents further
sends with a ResourceAllocationException (rather than blocking). You can set quotas on
individual destinations or on a server as a whole.
The thresholds are also not flow control - though they would be better suited to that
application than the quotas. The thresholds are simply settings that when exceeded cause
a message to be logged to the console to let you know that you are falling behind.
Note that the messages maximum setting on a connection factory is not a quota. This
specifies the maximum numbers of outstanding messages that can exist after they have
been pushed from the server but before an asynchronous consumer has seen them; it
defaults to a value of 10.
How do I configure JDBC so that the JMS JDBC Store recovers automatically?
Several customers have reported a problem where they are using a JDBC store, the DBMS
goes down and back up, but JMS can no longer use the store until WLS is shutdown and
restarted. You can get around this problem by configuring the following attributes on the
JDBC Connection Pool associated with the JMSJDBCStore:
TestConnectionsOnReserve="true"\
TestTableName="[[[catalog.]schema.]prefix]JMSState"
If they are not set, then if the JDBC resource goes down and comes back up, JMS cannot
re-use the connection pool until WLS is shutdown and restarted. This has been tested
against WLS 6.0 SP02 and WLS 6.1.
Does WebLogic JMS support clustering?
WebLogic JMS supports cluster-wide, transparent access to destinations from any server
in the cluster. A system administrator can establish cluster-wide, transparent access to
destinations from any server in the cluster by configuring multiple connection factories
and using targets to assign them to WebLogic Servers. Each connection factory can be
deployed on multiple WebLogic Servers.
The application uses the Java Naming and Directory Interface (JNDI) to look up a
connection factory and create a connection to establish communication with a JMS server.
Each JMS server handles requests for a set of destinations. Requests for destinations not
handled by a JMS server are forwarded to the appropriate server.
You can configure multiple JMS servers on the various nodes in the cluster as long as you
give them different names. You can assign destinations to the various JMS servers.
One problem to be aware of is the propagation delay in replicating entries in JNDI. If you
have an MDB deployed on one node but reference a destination on another node, the
deployment may fail with a javax.naming.NamingException exception. The problem occurs
because the server is not synced up to the JNDI from the remote server (JMS server) yet,
so the JNDI lookup of destination as part of MDB deployment will fail. One workaround is
for each MDB to reference a local destination. Another approach is deploy the MDBs after
the server boots (plus a delay for JNDI propagation). To get around losing messages before
the MDB is deployed, use durable subscribers. This problem is fixed for MDBs in WLS 6.1,
where the MDB will be deployed and reconnection will be retried until the destination is
available. Note that this is still a problem for EJBs in general that try to reference a nonlocal
JMS destination.
How do I do HTTP tunneling?
If you want to use HTTP tunneling (wrap every message in HTTP to get through a firewall),
you need to add TunnelingEnabled="true" into your &lr;ver> definition in the config.xml
file or check the appropriate box on the console. Then use a URL like
http://localhost:7001 instead of t3://localhost:7001 for Context.PROVIDER_URL when
getting your InitialContext. If you want HTTP tunneling with SSL, use
https://localhost:7002 (where https uses HTTP tunneling with SSL and 7002 is the secure
port that you configured). You will pay a performance penalty for doing this, so only use
tunneling it if you really need to (i.e., need to go through a firewall).
Which of the following statements are true regarding the identity of two EJBs?
a. Two stateful session beans are identical if their data attributes are identical.
b. Two stateful session beans are identical if their session contexts are equal.
c. Two stateless session beans are identical if they are of the same type.
d. Two stateless session beans are identical if their session contexts are equal.
e. Two entity beans are identical if they have same primary key but different home
interface.
f. Two entity beans are identical if they have different primary key but same home
interface.
B and C are correct. Since the stateful session beans maintain the conversational state of
the clients, they are identical when their session contexts are equal. Two stateful session
beans may have identical data attributes, but if the session contexts are different they are
not identical. Thus choice A is incorrect and B is correct. Since stateless beans do not
retain the conversational state, they are considered identical if they are of the same type.
Thus choice C is correct.
If two entity objects have the same home interface and primary key, they are considered
identical. The EJB specification does not mention object equality based on the = =
operator. Also, if you compare two object references using the Java API,
Object.equals(Object obj), the result is unspecified. The only way to compare object
equality is through the isIdentical (EJBObject) API. Thus choice E and F are incorrect.
Why is my JMS work not part of a user transaction (i.e., called within a transaction
but not rolled back appropriately)? How do I track down transaction problems?
Usually this problem is caused by explicitly using a transacted session which ignores the
external, global transaction by design (JMS spec requirement). A transacted JMS session
always has its own inner transaction. It is not affected by any transaction context that the
caller may have.
It may also be caused by using a connection factory that is configured with
"UserTransactionsEnabled" set to false.
1. You can check if the current thread is in a transaction by adding these two import lines:
import javax.transaction.*
import weblogic.transaction.*;
and adding the following lines (i.e., just after the begin and just before every operation).
Transaction tran = TxHelper.getTransaction();
System.out.println(tran);
System.out.println(TxHelper.status2String(tran.getStatus()));
This should give a clear idea of when new transactions are starting and when infection is
occurring.
2. Ensure that the thread sending the JMS message is infected with a transaction. Check
that the code is not using a transacted session by setting the first parameter of
createQueueSession or createTopicSession to false. Note that creating the connection
and/or session is orthogonal to the transaction. You can begin your transaction before or
after. You need only start the transaction before you send or receive messages.
3. Check that the UserTransactionsEnabled flag is explicitly set to true for the connection
factory in the config.xml file since the default for user-configured connection factories for
this value is false. If you are using one of the pre-configured connection factories they are
set as follows:
weblogic.jms.ConnectionFactory disables user transactions so
don't use this one for the case where user transactions are
desired;
javax.jms.QueueConnectionFactory and
javax.jms.TopicConnectionFactory enable user transactions.
4. You can trace JTA operations by starting the server with this additional property:
-Dweblogic.Debug.DebugJMSXA=true
You should see trace statements like these in the log:
XA ! XA(3163720,487900)
This can be used to ensure that JMS is infected with the transaction.
In the WebLogic server, if stateless session bean instances are getting frequently
created and removed, performance can improved by setting a high value for which of
the following?
a. max-beans-in-free-pool
b. max-beans-in-cache
c. max-beans-in-memory
d. max-stateless-beans-in-cache
Choice A is correct. WebLogic Server maintains a free pool of EJBs for every stateless
session bean class. The max-beans-in-free-pool element defines the size of this pool. By
default, max-beans-in-free-pool has no limit; the maximum number of beans in the free
pool is limited only by the available memory.
When EJBs are created, the session bean instance is created and given an identity. When
the client removes a bean, the bean instance is placed in the free pool. When you create a
subsequent bean, you can avoid object allocation by reusing the previous instance that is
in the free pool. So the max-beans-in-free-pool element can improve performance if EJBs
are frequently created and removed. Keeping this parameter too high uses extra memory
and keeping it too low causes unnecessary object creation.
WebLogic Server allows you to configure the number of active beans that are present in the
EJB cache (the in-memory space where beans exist). The max-beans-in-cache element
specifies the maximum number of objects of this class that are allowed in memory. When
max-bean-in-cache is reached, WebLogic Server passivates some EJBs that have not been
recently used by a client. Choices C and D are not valid properties.
How can an application do a JMS operation and have it succeed, independent of
the result of the transaction?
Basically, the JMS operation must be done using a transacted session or the transaction
must be suspended/disabled as follows (pick one or more of the following).
1. Suspend the current transaction prior to making the JMS call and resume it after
completing it. The code looks something like this:
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
TransactionManager tranManager=
TxHelper.getTransactionManager();
Transaction saveTx = null;
try {
saveTx = tranManager.suspend();
... do JMS work, it will not participate in transaction
} finally {
// must always resume suspended transactions!
if (saveTx != null) tranManager.resume(saveTx);
}
2. Use a transacted session by specifying true for the first parameter to
createQueueSession or createTopicSession.
3. Use a connection factory with user transactions disabled. That is, check that the
UserTransactionsEnabled flag is explicitly set to false for the connection factory in the
config.xml file or use the default for a user-configured connection factory for this value
which is false. The pre-configured connection factory weblogic.jms.ConnectionFactory
disables user transactions.
A transacted JMS session always has its own inner transaction. It is not affected by any
transaction context that the caller may have. A non-transacted JMS session is more
complicated. If you use the WLS 6.1 default factory weblogic.jms.ConnectionFactory, the
session does not participate in a user transaction because the UserTransactionsEnabled
flag is set to "False". If you use the deprecated default factory
javax.jms.QueueConnectionFactory or javax.jms.TopicConnectionFactory or you define
your own factory and set the UserTransactionsEnabled flag to "True", the JMS session
participates in the outer transaction, if one exists and the JMS session is not transacted.
What happens if acknowledge() is called within a transaction?
As per the JMS specification, when you are in a transaction, the acknowledgeMode is
ignored. If acknowledge() is called within a transaction, it is ignored.
Is it possible to set aside a message and acknowledge it later?
There are no special primitives for doing this. Here are two possible solutions.
One approach is to use multiple sessions as in the following:
while (true) {
Create a session, subscribe to one message on durable
subscription
Close session
Save session reference in memory
To acknowledge the message, find the session reference and call
acknowledge() on it.
}
Another solution is to use transactions and suspend the work as follows:
start transaction
while(true) {
message = receive();
if (message is one that I can handle)
process the message
commit
} else {
suspend transaction
put transaction aside with message
start transaction
}
}
To "acknowledge" the message:
resume user transaction
commit
To "recover" the message:
resume user transaction
rollback
Each time you suspend, you need to push the transaction onto a stack or list possibly
with the message so you can process it or roll it back later. This solution is high overhead
in that there can be a large build up of outstanding transactions. Note that transactions
have timeouts and it may rollback on its own, which means you can get the message again
(in a different transaction). Note also that there are some practical limits on the number of
transactions you should leave outstanding. The default limit is something like 10000.
Eventually you want to go back to your stack/list and commit/rollback the transactions.
Note that transaction references (javax.transaction.Transaction) are not Serializable.
How should I use sorted queues?
Destination keys are used to define the sort order for a specific destination. Destination
keys can be message header or property fields. For a list of valid message header and
property fields, refer to the Programming WebLogic JMS.
Queues can be sorted in ascending or descending order based on the destination key. A
destination is considered to be first-in-first-out if a destination key is defined as ascending
for the JMSMessageID message header field, and last-in-first-out if defined as descending.
The key defined for the JMSMessageID header field, if specified, must be the last key
defined in the list of keys.
You can define multiple destination keys to sort a destination.
Which of the following attributes in the Monitoring tab for a JDBC connection pool in
the Administrative console tell us how many clients are currently waiting for a
connection?
a. Waiters high
b. Waiters
c. Connections high
d. Clients
e. Wait seconds high
Choice B is correct. JDBC subsystem resources can also be monitored via the
Administration Console. The Monitoring tab for a JDBC connection pool allows you to
access a table listing statistics for the instances of that pool. These attributes provide
important information for managing client database access.
The Waiters High field indicates the highest number of clients waiting for a connection at
one time. The Waiters field tells you how many clients are currently waiting for a
connection. The Connections High field indicates the highest number of connections that
have occurred at one time. The Wait Seconds High field tells you the longest duration a
client has had to wait for a database connection. These attributes allow you to gauge the
effectiveness of the current configuration in responding to client requests.
The MaxPostTimeSecs attribute set in the Administration console under Servers or
virtual hosts section corresponds to which of the following?
a. The amount of time that WebLogic Server waits between receiving chunks of data
in an HTTP POST.
b. The total amount of time that WebLogic Server spends receiving HTTP POST data.
c. The time spent by WebLogic server to post data to other servers in the cluster.
d. The number of bytes of data received in a POST from a single request.
Choice B is correct. Web servers may face denial-of-service attacks, which is usually
carried out by sending huge amounts of data in an HTTP POST method. You can set three
attributes in WebLogic Server that help prevent this type of attack. These attributes are set
in the console, under Servers or virtual hosts. You can limit the amount of time that
WebLogic Server waits between receiving chunks of data in an HTTP POST by setting the
attribute PostTimeoutSecs.
The MaxPostTimeSecs attribute limits the total amount of time that WebLogic Server
spends receiving post data. If this limit is triggered, a PostTimeoutException is thrown and
a message is sent to the server log. MaxPostSize attribute limits the number of bytes of
data received in a POST from a single request. If this limit is triggered, a
MaxPostSizeExceeded exception is thrown and a message is sent to the server log.
How does sorting on message priority work?
First, you need to add a key to the destination (by default, they are not sorted), choosing
JMSPriority as the key. If you want 0 to be your highest priority, make the key ascending.
If you want 9 to be the highest priority, make the key descending.
Second, the priority must be set using either the producer or on the send, not the
message.
Third, the priority sorting only comes into play if there are multiple messages waiting on
the queue. If the receiver is always caught up with the sender, then the messages will be
processed in the order in which they come in.
How do I get a thread dump to help track down a problem?
Ways to get a thread dump:
* Try running this from the command line (after running the setEnv script in
/bea/wlserver6.1/config/mydomain/):
java weblogic.Admin -url t3://localhost:7001 THREAD_DUMP
* On Windows, from the console window, enter Ctrl+Break.
* On UNIX, signal the server using kill -3.
How do I manage a queue to view and delete specific messages?
Write a program that uses a QueueBrowser. Then delete specific messages by using a
selector with the message identifier as in the following example:
String selector = "JMSMessageID = '" + message.getMessageID() + "'";
Keep in mind that the queue browser is a not a "live" view of the queue. It is a snap-shot.
Why do I get an exception when trying to find a connection factory?
The exception is usually something like java.io.InvalidClassException or
java.lang.NoClassDefFoundError.
Make sure weblogic.jar is in the CLASSPATH of the client. Also make sure you have the
correct Java run-time jar files included (i.e., you might need rt.jar).
What precautions should I take when I use blocking receive() calls?
If your application design requires messages to be received synchronously, we recommend
using one of the following methods listed in order of preference:
* Pass a timeout value as an argument to the receive() method and set it to the minimum
value greater than zero, that is allowed by the application to avoid consuming threads that
are waiting for a response from the server.
* Use the receiveNoWait() method which returns the next message or a null value if no
message is currently available. In this case, the call does not block. The servlet should
provide a way to return to or reschedule the request, without calling wait().
Note: Use of this option should be minimized, as it may deadlock a busy server.
* Ensure that more threads are configured than the number of possible simultaneous
blocking receive() calls.
What is the NO_ACKNOWLEDGE acknowledge mode used for?
The NO_ACKNOWLEDGE acknowledge mode indicates that received messages do not need
to be specifically acknowledged which improves performance, but risks that messages are
lost. This mode is supported for applications that do not require the quality of service
provided by session acknowledge and that do not want to incur the associated overhead. v
Messages sent to a NO_ACKNOWLEDGE session are immediately deleted from the server.
Messages received in this mode are not recovered and, as a result, messages may be lost
and/or duplicate message may be delivered if an initial attempt to deliver a message fails.
Note: You should avoid using this mode if your application cannot handle lost or duplicate
messages. Duplicate messages may be sent if an initial attempt to deliver a message fails.
In addition, we do not recommend that this acknowledge mode be used with persistent
messaging, as it implies a quality of service that may be too low for persistent messaging
to be useful.
When should I use multicast subscribers?
Multicasting enables the delivery of messages to a select group of hosts that subsequently
forwards the messages to multicast subscribers. The benefits of multicasting include:
* Near real-time delivery of messages to host group.
* High scalability due to the reduction in the amount of resources required by the JMS
server to deliver messages to multicast subscribers.
Note: Multicasting is only supported for the Pub/sub messaging model.
For an example of when multicasting might be useful, consider a stock ticker. When
accessing stock quotes, timely delivery is more important than reliability. When accessing
the stock information in real-time, if all, or a portion, of the contents is not delivered, the
client can simply request the information be resent. Clients would not want to have the
information recovered in this case because by the time it is redelivered it would be out-ofdate.
Multicast messages are not guaranteed to be delivered to all members of the host group.
For messages requiring reliable delivery and recovery, you should not use multicasting.
When should I use server session pools and connection consumers?
WebLogic JMS implements an optional JMS facility for defining a server-managed pool of
server sessions. This facility enables an application to process messages concurrently. A
ConnectionConsumer object uses a server session to process received messages. If
message traffic is heavy, the connection consumer can load each server session with
multiple messages to minimize thread context switching. Multiple connection consumers
can share server sessions in a server session pool.
To learn how to use the connection consumers within an application, see the section
Processing Messages Concurrently in Programming WebLogic JMS, or the
javax.jms.ConnectionConsumer javadoc.
Note: Server session pools can also be implemented using Message Driven Beans. Using
MDBs is preferable to using server session pools - see the answer to the question, "How do
server session pools and Message Driven Beans compare?" For information on using
message driven beans to implement server session pools, see Programming WebLogic
Enterprise JavaBeans.
How do I issue the close() method within an onMessage() method call and what are
the semantics of the close() method?
If you wish to issue the close() method within an onMessage() method call, the system
administrator must select the Allow Close In OnMessage check box when configuring the
connection factory. For more information, see JMS Connection Factories in the
Administration Console Online Help. If this check box is not selected and you issue the
close() method within an onMessage() method call, the call will hang.
The close() method performs the following steps to execute an orderly shutdown:
* Terminates the receipt of all pending messages. Applications may return a message or
null if a message was not available at the time of the close.
* Waits until all message listeners that are currently processing messages have completed
(except for the message listener from which the close() method is being called).
* Rolls back in-process transactions on its transacted sessions (unless such transactions
are part of an external JTA user transaction).
* Does not force an acknowledge of client-acknowledged sessions. By not forcing an
acknowledge, no messages are lost for queues and durable subscriptions that require
reliable processing.
When you close a connection, all associated objects are also closed. You can continue to
use the message objects created or received via the connection, except the received
message's acknowledge() method. Closing a closed connection has no effect.
Note: Attempting to acknowledge a received message from a closed connection's session
throws an IllegalStateException.
When you close a session, all associated producers and consumers are also closed.
For more information about the impact of the close() method for each object, see the
appropriate javax.jms javadoc.
How do I publish an XML message?
Follow these steps:
1. Generate XML from the DOM document tree.
2. Serialize the generated DOM document to a StringWriter.
3. Call toString on the StringWriter and pass it into message.setText.
4. Publish the message.
A client wants to preserve the reference to the EJBhome object of an enterprise
bean instance and use it later. Which of the following can be serialized for this
purpose ?
a. home
b. Handle
c. homeHandle
d. EJBhomeHandle
e. homeObject
Choice C is correct. Once a client has obtained the EJBhome object for an EJB instance, it
can create a reference to the home object by calling gethomeHandle(). gethomeHandle()
returns a homeHandle object, which can be used to obtain the home interface to the same
EJB instance at a later time.
A client can pass the homeHandle object as arguments to another client, and the receiving
client can use the handle to obtain a reference to the same EJBhome object. Clients can
also serialize the homeHandle and store it in a file for later use. The homeHandle interface
has only one method getEJBhome(), which returns the EJBhome reference.
Is it possible to send or receive a message from within a message listener?
Yes. You can send to or receive from any queue or topic from within in a message listener.
If it's not an MDB, you can use the same Connection or Session that the onMessage() is
part of to do this. When you create your message listener, you pass in a session in your
constructor. Then you have access to the session in your onMessage method and you
would be able to make synchronous, not asynchronous, calls from within the onMessage
method. Do not use another Session that is servicing another onMessage() because that
would multi-thread that Session and Sessions don't support multi-threading.
When things are done non-transactionally, there can be duplicates or lost messages
(assuming your onMessage() code is attempting to forward messages):
1. If you call acknowledge after the publish() and the acknowledge fails for whatever reason
(network/server failure), then you will see the message again and will end up publishing
twice (possible duplicate semantics). You can try to keep track of sequence numbers to
detect duplicates but this is not easy.
2. If you call acknowledge before the publish(), you get at-most-once semantics. If the
publish() fails, you don't know if the failure occurred before or after the message reached
the server.
If you want exactly once, transactional semantics using onMessage, you must use
transactional MDBs. The onMessage() for a transactional MDB starts the transaction,
includes the WebLogic Server JMS message received within that transaction and the
publish() would also be in the same transaction. The following code sends a response to
each message that it receives. It creates the connection, etc. in the ejbCreate method so
that it doesn't need to create it every time onMessage is called. The QueueSender is
anonymous (null Queue) since we don't know to whom we will have to reply. The
ejbRemove method cleans up by closing the connection. This same approach can be used
to create a receiver, subscriber or publisher.
import javax.ejb.CreateException;
import javax.ejb.EJBContext;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.*;
public class MDB
implements MessageDrivenBean, MessageListener {
public static final String WLSqcf =
"javax.jms.QueueConnectionFactory";
public static final String WLSqname =
"jms.queue.TestQueue1";
public static final String WLSurl =
"t3://localhost:7001";
public static final String WLSJNDIfactory =
"weblogic.jndi.WLInitialContextFactory";
private MessageDrivenContext context;
private QueueSession session;
private QueueConnection connection = null;
private QueueConnectionFactory factory;
private InitialContext ctx;
private QueueSender QueueSender;
// Required - public constructor with no argument
public MDB() {}
// Required - ejbActivate
public void ejbActivate() {}
// Required - ejbRemove
public void ejbRemove() {
context = null;
if (connection != null) {
try {
connection.close();
} catch(Exception e) {}
connection = null;
}
}
// Required - ejbPassivate
public void ejbPassivate() {}
public void setMessageDrivenContext(
MessageDrivenContext mycontext) {
context = mycontext;
}
// Required - ejbCreate() with no arguments
public void ejbCreate () throws CreateException {
try {
// Get the initial context
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, WLSJNDIfactory);
env.put(Context.PROVIDER_URL, WLSurl);
env.put(Context.REFERRAL, "throw");
ctx = new InitialContext(env);
factory = (QueueConnectionFactory)ctx.lookup(WLSqcf);
// Create a QueueConnection, QueueSession, QueueSender
connection = factory.createQueueConnection();
session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
queueSender = session.createSender(null);
connection.start();
} catch (Exception e) {
throw(new CreateException(e.toString()));
}
}
// Implementation of MessageListener
// Throws no exceptions
public void onMessage(Message msg) {
try {
System.out.println("MDB: " +
((TextMessage)msg).getText());
msg.clearBody();
((TextMessage)msg).setText("reply message");
queueSender.send((Queue)msg.getJMSReplyTo(), msg);
}
catch(Exception e) { // Catch any exception
e.printStackTrace();
}
}
}
This approach creates a connection per EJB/MDB instance, so you might want to create a
producer pool that is shared by the EJB instances. This is done by writing a class that
populates a static pool with producers (see the next question for a sample producer pool).
The onMessage call grabs a producer when needed. Since Sessions must be single
threaded, make sure there is only one producer per session within the producer pool.
How do I create a producer pool?
The following is some pseudo-code
for a producer class.
class ProducerPool {
static Hashmap pSets = new Hashtable();
static Hashmap inUse = new Hashtable();
QueueSender get(String contextURL,
String connectionFactoryName,
String destinationName) {
String lookup = contextURL+";
"+connectionFactName+";"+destName;
synchronized(pSets) {
producer set = pSets.get(lookup);
if (set != null && set not empty)
qs = set.removeFirst();
}
if (producer == null) {
create ctx
get connect factory
create connection
create session
look up destination
qs = create queue sender
}
synchronized(inUse) {
inUse.put(qs, lookup);
}
return qs;
}
void put(QueueSender qs) {
String lookup;
synchronized(inUse) {
lookup = inUse.remove(p);
}
synchronzied(pSets) {
producer set = pSets.get(lookup);
if (set == null) {
producer set = new producer set
pSets.put(lookup, producer set);
}
producer set.add(qs);
}
}
}
Note: Static classes may be garbage collected if there are no references to them, so make
sure the application server has a permanent pointer to them in some manner. One way is
to reference it permanently from within a servlet or EJB when they are initialized at
startup.
Here is an example of using the producer pool within the onMessage method.
onMessage() {
QueueSender qs = ProducerPool.get(...);
qs.send(...);
ProducerPool.put(qs);
}
You can pre-populate this pool by calling it from
a startup class or a load-on-start servlet class.
What are pending messages in the console?
Pending means the message could have been:
* sent in a transaction but not committed.
* received and not acknowledged.
* received and not committed.
* subject to a redelivery delay (as of WebLogic Server 6.1).
* subject to a delivery time (as of WebLogic Server 6.1).
A rolled back message remains pending until the transaction actually rolls back. Rolling it
back multiple times does not cause double counting, nor does an exception that set a
transaction as rollbackOnly followed by an actual rollback.
Current implies messages that are not pending.
Total implies total since server last started. The byte counts only consider the payload of
messages which includes the properties and the body but not the header.
How do I use a less than or greater than on a message selector in ejb-jar.xml?
Enclose the selector in a CDATA section. That will prevent the XML parser from thinking
that less than or greater than is a tag.
<jms-message-selector>
'user' ]]>
Is it better to have more or fewer sessions for a given number of subscribers?
Using N sessions for N subscribers gives you concurrency up to N simultaneous threads of
execution provided you have as many threads to work with. Each Session gets its own
thread as long as there are enough threads available. Otherwise, the sessions serially
reuse the available threads.
One session for N subscribers serializes all subscribers through that one session. If the
load is heavy they may not be able to keep up without the extra threads.
If you are using CLIENT_ACKNOWLEDGE, N sessions gives you N separate message
streams that can be individually recovered. Having one session crosses the streams giving
you less control.
Match the EJB functions given below with the functionality equivalent in SQL
A.) ejbStore() 1.) INSERT
B.) ejbLoad() 2.) UPDATE
C.) ejbCreate() 3.) SELECT
a. A->1, B->2, C->3
b. A->2, B->1, C->3
c. A->3, B->2, C->1
d. A->1, B->3, C->2
e. A->2, B->3, C->1
f. A->3, B->1, C->2
Choice E is correct. When the create() method on a home interface is invoked, the
container delegates the create() method call to the bean instance's matching ejbCreate()
method. The ejbCreate() methods are used to initialize the instance state before record is
inserted into the database. The ejbCreate() method is analogous to INSERT. The ejbStore()
method is invoked just before the container the container is about to write the bean
container-managed fields to the database. It is analogous to the UPDATE . The ejbLoad() is
invoked just after the container has refreshed the bean container-managed files with its
state from the database. It is analogous to the SELECT. Thus choice E is correct and
others are not.
A client invokes a method on a stateful session bean instance deployed in the
WebLogic Server. While the method execution is in progress another method call
arrives on the server. What will be the result?
a. RemoteException is thrown if the value of concurrency-strategy property is false
b. EJBException is thrown if the value of concurrency-strategy property is false
c. The EJB container blocks the concurrent method call and allows it to proceed
when the previous call has completed if the value of allow-concurrent-calls is true
d. In all cases, RemoteException is thrown
Choice C is correct. By default, simultaneous access to a stateful session EJB results in a
RemoteException. However, you can set the allow-concurrent-calls option in the WebLogic
EJB deployment descriptor to specify that a stateful session bean instance will allow
concurrent method calls. This access restriction on stateful session EJBs applies whether
the EJB client is remote or internal to WebLogic Server. By default, allows-concurrentcalls
is false. However, when this value is set to true, the EJB container blocks the
concurrent method call and allows it to proceed when the previous call has completed.
The concurrency-strategy element determines ejbLoad() and ejbStore() behavior for entity
EJB instances.
Posted by vijay balan at 7:21 AM
Email ThisBlogThis!Share to TwitterShare to Facebook
No comments:
Post a Comment
Newer Post Home
Subscribe to: Post Comments (Atom)
Followers
Blog Archive
▼ 2010 (2)
o ▼ July (2)
weblogic WIKI
Weblogic Administrator Interview Questions
About Me
vijay balan
View my complete profile
Picture Window template. Powered by Blogger.
1. How to know the Managed Servers status, when admin console is not available?
2. What is the performance issue in weblogic and how can you resolve, explain in brief?
3. What is the Digital Certificate? How do we generate a Digital Certificate?
4. What is Thread Dump? What is the UNIX command to take Thread Dumps?
5. What is a cluster? What is High Availability and Fail over?
6. How to handle out of memory in weblogic and if server is getting more requests then what we
have to do in production environment?
7. What is clustering? How do weblogic instances communicate in a clustered environment? In a
cluster, if one of the servers has an issue and it is not accessible, will the other servers know
about it and how?
8. What are the roles you have played and what are the day today activities?
9. WHAT IS TROUBLE SHOOTING IN WEBLOGIC?
10. How to integrate apache webserver with weblogic server? What is the purpose of integrating
both?
11. Define the different groups of Users?
12. What are the different thread queues?
13. How will you analyze if a page responds slowly?
14. What is Work manager? Explain briefly?
15. What are the different types of drivers?
16. What are the various types of log files?
17. What are you commonly used fine tuning commands?
18. What is Session replication? What are the different types of Session Replications?
19. What happens if we change config.xml while server is running?
20. What is HTTP tunneling?
21. What is asynchronous communication? Is there any synchronous communication in JMS?
22. How to find Weblogic Version?
23. What is the use of log4j?
24. What is Work manager?
25. What is virtual host?
26. What is eden size and perm size?
27. What is Weblogic shrink?
28. What is diff b/w JNDI and JDBC?
29. What are the different types of drivers?
30. What driver you are using?
31. What is diff b/w unicast and multicast?
32. When core dump will not be created even if the server crashed?
33. Can we change the heart beat interval?
34. What are the various types of log files?
35. What is WorkManager?
36. What is Multicast IP Address? What are the things done by it? How to
test multicast IP?
37. How to check whether the cluster multicast adress is available or not?
What is the command to check in UNIX environment?
38. What is Virtual Host in Weblogic, how to create it & what is the
advantage ?
39. How can you find the jdbc version on server side?
40. What you do to close the connections automatically in JDBC?
41. What are the things that we take care under Database fine tuning apart
from increasing or decreasing connections?
42. What is MBean, how many types are there?
43. How to restart proxy?
44. Reasons for server crash?
45. Reasons for servers hang?
46. What is the thread hogging?
47. Various garbage collection algorithms?
48. How to find whether the PORT No is free or not?
49. What is the command to find CPU utilization?
50. What is the command to find version of Unix?
51. How to find CPU utilization? What if top command doesn’t work?
52. What are you commonly used fine tuning commands?
53. What is the difference between webservers and Proxy server?
54. How to sort the files?
55. What is Session replication? What are the different types of Session Replications?
56. Which IP segment will you use for Multicasting?
57. Is it possible to manage multiple domains through a single weblogic
admin console?
58. What happens if we change config.xml while server is running?
1. What is domain in WLS ? how to create a domain in WLS ?
2. What is CONFIG.XML ?
3. What is cluster and how to create a cluster in WLS ? how to configure cluster in webserver /
PROXY ? tell complete configuration ?
4. What kind of PROXY u are using in your project ?
5. What is SSL and how to provide security ? what is certificate ?
6. What is one way SSL and two way ssl ?
7. How to generate certificates ? where you can store certificates ?
8. What is THREAD DUMP , why thread dump is necessary in which scenario we will be taking
thread dump ?
9. How do u take thread dump ?
10. What is performance tuning ? how do u tune the performance step by step procedure ? ANS
: tell from OS Lever to Our Application Level
11. What is HEAP and how to increase it ?
12. What is OOM problem / memory leak , how to overcome this problem ?
13. Complete trouble shooting steps ?
14. How to provide the security in proxy ?
15. Can you create Admin Server and managed servers in a single machine ?
16. Project architecture ? which architecture you are using ? (DMZ)
17. Which JVM you used ?
18. What is HS_ERR_PID<>.log
19. What is server log ?
20. How to provide JDBC log ?
21. How view log files in linux ?
22. Recovering admin password ?
23. How to open a file in UNIX ?
24. What certificate chaining ?
25. Session stickness ?
26. What is the use of multi cast ID ?
27. What will be there in Access Log ?
28. What is the use of boot.properties file ?
29. JMS ?
30. Connection pooling and how to create connection pool ?
31. Which performance tool you are using for monitoring the performance WLS ?
32. How to verify the network performance in any OS ?
33. Application is working but the DB is not supporting what kind of exception u will get ?
34. How to deploy an application through command line ?
35. How to check CPU utilization in UNIX ?(top)
36. How to check the disk space in UNIX ? (df –k)
37. What is node manager and what is use of it ?
38. What is garbage collection ?
39. What are the variables of the HEAP SIZE ?
40. What is head and tail command ?
41. What is Certificate Signature Request ?
42. What is the default port of the node manager ?
43. How do u find the port number is used by some the other server ?
44. What are the deployment stages ?
45. tesstart command ?
46. what is the role of JNDI ?
47. what is difference static and dynamic deployment ?
48. how do u know which thread is executing and how much time it will take ?
49. How do u give the prevalization to users and groups in UNIX?
50. Url Rewriting in weblogic?
51. What is VMSTAT command in sun Solaris?
52. How do you find port numbers in Linux?
53. What is the use of netstat command?
54. Daily activities?
55. How do u monitoring the CPU Utilization?(top or sar)
Ans: # sar -u 12 5 ` Where,-u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 time
57. How the sar command shows the out put?
58. Questions on SSL(Complete)?
59. Did u attend any calls with u r clients?
60. What are Handling Disaster Recovery and Failover activities?
61. What are the things you did if the database server fails?
62. From where you are getting the trail certificates?
63. How much size you for the key generation?
64. HOW we configure SSL in proxy?
65. How we view the log files?
66. Which tool you are using for building an application?
67. What is your admin level? (L2)
68. Can we create two admin servers in a single domain?
69. What are the disadvantages of connection pooling?
70. Could you explain folder structure in bea?
71. How can we verify file size in Linux?(du –sh)
72. Why connection pooling?
73. What are the difference between authentication and authorization?
74. What are the role, user and principle?
75. Why clustering in weblogic?
76. Did you prepare any documentation as solved the any problem?
77. If you don’t have any work what can you do at that time?
78. How many machines are using in your project?
79. Can you explain your project flow? How it takes requests and give response to the clients?
80. How to generate jdbc log files?
81. If config.xml file is lost at runtime what is the solution to run the application successfully?
82. Explain different deployment stages in weblogic?
When conducting interviews I prefer to avoid difficult questions, and instead ask fairly simple
questions and look at how well the candidate answers. I would prefer to hire someone who can
clearly and concisely explain how to do a simple task than someone who knows every single
thing about a particular technology.
I explain at the beginning of the interview, it's acceptable if they are not able to answer every
question; I use their answers to help decide if they will be a good fit for the team and the role.
Here are some of the questions I like to ask after I've given them a description of the role on
offer.
Non-Technical Questions
Which of your previous roles do you think have give you experience that could be
important for this role?
Tell me what is involved in a typical day in this role?
Describe the kind of infrastructure you worked with in this role?
On a scale of 1 to 10, with 1 being "no knowledge" and 10 being "know everything", how
would you rate your own skills? (I don't look for people who think they "know
everything").
What are some of the things you need to learn more about?
Technical Questions
If you were trying to access an application via a HTTP proxy and were getting a 404
error, how would you go about determining why you were getting this error?
Describe how you would go about configuring a WebLogic server to give an application
access to a database.
How many threads does a managed server make available to an application? (expect
different answers for different versions of WebLogic)
What kind of problems would you expect to encounter when trying to increase a managed
server's maximum heap size to 3 GB? (Problems on 32-bit operating systems).
If an application was suffering short periodic freezes, and no errors were appearing in the
logs, can you suggest a possible cause? (Garbage collection)
How could you prevent these periodic lock-ups?
What are the ways you could check when garbage collection is occurring?
If you start an admin server as a Windows service, where is that server's classpath
defined? (Windows Registry)
If you start a managed server via a node manager, where is that server's classpath
defined? (config.xml)
If a managed server is crashing with a StackOverflow exception, what could be the
cause?
Describe how you would go about configuring a JMS queue in a WebLogic cluster. (i.e. a
distributed queue).
Describe how you might run a WLST script?
What are clusters?
Cluster is a logical set of multiple Weblogic Server instances running
simultaneously across different geographies and working together to achieve high
availability and scalability
Weblogic Server clusters support multiple algorithms for load balancing and
failover: round-robin, weight-based, random, round-robin-affinity, weight-basedaffinity,
and random-affinity(By default, a Weblogic Server cluster will use the
round-robin method)
What is session replication?
Weblogic Server provides clustering support for servlets and JSPs by
replicating 'HTTP session state' of clients that access servlets and JSPs through a
cluster service
Weblogic Server can use 'memory, file based and database' persistence for
storing session information
How you deploy your applications on weblogic server?
Auto Deployment
Console
Command line – weblogic.deployer
ANT / WLST
What are stating modes are available in Weblogic Server ?
Stage mode: Administration Server copies the deployment files from their
original location on the Administration Server machine to the staging directories
of each target server
External Stage: target servers deploy using local copies of the deployment files,
here the Administration Server does not automatically copy the deployment files
to targeted servers in external_stage mode ; instead, you must copy the files to the
staging directory of each target server before deployment.
No Stage: 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.
What is a Thread dump? How will you take in unix/linux and windows?
A Java thread dump is a way of finding out what every thread in the JVM is
doing at a particular point in time. This is especially useful if your Java
application sometimes seems to hang when running under load, as an analysis of
the dump will show where the threads are stuck.
Linux : kill -3 <ps_id>
Windows (console mode) : crtl+break
Windows (service) : beasvc -dump -svcname:mydomain_myserver
How should u look for in a Thread Dump?
Always have 7-10 thread dumps taken in an interval of 5 seconds each
A thread dump will give you an insight on what every thread in the JVM is
currently doing
While analyzing the thread dump you should be looking for stuck threads
(threads which have not moved from a long time) – could be a resource (file / db)
lock not allowing the thread to complete the task and free the monitor
Look for thread locsk(if two threads store references to different objects into
the same reference value, the variable will subsequently contain a reference to one
object or the other, not a reference to some other object or a corrupted reference
value)
Look for recursive loops in application / server code traces, usually hampers
server performance by utilizing CPU
What is difference between 8.1 and 9.2, 10.x versions?
8.1 uses JDK 1.4.2 ; 9.2/10.0 uses JDK 1.5 ; 10.3 uses JDK 1.6
8.1 uses execute worker threads ; 9.2/10/10.3 uses work manager for work load
distribution within the server
Directory structures
Console applet bases in 8.1 ; while it is portlet based in later versions
8.1 has one big config.xml ; later versions have basic info in config.xml and
subsystem level info in different directories(jms, jdbc, etc)
What are multi pools / multi data sources?
MultiPools are 'pools of connection pools' that you can set up according to
either a high availability or load balancing algorithm
You can use a MultiPool in the same manner that you use a connection pool.
When an application requests a connection, the MultiPool determines which
connection pool will provide a connection, based on the selected algorithm
What is IIS server?
IIS is a webserver developed by Microsoft which is shipped with Windows
NT/2000/2003 +
Available versions : 5, 6, 7
Usually used for hosting static HTML pages and used as an aplkication server
for ASP.NET application developed using DOT NET framework 1+.
Can be used as a proxy server for routing requests to weblogic server
Where are user credentials stored?
User credentials are stored in the 'boot.properties' file , which has its encryption
key in the 'SerializedSystemIni.dat'
If you use a script to start a server instance, it is recommended that you do not
use this technique because it requires you to store an unencrypted password in the
startup script.
Suggest few JVM tuning parameters.
Initial heap size and maximum heap size to be same (-xms and –xmx):T his
ensures less is spend by the CPU to allocate memory in rutime
Young generation (-XX:MaxNewSize): The bigger the young generation, the
less often minor collections occur. However, for a bounded heap size a larger
young generation implies a smaller tenured generation, which will increase the
frequency of major collections. The optimal choice depends on the lifetime
distribution of the objects allocated by the application.
Q: What do you mean by weighted based server instance? How do you configure it?
Ans: The Weblogic Servers in the clustered environment could be routed in 6 ways ROUND-ROBIN,
WEIGHT-BASED, RANDOM and same algorithms with Affinity. Weight is defined as the number of the
requests incoming to a managed server that is default 100. As per the machine capacity and Operating
environments will make you to deside how much weight is suggested on that managed server. We can
control the incoming requests using weights increase or decrease, So, this way we can route all the
request to one of the managed server in the Cluster. This Weight differences can be used when there is
operating environment differences are there.
Q: How to enable EJB available to servlet? asume servlet on apache, ejb on Weblogic cluster.
Ans:Any external access to EJB is not allowed. if the apache webserver already configure as front-end.
then we need to look up by JNDI tree.
Q: What is the silent mode installation file contains root element? When do you require this mode of
installation?
Ans:The root element in silent.xml is <install>This kind of mode usually required in two different
situations.
Situation1 : Weblogic clusters could be installed/implemented only on homogenous environments. If
cluster1 is constructed with MgdServer1, MgdServer2if one server isusing Weblogic 7 environment and
other one on Weblogic 8.1 or higher this is not allowed.
Situation 2: When one huge project is migrated from one physical location to other, Where the
Application specialist must have the similar environment as the Production Server had. To prepare
Development work with similar kind environment we shall install on First system same as Production
Server rest of the developers systems could be installed with silent mode.
Q: What are the basic configuraiton requirements for a Cluster? or
Why do you need multicast address in Clustering?
Ans: The Multicast address is must for clustering, If server instance need to join the cluster it will use
multicast address. The Administrator server handles the web/resource request which is incoming to the
Weblogic server then the admin server will send poll messages for availability to handle the current
incoming request by which member server in the cluster with multicasting. The multicast address should
not conflict with the Network configurations on every member server. The range of multicast IP address
is : 224.0.0.0 to 239.255.255.255.The admin server sends a TTL (Time to Leave) packet,which will
acknowledges the readiness of a managed server. If more than one member server is available then it
will choose the member server with first come first server bases.
Q: What are all the ANT command options?
Ans:To view all options of ant command is simple, just use the following command :
prompt> ant -help
Note: This will work on Unix and Windows too iff PATH is pointing to ant specific jars
Q: What is the ANT version last you used? How to get it??
Ans: I am using Weblogic 8.1 it internally provides ant support which is 1.5.6 version.To get this simply
use :
prompt> ant -version
Q: How do you config eclipse with Weblogic?
Amazon.com Widgets
Ans:Weblogic version wise plug-ins are available for free download sites. Eg: lomboz tool it is a very
simple tool, my experience is that deployment on WL is very few steps required.Just we need to copy
the plug-in extracted to eclipse/plug-ins folder. Here we need to follow the correct J2EE specification for
easy deployments of application.
Q: what is the source to identifying the Connection pool failure? What is the remedy?
Ans: In WL 7/8 to identify the Connection pool failure we have 3 options:
1.The Connection pool hosting Server instance healthchecking by Monitoring tab where we need to find
the idle thread availability.2. Checking in the weblogic log of that corresponding server instance. Usually
we get broken pipe Exception.This could be generated due to overload on connection pool. To resolve
we can tune the execute threads for the corresponding server instance.3. Look for Thread dump and
identify the which thread is doing which task execution?
Q: What is Thread Dump? Why we need it? How do we get it?
Ans:Thread dump concept is used only by Admin users who operates the production server; it is the
dump of the behavior of the WebLogic server instance’s execute threads.When the thread dumps
helpful? If WLS execute threads misbehaving due to following reasonsMaybe you just need more
threads. Maybe you need some of your application to use a different queue. Maybe your application
needs tuning.There is a need of trouble shoots the issues due to various reasons:
1. Requests overloaded
2. Connection Pool fails
3. File cannot read/write for any application (which might be xml file too)
4. Queues are overloaded
or back-end legacy connection issues
Amazon.com Widgets
In windows CTRL + Break , There is another common method to get thread dump:a) Open a cmd window
(in Windows) or shell (in Unix/Linux)b) Set the proper java path and add weblogic.jar to the classpathc)
Run the following command script :prompt >java weblogic.Admin -url t3://host:port -username
weblogic -password weblogic THREAD_DUMP Here please replace with the correct host, port number,
username and password. You can get the thread dump from the standard output.
Best WebLogic (JVM ) Thread Dump analyzer are:
1. Samurai
2. Java TDA
3. Thread Dump Viewer
4. Eclipse lock analyzer plugin
Q: What is the procedure for Queues config? How to make them to free?
Ans:
1. The Queues configuration requires persistence storage which could be a File on operating system or a
DataSource.
2. The queue configuration requires JMSConnectionFactory, JMSServer, jms module Queue or topic as
per the application need
You can created using the Weblogic Administration console or using WLST in latest versions 9.x
onwards.
1. What are deployment descriptors?
Modules and applications have deployment descriptors—XML documents—that describe the contents
of the directory or JAR file. Deployment descriptors are text documents formatted with XML tags. The
J2EE specifications define standard, portable deployment descriptors for J2EE modules and applications.
2. What is the difference in the web.xml and weblogic.xml?
An application-specific XML-based deployment descriptor file named web.xml, which lists your
application's J2EE components and their configurations as J2EE modules. Each J2EE module is a
collection of one or more J2EE components of the same container type (Web or EJB) that are
represented by one component deployment descriptor for that type in the web.xml file.
A WebLogic-specific deployment descriptor file named weblogic.xml, which defines how named
resources in the web.xml file are mapped to WebLogic Server resources. Examples of weblogic.xml
attributes include HTTP session parameters, HTTP cookie parameters, JSP parameters, resource
references, security role assignments, and container attributes.
3. What is the default JVM used for Weblogic?
Sun Hotspot JDK default for Development installation, JRockit is for Production mode for WebLogic 11g
and 12c. Operating environment also factor to select the Certified JDK JVM. If you want to change you
need to specify it.
4. How to change from default JVM to other?
When you upgrade a domain to WebLogic Server 8.1, consider upgrading your JVM to JRockit. WebLogic
JRockit is a JVM designed for running server-side applications in Windows and Linux running on Intel
architectures. For server-side applications, JRockit has these advantages over other virtual machines:
It employs adaptive optimization, which detects and removes bottlenecks in the deployed application.
It is designed specifically for the special requirements of server-side applications, which tend to be
parallel and thread-intensive, to run for longer periods of time, and not to use graphical interfaces.
You can monitor JRockit using the WebLogic Server Administration Console.
Steps to change:
In the server start scripts, set JAVA_HOME (or equivalent) shell variables to point to the JRockit root
directory. For example, change:
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jdk131
where WL_HOME is the WebLogic Server 7.0 installation directory, to
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jrockit81_141_02
where WL_HOME is the WebLogic Server 8.1 installation directory.
Change the domain’s config.xml to use the JRockit javac.exe. For example, change
JavaCompiler="WL_HOME\jdk131\bin\javac"
where WL_HOME is the WebLogic Server 7.0 installation directory, to
JavaCompiler=WL_HOME\jrockit81_141_02\bin\javac”
where WL_HOME is the WebLogic Server 8.1 installation directory.
Remove from server start scripts any switches specific to the Sun JVM. For example, from the start
command:
echo on "%JAVA_HOME%\bin\java" -hotspot .... weblogic.Server delete “-hotspot”.
5.How to make a managed server?
v Backup the configuration by rename config.xml with config.xml_date
v Configure the changes in the startManagedWebLogic.sh /cmd with weblogic home and java
home and give the admin severs URL updated
v Go to weblogic admins console and add a managed server and give the IP and port of the
managed server. all the changes confirmed then start the server using
startManagedWebLogic.sh script present in the domain bin.
6. What is a license file?
http://support.bea.com/application_content/product_portlets/support_patterns/wlplat/LicensingPatte
rn.html
now you need to register with Oracle Support ID to get updated license xml file.
7. How to configure a DB connection pool?
Choose the DB type (Oracle, Sybase, Mysql, etc...).
Then choose the driver type for the DB.
Give the connection pool name.
Give the DB Service ID, schema name and password.
Then it will ask for testing the connection pool/DataSource.
After successful connection, it will ask you to create and deploy the connection pool target
to server or cluster. After creating new connection pool always point the jdbcstore to the
connection pool created. This is required because A JMS JDBC store will be used for persistent
messaging.
After each JDBC connection, we have to restart the server if there is startup classes dependancy
exists otherwise no restart required in WebLogic 9.x and higher versions.
8. What are the modes of operation for Weblogic server domains?
There are two modes: Development and production mode:
Development mode:
1. You use development mode while you are developing your applications. Development mode
uses a relaxed security configuration and enables you to auto-deploy applications.
2. You can use the demonstration digital certificates provided by the WebLogic Server security
services. With these certificates, you can design your application to work within environments
secured by SSL.
3. WebLogic Server instances can automatically deploy and update applications that reside in the
domain_name/applications directory.
4. When you start a server, the server automatically renames (rotates) its local server log file as
server-name.log.n. For the remainder of the server session, the server rotates its local log file
whenever the size of the file reaches 500 kilobytes.
5. The default number of threads available to Execute Queues is 15.
The default capacity is 15 JDBC connections.
Production mode:
1. You use production mode when your application is running in its final form. A production
domain uses full security and may use clusters or other advanced features.
2. A warning message is displayed if you use the demonstration digital certificates.
3. The auto-deployment feature is disabled, so you must use the WebLogic Server Administration
Console or the weblogic.Deployer tool.
4. A server rotates its local log file after the size of the file reaches 500 kilobytes.
5. The default number of threads available to Execute Queues is 25.
6. The default capacity is 25 JDBC connections.
9. What is JNDI?
Java Naming and Directory Interface
Applications use naming services to locate objects data sources, EJBs, JMS, MailSessions, and so on
within the WebLogic domain. A naming service associates names with objects and finds objects t3
protocol will be used. (The RMI registry is a good example of a naming service.)
JNDI provides a common-denominator interface to many existing naming services, such as LDAP
(Lightweight Directory Access Protocol) and DNS (Domain Name System). These naming services
maintain a set of bindings, which relate names to objects and provide the ability to look up objects by
name. JNDI allows the components in distributed applications to locate each other.
The WebLogic Server implementation of JNDI supplies methods that:
Give clients access to the WebLogic Server naming services
Make objects available in the WebLogic namespace
Retrieve objects from the WebLogic namespace
10. How to configure JMS?
Ø JMS (Java Message Service) is a standard API for accessing enterprise messaging systems.
Specifically, WebLogic JMS:
Ø Enables Java applications sharing a messaging system to exchange messages.
Ø Simplifies application development by providing a standard interface for creating, sending,
and receiving messages.
Ø Using the Administration Console, you define configuration attributes to:
1. Create JMS servers and target a WebLogic Server instance or a Migratable Target where the JMS
server will be deployed.
2. Create and/or customize values for JMS servers, connection factories, destinations (queues and
topics), JMS templates, destination sort order (using destination keys), persistent stores (file or JDBC),
paging stores, session pools, and connection consumers.
3. Define message and/or bytes thresholds and quotas, as well as a maximum allowable message size on
your JMS servers, destinations, and templates.
Enable any desired WebLogic JMS features, such as:
Server clustering using multiple connection factories.
Ø High availability and load balancing for destinations across a cluster by using distributed
destinations.
Ø Persistent messages and durable subscribers.
Ø Paging out message bodies during peak load periods to free up memory.
Ø Controlling message flow during peak load periods, including blocking message producers.
Ø Establishing a message expiration policy to ensure that expired messages are cleaned up
immediately.
Ø Preventing message quota errors by temporarily blocking message producers from sending
messages to a destination when it exceeds its specified maximum message quota.
Ø Concurrent message processing via session pools.
Oracle WebLogic 11g Server Interview Questions You'll Most Likely Be Asked
11. What is a domain template?
A domain template is a jar file default one is wls.jar file, which is
'/bea/weblogic81/common/templates/domains/, it has all the features that is required for the standard
weblogic domain, we can even create domain template of our own configuration. by this template we
dont have to configure every time we create a new domain.
By using template we can:
Create servers.
Clusters.
Machines.
Configure services such as JMS, JDBC, Applications
12. What are the Admin Default ports?
The non-SSL listen port for the Administration Server's default network configuration is 7001 by default.
The SSL listen port for the Administration Server's default network configuration is 7002 by default.
WebLogic Admin servers and Managed servers could communicate with Admin port which is separate
network channel. So that other communications can be run on different networks.
13. What are Weblogic clusters?
A WebLogic Server cluster consists of multiple WebLogic Server 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.
Benefits of clustering:
Scalability:
The capacity of an application deployed on a WebLogic Server cluster can be increased dynamically to
meet demand. You can add server instances to a cluster without interruption of service, the application
continues to run without impact to clients and end users.
High-Availability:
In a WebLogic Server cluster, application processing can continue when a server instance fails. You
"cluster" application components by deploying them on multiple server instances in the cluster, so, if a
server instance on which a component is running fails, another server instance on which that
component is deployed can continue application processing
1. Can you give the deployer utility syntax?
The syntax goes like this:
$ java weblogic.Deployer -adminurl http://admin:7001 -name appName -source /myapp/appName.ear -
targets [serverList] [-activate or other options]
2. How do you install Apache web server in UNIX and windows?
You will get a binaries for Apache website and you compile and build with the 4 steps
a. Extract the compressed file
b. Execute configure.sh file from the extracted folder
c. make
d. make install
http://wlabypani.blogspot.com/2009/11/apache-installation-configuaration.html
3 What is Oracle SID in Database?
It is a Service ID in Oracle database, that we need to use in configuring JDBC Connection pool.
4. What is listener in database?
In Oracle listener is that which is associated with a SID and host, port. It is configured in the
tnsnames.ora file. You can verify it by tnsping command.
5. What are the tuning techniques you applied?
Tunning for JVM - chanigng -Xmx, -Xms, MaxNewSize, MaxPermSize, and if required GC algorithms
Tuning in Threads/ThreadPool -- Defining Workmanager with maximum constraint
Tuning TCP/IP connections Interface address, backlog count,
Tuing JMS -- changing queue sizes as required
Tuing JDBC - initial count, maximum capacity, increase by number of connections
6. How do you troubleshoot if config.xml file will be deleted
First we look for is there any last good backup of configuration is availble on the Admin machine. If it is
not found then alternatively you can find it on remote machines where the managed servers running.
Best practice is whenever there is a configuration changes made before and after you need to take a
backup.That will help you such situation where you might need old configuration sometime.
7. How do u trouble shoot if managed server is in FAILED state?
If any managed server is in FAILED state there could be reasons as follows:
i) deployment failed
ii) JDBC DataSource issue
iii) JMS configuration issue
8. How to monitor webLogic using WLST?
First you need to connect to the adminServer. then you can use any Runtime MBean.
Using WLST we can monitor various Runtime MBeans such as ThreadPool, JVM, JDBC ConnectionPool,
JMS Server and Server Life Cycle for state of a WebLogic server instance.
9. Can you explain about bea guardian?
Gaurdian is only helpful when you have GUI. It is enables that all new patches available on Oracle site
can shown in the right downside corner shows.
10.What are monitoring tools you know?
There are wide varieties of monitoring tools available, such as:
a. HP-OVO
b. Introscope Willey
c. Patrol
d. Mercury and many more...
11. What are the difference between Connection pool and data source?
ConnectionPool is physically connects to the Database. where as Data Source is a logical resource that
can be used by developer or any other resource for accessing Connection of pools.
DataSource can be associated with JNDI name that is used for lookup from from any other client.
12. What are the difference in WebLogic 8.1 and 9.x?
Side by side deployment introduced in WL 9.x
deployment descriptors
JDK support 1.4 and 1.5 respectivly
console Look and feel changed Cuncurrent access is controlled with Change center 'Lock and Edit' ,
'Activate Changes', 'Undo All chnages' buttons.
ConnectionPool is included in DataSource configuration part.
JMS Uniform distributed destination is reduced configuration side.
JMX version change 1.2 so the MBean accessing methods simplified.
13. What is JMS and how do you configure it?
Java Messaging System it is a API supported by J2EE application server for messaging between diffent
resources. it can be used by MDB (Message Driven Beans). First you need to configure JMS System
resource, JMS module consists any one out of PTP, publisher/Subscriber type
14. What is cluster and how do you configure?
Cluster is a group of managed servers.
Using console
Usning WLST
You need to provide the Multicast address, Multicast port, Cluster Address which is nothing but the
listen addresses, listen port of all managed servers need to group together.
15. What is the use of multicast address?
In a WebLogic domain to broadcast the heart beat message to all cluster members. TTL will be send to
the multicast address, to this address all the cluster members are subscribers. If one of the Server
crashes that can be notified by all other members by missing 3 times heart -beat. So that secondary
server will takeover the request and start working with the replication data.
16. How to get thread dump and what the purpose of stuck thread?
Get the java process id, you can get it by jps or customized script for it.
kill -3 pid for unix env.
Ctrl+break for windows env.
When there is a Stuck Thread need to monitor the log for few minutes some times 2 or 3 stuck threads
hogging but after sometime it will be unstucked. If you take multiple thread dump for every 5 sec gap
and analyse with sumarai or Java Thread Analyzer tool you will get to know why it is stuck what is
causing the instances to mis behave that time.
17. What is nmenroll in WLST?
The nmEnroll() method is used for enroll the machine with the weblogic domains running on that. It is
name and its path.
the Nodemanager always get the domain information from the Administration server provided that it
should have enrolled in that machine.
18. Tell about ant scripts?
You can ANT Scripts are mostly used for deployment process in development environtments.
ANT can be used to
1. start WebLogic Server
2. deploy the application
3. Configure a single WebLogic server
4. invoking WLST script
19. Types of load balancing techniques and differences b/n them
There are Hardware loadblancer, Software loadbalancer BIG IP F5 is most leading load balancers in use.
Again the Software loadbalancing CMS, CSS Context Switch Servicing
Basically Load balances uses Round robin method to its connecting Webservers.
Plrease ref wikipedia.com for more details.
20. What is the important configuration file in apache?
The Apache configuration will be defined in the httpd.conf, if required segrigated weblogic.conf file can
be created.
SSL enable sites requires httpsd.conf
21. How do you provide load balancing?
In WebLogic Cluster side we have 3 basic types and each supports Affinity based also.
I) Round Robin
ii) Random
iii) Weight based
22. Why Data source is not there in Weblogic 9?
I just wonder about this question!! It is there under jdbc link
23. When do you use vi editor?
In UNIX environments we have vi editor for creating new file which can be shell or python or jython or
plain file.
I - insert mode
Esc - to come out of the mode
r - replace char
a - append to the line
O - insert above line
o - insert below line
dw - delete word
dd - delete line
x - delete char
/ - search a pattern
:set nu setup numbers etc...
24. What type of shell scripts you have created?
There are many bash scripts whihc I had developed
i) Finding a pattern in all log files.
ii) instance name assciated with PID
iii) Heap dump
iv) Multiple copy for produciton Code move
v) Many DB related scripts
vi) Log archiving scripts
vii) Daily DTS Collector scripts
25. What type of wlst scripts u have created?
WLST scripts
I) Thread Monitoring script
ii) JVM monitoring
iii) JMS monitoring
iv) DataSource monitoring
v) Site wise, Server wise, Domain wise scripts
26. How to test the port is existing or not in unix?
On the UNIX you can give the following command
netstat -na |grep <port>
Interview happen at NESS Technologies, India 2009
1. When do we go for jdrivers and XA drivers?Advantages?
This question is focused for weblogic Architect/developers. This choice is depends on the application if it
is having more transaction with Database requires reliable connections with the DB, more Entity Beans
on the ejb-tier then we need to choose JDriver when JDO is in application side. Transactional
consistency is mandatory for the application and response time is no matter then we choose XA.
2. Is there any disadvantages of using machines in cluster configuration?
Yes, If Weblogic domain not using the feature of NodeManager then it is a useless configuration.
3. What happens if we delete the log files when the server is running & when the server is not
running?
Better option is to NULLify the content of the log after archiving the logs. Nothing happen when we
delete a WebLogic server log files, When server is RUNNING, new logs will be generated w.r.t Server
instance and application logs depends on log4j.properties.
New loggging will be written if the file exists. It will always do appending to the log file. If the file is
removed then no appending happens. So that you don't know what is happening to the Server instance.
The other case, When NOT RUNNING not new log generated :)
4. Can we change the name of the log files?
When we want to change the log file names while running. If we change at run time WebLogic will
creates new log file again.
Using WLST, specifying logger with edit, save we can change it in the domain level also. Ref:
Unnikrishnan pillai blog.
5. What is the actual procedure of the application deployment in realtime? Basic reqiurement?
If there is no deployment tools in use then no-stage mode is preferred for production. Application code
will be deployed when target managed server is restarted. Admin server need not to copy the code to
remote machine. But you need to place the code in the code directory.
Production Redeployment can be done with weblogic.Deployer command also.
Latest version prefers to use deployment plan.
Realtime in the sense development or in Production? If it is Development procedure is simple we can
use hot deployment.
the number of components of the application are scheduled in sequance of deployment order.
for entity-ejbs some times requires restart of the server.
6. Why datasources ,JMS need JNDI?
JNDI is a light weight directory which is used to lookup from other resources. Entity EJB lookup for
DataSource, Message Driven
Beans lookup for JMS. Servlets, JSP web compoents lookup for JDBC connections for few actions. which
is not recommmend in real time.
7.Benefits of jRockit over jdk?
JRockit JVM strongly built with Aspect of Programming, POJO
JRockt don't have separate class loading in JVM space. Sun JDK JVM have a dedicated memory space for
it, that is PermSize.
JRockit performance is good once it is in RUNNING.
Sun JDK is faster than JRockit at launching time.
GC options are varies in both.
Please visit: http;//wlabypani.blogspot.com
8.What is Bootup Process?
StartWebLogic.sh script flow need to explain...
CLASSPATH
MEMARGS
GC parameters
to start the weblogic.Server class
check authentication if user, password given script takes from it. if not
check for boot.properties
Domain bootup process is like this...
Admin Server -> EJB TIER servers -> Web - Tier
9. How do u identify weblogic health in production?
Main Threads...
checking ThreadPool state for the WebLogic instance.
This depends on the client capacity ... if Client is willing to spend much on monitoring no downtime then
Introscope,
HP-OVO some more tools are available. for me I m using WLST for JVM, Idle, Hogging thread count
program which I had published in my blog.
10. What are the action to be taken when server is crash ?core file is not genetated what to do?
if sever is crash u cannot do anything after words :) if u got alerts you can managed to get Heapdumps as
you told.
reason pstack, jmap, pmap requires process id.
If third party package installed in Solaris then you can use dbx command for further investigation.
In solaries we use pstack and pmap command to take long stack and to find which thread library causes
the problem instead of using debbuger.. For linux is there any command that do the same tasks..pmap
is working in linux but there is no pstack command..after a long search i found one command which is
equal to pstack ...i.e lsstack ( equal to pstack).. but it is not working...
11. Difference between Weblogic previous 8.1 and 9.2 above versions such as ,10.3?
This you can ans only when you read release notes of each one.
already given weblogic interview questions 3
WLS Management from 6.0 to 8.1 WLS Management from 9.0 & above
Proprietary Remotable APIs to access
MBeanServer
Standards based, JSR 160. Deprecated MBeanHome &
RemoteMBeanServer
One MBeanServer, hosted all MBeans 4 MBeanServers, each MBS hosts MBeans depending on
functionality
Non schema based config.xml Schema based config.xml
Many broken links in MBean hierarchy All MBeans completely Linked, making the hierarchy
traversable
MBeanHome - Factory for creation/deletion
of all MBeans
Each parent MBean serves as a Factory to create/delete its
Child MBeans
Configuration change mechanism is atomic Introduction of transaction semantics to configuration
change
No control over configuration changes and
often unpredictable
Need a lock on configuration to make a change, more
control (can undo changes, stop edits etc)
AdminMBeanHome provided the federated
view of the Domain
DomainRuntime MBeanServer provides the federated view
of the Domain
CommandLine administration via
weblogic.Admin Deprecated weblogic.Admin, introduced WLST
WebLogic Domain Name in MBean's
ObjectName, ex:
mydomain:Name=myserver,Type=Server
Changed to com.bea, ex:
com.bea:Name=myserver,Type=Server
config.xml represented all WLS
configuration
{domain_dir}/config directory represents WLS
configuration i.e config is spread across multiple xml files
(JMS, JDBC & WLDF config in different files)
None Service MBeans to get to the root Mbeans
Execute Queues control Thread pool control Work Manager gives more effective and efficient Thread
pool control, like JVM crash can be controlled,
Welogic console combination of Applet and
webpage less in synchroniztion, no
possibility to extention of console.
New WebLogic console in Portals and easy to extention of
the console
No that much integrated Newly introduced webLogic Diagnostics Framework WLDF
is more useful for diagnostics
At a time single version archive is allowed Deployment can be done with application version wise
for deployment from commandline
JMS only two types JMS new types introduced for more flexibility Store and
Forward (SAF), distributed destination
Domain Templates are excellent feature for creating
multiple domains for a development.
Node Manager can start even Admin Server and the
commands can be given from WLST
12. What is Tivoli?why we use?How it works?
Tivoli is a IBM product for profiling tool WebLogic was having similar tool Merqury.
13. In order to see last 20 files what is the command?
At your Unix prompt you can give as follows:
ls -lrt | tail -20
14. In order to see last 20 days files what is the command ?
Simple way is using find command with ctime option and specify days signs +20
Custom Search
15. If SSL certificates are expired what to do?
Two options:
1. Using temporary demo certificates.
2. Get new renewal from CA(Certifying Authority) like verisign.
16. How to select where and which driver we have to use?
This is a typical question. This is obsolutely depends on application context.
Major impacting factors
i) load capacity number of connections
ii) Application contains PreparedStatements, CallableStatements preferable is OCI if it is Oracle. (DB
vendor specific driver)
iii) Thin Driver is preferable for certain number of connections only. But is most widely used with Oracle
RAC and Grid databases.
17. How to monitor the incoming traffic for webserver?
HP OVO, Patrol, access logs of web servers. By looking in the access logs of the web-server.
18. How to find network outages in environment?
Basically ping command will give required output if not outage can be predictable, In WebLogic instance
to instance inter-communication breakage will be indicated by BEA-000117 error code.
netstat -na |grep using port can be used for identifying the instance is responding or not.
19. How you will analyse threads state using samurai tool?
By getting the Thread dump for the impacted WebLogic instance. Normally, thread state could be
ACTIVE, STANDBY, STUCK, If the state is same for many thread dumps then need to check about that
thread.
Check for the 'wait', 'lock' keywords with find option, verify how the threads impacting, does it leads to
dead-lock? It is GUI tool which clearly shows in RED color which are the impacting threads in wait state.
20. Basic requirement for datasouce and connection pools?
Amazon.com Widgets
The Basic need for Connection Pool and DataSource are:
1. connection to the adminserver
2. JDBC Driver name, connecting parameters such as DataSource name, DATABASE schema details
(user,password, hostname, port, SID)
3. Target the connection pool to a 'server' or 'cluster'.
4. Finally verify the connection pool by testing it.
What is the difference between TRUNC and DELETE in SQL commands?
TRUNC
faster
dependent tables cannot work
DELETE
slow
row-by-row
cannot applicable for large tables
http://www.softstuff-consulting.com/kbase/showkb.asp?id=15
Amazon.com
Hi All, This is my first experience of attending the WebLogic System Administrator Interview. Here I am
going to share with you, it was held at Verizon.
1. Explain your work at Current Organization ?
I had responded to this keeping in a brief description of Middleware Administration activities... This is
common and general question by the interviewer, explained the work that I have been performing at
current project. Like WebLogic Installation, Domain creation, Deployment, Clustering, Trouble shooting
activities etc.
I said that I am good at Shell Scripting.
2. What is the first line in Shell Scripting ?
Ans: Shebang (#! /bin/sh) It is an interpreter directive to the program loader.
3. Give some examples of Unix commands like top, netstat etc.,
These commands are discussed in previous interview questions already so here I am leaving it for
navigate :)
4. What is the major configuration file in WebLogic ?
Ans: The WebLogic whole configuration stored into a repository file Config.xml in config folder present
in the domain directory.
5. What is error 404 and error 500 ?
Ans: These are the common issues encounter when web application have trouble. The error code 404 -
Page not found this says there is no page on the server when browser client requesting, this can happen
when application is not deployed properly or not in active state.
500- Internal server error This error occurs when there is a communication issue between server's
intermediate services
6. How many Administration servers and managed servers should be there?
Ans: In a WebLogic domain there must be a single Admin server and there can be as many as managed
servers as per the need and capacity limitations of the environment.
7. Difference between weblogic 9.2 and 11g ?
Ans: The major differences are
* JDK Version support WebLogic 9.2 supports JDK 1.5, whereas WebLogic 11g supports JDK 1.6
* More control provided in the Change Center of the Weblogic 11g console
* SAF feature is added in the JMS server for WebLogic 11g
* More focus given for hot deployment and deployment strategies : production pre-deployment
strategy, Production re-deployment strategy with weblogic.Deployer utility and also available in WLST.
What do you mean by hot deployment, clustering, Unix processes and commands were also asked.
Thank you,
Kishore.
https://sites.google.com/site/weblogicadminsite/weblogic-issues/weblogic-interview/WLA-Interview-
Questions--2
http://weblogicserveradministration.blogspot.in/2012/10/weblogic-interviewquestions.
html
Stay tuned for the answers of all questions and for many more questions :)
What is admin server ? what is the difference between admin and managed server ?
Admin server is the central domain configuration interface which is used to create,delete and
configure the resources of a domain like managed server, machine, cluster, data source, work
managers etc.
There is no difference between Admin and Managed server except admin interface application
by default deployed on admin server which is used to configure the domain resources. Apart
from that a admin server is same as a managed server, you can deploy and create other relative
resources on admin server also as you do on managed server.
How to access admin console ?
ssl enabled admin console accessed as :
https://<hostname_or_ip_address_where_admin_server_running>:<port_on_which_admin_se
rver_is_running>/console
Example - https://localhost:7001/console
non ssl admin console accessed as :
http://<hostname_or_ip_address_where_admin_server_running>:<port_on_which_admin_ser
ver_is_running>/console
Example - http://localhost:7001/console
Note : - By default weblogic admin server configured on port 7001 and SSL is not enabled.
How to check pid of a weblogic server ?
To check the process of a particular managed or admin server you can use
ps -ef | grep -i <name_of_your_admin_or_manager_server>|grep -v grep
( grep -v grep will suppress your command in the output )
Example -
ps -ef|grep -i wci_m1|grep -v grep
Above command will show you the process details of managed server with name wci_m1 from
where you can get process id, see output below, here process id is 32121
some people use
ps -ef|grep -i "weblogic.Name=wci_m1"|grep -v grep
both are same, you can use anyone
To check process id of weblogic server on window
On Window, you can go to task manager, under view tab select column option, select PID
option.
How many admin consoles possible in a single domain ?
only one.
What is the default port of admin server ?
7001
What is config.xml ?
config.xml is the central configuration repository for a domain. every resource you have
configured from admin console or by command line or by any other tool registered under this
file.
WLS 9.x onwards, this file contain references to other xml configuration files also those are
under your domain/config folder ( further sub folder under it for respective resources ) since
wls 9.x onwards concept of modules are introduced for sub resources like data source, jms etc
otherwise prior to 9.x ( 8.x or older ) every configuration was stored under this single config.xml
file.
What is boot.properties file ?
boot.properties is the file used by admin or managed server during startup for username and
password. it exist under your domain/servers/server_name/security folder.
( Below information is for some advance users )
To specify a customer directory for this file you can use
-Dweblogic.system.BootIdentityFile=[location]/boot.properties
When you create a domain in development mode then it creates automatically during startup
of admin server but if you create a domain in production mode then you need to define
it explicitly otherwise on every reboot of admin server it will prompt you for username and
password.
So in production mode -
Start admin server by manually passing the username and password
stop it ( press cntrl+c on the started session )
go to your domain/servers/your_admin_server/
create a folder "security"
go inside security and create a file "boot.properties" with below contents
username=your_admin_username
password=your_admin_password
now start the admin server, it will not prompt you for username & password further.
If you are going to start your managed servers from admin console then no need to create this
file for managed server but if you are going to start managed servers via startManagedweblogic
script then you need to follow the same above procedure for each managed server.
How to start admin and managed server ?
check my blog page http://weblogicserveradministration.blogspot.com/2010/10/start-stopweblogic-
servers.html
What is node manager ? what are the benefits of node manager ?
How to set classpath ?
What is weblogic.jar file ?
What is cluster ? what are the benefits of a cluster ?
What are the different cluster algorithm and difference between them ?
What is cluster address ?
What is Multicast ?
What is unicast ?
Whart is the difference between multicast and unicast ?
What is the difference between vertical and horizontol clustering ?
What is JMS ?
What is a JMS server ?
What is SSL or what is the purpose of SSL ?
How to deploy an application ?
What are different staging modes and differences between them ?
What are the different forms of weblogic deployment files ?
What are the difference between jar, war and ear files ?
What is the difference between web.xml and weblogic.xml ?
What is virtual host ?
What is a machine ?
What is JNDI ?
What is t3 or functioning of t3 ?
What is MSI mode ?
What is connection pool ?
What is data source ?
What is the difference between Data Source and Multi Data Source ?
What is heap and how to define max and min heap size ?
what is the difference between heapdump, memorydump and thread dump ?
What is the impact on Managed server if admin server goes down ?
Is that possible to start Managed server if admin server is not running ?
How to change the weblogic password ?
What are deployment descriptors ?
What is autodeployment ?
What is exploded form of deployment ?
What is the difference between production and development mode ?
What are the differences between weblogic 10g and 11g versions ?
How to configure apache with weblogic ?
What are startup and shutdown classes ?
What is session replication and how to enable it ?
What is MBEAN ?
What is the difference between .out and .log file ?
Keywords : weblogic server interview questions, weblogic interview questions, weblogic
interview questions blog, weblogic interview questions, weblogic Administration interview
questions, Weblogic interview questions and answer, Weblogic Interview Questions & Answers
Q1) If we have only 10 users for a particular application, can Admin server do the job of
Managed server?
Ans: Yes, but generally Admin server is not used to deploy any application.
Q2) Does Admin server directs( distributes) end user requests to Managed servers?
Ans: No. Request from Load balancer go directly to Managed server. Admin server doesn’t
interfere in end user requests.
Q3) If Admin server goes down, what will happen to end user requests?
Ans: Nothing. As they are responded by managed server, even if Admin server goes down, end
user request will continue.
But the moment Managed server need to contact Admin server for any info, and it find Admin
server not available, managed server will go in INDEPENDENCE MODE. It is not good and
centralized config.xml is not maintained. So, for 15-20 min, even if Admin server went down,
request will run.
Q4) If in adomain, only one server is there, it is Admin server or manager server?
Ans: Admin server
Q5) How the know if the weblogic server running is Admin server or Managed server?
Ans: 1. $ ps -ef|grep -i weblogic.server
or ps -ef|grep -i java
Managed server have “Dweblogic.management.server=<admin url>” in the parameter
provided.
Admin server doesn’t have it.
2. From config.xml
3. From Admin console
Note: i. to find which values are passed to server and what to JVM, here is the way
starting witrh D –> parameter and value passed to weblogic server
starting with X –> parameter and value passed to Java/ JVM
- See more at: http://www.weblogicbeginner.com/weblogic-interview-questions-
1/#sthash.S0GOWsng.dpuf
1. Questions in an interview are mostly based upon 2 things.
i. what you say … like your answers to questions like
Tell me something about yourself ?
What is your daily activities/responsibilities?
OR your answer to any other technical question.
ii. What is the need of the team you are giving the interview?
If they just want someone who can do simple routine activities , then probably interview
questions will be very simple and basic questions will be asked, but if they want someone in
very responsible position technically, then as expected , it will be tough. Many times,
companies employ external consultant to do this mission critical interviews.
90% of interviews lies somewhere in between these two extremes.
Don’t worry. They are also human beings. No body knows everything. What is more important
is interest to learn and determination to win. Problem solving and never say die.. attitude is
most important in software industry whether it is technical problem or man-management
problem.
Cheers!!!
*************************************************************
Q1) What is your database for Weblogic server (WL) or what is the default database for WL
server?
Ans: Point base is the default database for WLS. It comes with Weblogic software bundle. But,
we can implement any database oracle, DB2, point base etc…
Q2) If my admin server is not available, can i still start my managed servers for that domain?
Ans: Yes
Lets understand this. Admin server,Managed servers all are JVM. All can start/stop
independently. Only thing is we cannot change servers configuration until Admin server is
available. It is called Independence mode. It is not a advisable one, though.
Q3) If my database becomes unreachable or get restarted, will connection pool still stick
around?
Ans: Yes
It is independent of its ability to communicate with DBMS. All the connections in the pool may
become defunct, but the connection pool exist.
Q4) Can you tell difference between JMS topic and JMS queue?
Ans: Queues delivers messages to one consumer, topic to multiple.
Q5) Weblogic is currently owned by which company and originally by which? or What is the full
form of BEA?
Ans: This is not a technical question, but simply to understand general awareness of the
people/organization behind the software.
Originally Weblogic was owned by BEASystem. Later purchased by Oracle Inc. 3 Guys named
Bill, Ed Scott and Alfred founded it in 1995. So they took first letter of their name. thats it!!!!
Simplicity right!!!
Q6) How will find the version of Weblogic server?
Ans: Version can be found in log files or config.xml easily. By command also we can do it
$ java weblogic.version
For detailed version info
$java weblogic.version -verbose
Q7) Tell one recent error you got and how did you solved it?
Ans: This is a super offer in plate question. If he asked it, you have a good chance to get
selected. What is the trick?
Always Always keep in mind 4 – 5 common/uncommon error and their good solutions. You can
make very good impression.
I will tell more in coming post. In fact even a scenario like high CPU load article i have posted
some time back is good one.
Here is one more…
We were trying to make a domain, but when we ran config.sh, it showed some java error.
/usr/lib/jvm/java….No such file or directory .
On investigation , we found it is pointing to wrong java location. Actually we forgot to run env
setting file.
we ran commEnv.sh and than ran config.sh . It resolved the issue.
Q8) What is JNDI?
Ans: Java Naming and Directory interface. This is a favorite question. Don’t know why. Read
mode and more on it…
Any way, JNDI and Cluster , there 2 are ever HOT topics for interview.
Q9) What is autodeployment? What is it used for and how to turn it off?
Ans: There was a option Hotdeployment in earlier version. Now its Autodeployment.
In simple words, any deploy able files put in autodeploy folder ( $DOMAIN_HOME/autodeploy)
are automatically deployed. Libraries cannot be deployed using autodeploy feature.
It is generally used for development purposes and is available only when server is started in
Development mode. To turn it off, simply remove ths files in the folder or change to production
mode.
Q10) What is cross-cluster replication?
Ans: It is the ability provided by WL to replicate HTTP sessions across two clusters in separate
domains.
Here some direct interview questions. Generally few indirect questions are also asked like in
above question, some one may ask.. we need to replicate http session across domains, it is
possible. If not why and if yes, how?
++++++++++++++++++++
Q11) In how many ways you can do configuration changes?
Q12) How can we make Node-manager to start during system startup?
Q13) What are Log filters and their uses?
Q14) Have you done any deployment? can you explain it in brief?
Q15) What type of information will be in web.xml, weblogic.xml and application.xml?
Q16) Is it possible to refresh static component of a already deployed application without
required to redeploy whole application? — yes
Q17) How to edit config.xml file?
Q18) What is a connection pool and connection object?
Q19) What is JMS? Tell some practical uses of it
Q20) What is persistent Messaging? Any practical example you can give.
- See more at: http://www.weblogicbeginner.com/weblogic-server-admin-interview-questionspasrt-
2/#sthash.vCbzwQv0.dpuf
Weblogic: 10g R3 –> It is called 11g
============================
Q1) What is Weblogic server?
A weblogic server is a instance of java process executing in a JVM. Please note each java
process runs on a JVM.
Application server is a single process running in OS. We can have multiple servers, application
servers running on same piece of hardware.
Two Type of servers:
1. Administration server:
2. Managed server:
Q2) What is a Admin. server?
=====================
Every domain have one and only one admin server. It is the central point of control for the web
domain.
It runs Weblogic admin console.
It is in charge of congfig.xml. Config.xml contains configuration info about domain.
Q3) What is a Managed server?
======================
-A domain can have zero or more managed server. i.e any server in a domain which is not a
admin server is a managed server.
- contacts admin server for config info.
- in prod env, we host application on Managed servers, not on admin server, though admin
server can also host applications.
- Independent of other servers in domain ( unless in a cluster)
- can have multiple Managed servers in a domain.
Admin server stores the master copy of the domain config, including config for all Managed
server.Each Managed server stores local copy of domain config.
First Admin server is started. It read config.xml and build all JMX Mbeans needed for entire
domain.
Then Manged servers are started .They contact admin server for each one’s JMX Mbeans.
When any config change is done, the admin server send the changes to Managed server.
So, to do any changes, we need to contact Admin server through console or WLST. Admin
server will push those changes to Managed servers.
Q4) What is a Machine in Weblogic server?
=============================
A computer that hosts the WL server instances.
Used by node manager to restart a failed managed server.
Note: A ( WebLogic) WL server is nothing , but a Java application running in JVM. It is a process.
Q50 What is a Cluster?
================
A cluster is a logical group of WLServers, acting together for high availability and Load
Balancing.
It is transparent to a client.
Note:
1. A cluster cannot span domain i.e. all the servers in a cluster must be in same domain.
2. Only Managed server can make up a cluster.
3. All servers in a cluster must be same version level, though they can run on different machines
with different OS.
Q6) What is aDomain?
===============
Llogically related group of WL server resources that are managed as a single unit.
It is administrative boundary for all servers, admin server, managed
servers,clusters,applications,services etc.
We can have dev,test, prod domains. Or Domain that span different organizational
boundaries. Likes a domain for HR resources application.
It is transparent to applications and can be configure even after applications are deployed or
are in prod env.
So, Domain is just administrative feature.
Note:
- Each domain must have its one Admin server.
- Any given admin or managed server or cluster can belong to only one Domain
- Managed servers in a domain must run same WL server version and Admin server must have
same or higher WL server version.
So , a domain have only one admin server and an admin server serves only one domain.
Q7) What is a Node Manager?
=====================
-Node manager is a utility or process running on a physical server that enables starting,
stopping,suspending or restarting admin and managed server remotely.
-It is not associated with a domain, though can start any server that reside on same physical
server.
-it is required if we use Admin console to start servers
- required for whole server migration and for some configuration of automatic server migration.
two version:
1. java-based
2. Script based.
=========
After weblogic installation some files we have are:
1. Oracle home: cd /u01/app/oracle/product/Middleware
2. registry.dat or registry.xml :–record of all Oracle products
3. utils:– Additional Jar files
4. wlserver_10.3:– weblogic server 10.3 home
5. logs :– Installation logs
6. Modules:–jar files installed in Oracle home
cd wlserver_10.3
1. common: common files shared by wl server 10.3 components including template Jar files.
2. samples: sample codes and resources
3. server: server software components i.e. executable,db files, XML jar files. alternative JDBC
files,WL server Jar files ,
plug-ins
4. uninstall: code to uninstall WL server 10.3
=====
to set env variables:
1. setWLsenv.sh ( WL_HOME/server/bin ) — set WL_HOME, JAVA_HOME,PATH,CLASSPATH
2. it calls commEnv.sh ( WL_HOME/common/bin —set common env variables BEA_HOME,
ANT_HOME, POINTBASE_HOME
=====
to know the java version.
java -version
- See more at: http://www.weblogicbeginner.com/weblogic-concepts-1/#sthash.GxI3aB1I.dpuf
Steps to create Weblogic Domain.
Before creation , lets have some liltle Q/A to make things more clear. Basic Weblogic server
architecture you can find here.
Q1) Under one BEA_HOME, can we have multiple WL_HOME ( Weblogic homes) ?
Ans: Yes, we can have. But, generally not done. One BEA_HOME–> One WL_HOME.
Q2) In how many modes a WL server can be started?
Ans: Two modes
i. Development mode –> Default
ii. Production mode –> Ask username/password while starting/stopping Admin server.
Q3) Can a BEA_HOME have multiple DOMANIN_HOMEs ?
Ans: Yes
Also, A box can have multiple BEA_HOMEs.
Q4) How to find domain version?
Ans: By Config.xml. Evey domain will have its own config.xml and this file contains all the
information. Admin server and all Managed server’s name,port, ip address etc . In fact, we can
change Admin server from config.xml.
<admin-server-name> –>server_name< — change here.
Q5) Where is username/password stored ?
Ans: SerializedSystemIni.dat in encrypted form.
Actually, username/password can be stored in a file or in DB. But if stored in DB, it must be up
for authentication. So, generally username/password is stored in a file.
Q6) What is DOMAIN_HOME location?
And: Default: $BEA_HOME/user_projects/domains/
In companies: $HOME/domains/ $HOME is home path of user.
Q7) How to create a domain ?
Ans: There are 3 ways to do it.
1. GUI i.e. Graphical mode
2. Console mode
3. Silent mode, Template based
8. Steps to create Weblogic Domain in GUI mode.
We suggest, first create a domain in GUI mode, so that you will get accustomed to options
available. Then you can easily do it in console or template mode. In companies, console mode is
most preferred.
1. $ cd $BEA_HOME/$WL_HOME/common/bin
2. $ ./config.sh
Installer will appear.
3. Select “Create a new WebLogic Domain”
4. Select ” Base this domain on an existing template”
Note: Under $WL_HOME/common/template/domain/ we have a file called wls.jar
It is template for single server domain — mydomain, myserver . Prot: 7001
5. Give Admin username,password and confirm it. Then click Next.
Remember this username and password always.
6. Select whether you want to start Admin server in “development” or “Production” mode.
You can later change this setting by following this.
Also, Select java kit either SUN JDK or JRockit. Note, bith option will be available only if you
have installed both while installing Weblogic server. You can in fact select any other JDK also, if
available.
7. Select “Yes” and then click Next to do some Customization.
8. For RDBMS security store database, select ” I don’t want to change anything here” and click
Next . These advanced option we will discuss later.
9. Give Admin server Name, listen address i.e. ip address, port number and click Next.
e.g.
Name: goodbank_admin
Listen address: 192.165.123.1
Listen port: 8001
10. Now we have to configure Managed server.
Give Managed servers name,listen address and port numbers and then click Next.
11. Click Next as we not configuring Cluster now.
12. Click Next as we not configuring Machines now.
13. Review the selections made till now and then click Next.
14. Here we give Domain name and DOMAIN_HOME path.
e.g. Domain Name: Goodbank_domain
Domain Location: /home/wluser/domains
click Next.
15. Click Done.
Congratulations !!! you just created a domain with managed servers and non-default
DOMAIN_HOME path.
Q9) Last, but not the least, Can we create 2 Domains with same name in same box?
Ans: Yes, we can. DOMAIN_HOME path should be different. If given same path, second
installation will corrupt files of first domain.
- See more at: http://www.weblogicbeginner.com/how-to-create-a-domain-in-weblogic-server-
11g/#sthash.kEam5xC3.dpuf
1. What is a domain in weblogic server?
An Oracle WebLogic Server administration domain is a logically related group of Oracle
WebLogic Server resources. Domains include a special Oracle WebLogic Server instance called
the Administration Server, which is the central point from which you configure and manage all
resources in the domain. Usually, you configure a domain to include additional Oracle WebLogic
Server instances called Managed Servers.
2. What is an administration server?
The Administration Server operates as a central point of control for the configuration of the
entire domain. It maintains the domain’s configuration documents and helps sync changes in
the configuration documents to Managed Servers. You can also use the Administration Server
as a central location that helps monitor all resources in a domain.
3. What is a managed server?
Managed Servers host business applications, application components, Web services, and their
associated resources. Managed Servers maintain its own read-only copy of the domain’s
configuration document. When a Managed Server starts up, it connects to the domain’s
Administration Server to synchronize its version of the configuration document with the
document that the Administration Server maintains.
4. What will happen if an administration server fails?
The failure of the administration server does not have any impact on the managed server.
However, the domain configuration cannot be changed in the failed state as the admin server
controls the domain configuration.
5. What are deployment descriptors?
Deployment descriptors are XML files that describe the runtime behaviour for the deployment
unit or the application. These XML file contains information such as the context root of the web
application, the parameters to be set on application start up and the mapping of the portable
names of an application’s resources to the application Server’s resources. These descriptors lie
in the WEB-INF or the META-INFdirectories.
6. What is MSI mode?
MSI mode, if enabled, helps in starting the managed server without starting the Admin server.
With this option enabled, managed server looks for the msi-config.xml and creates an Mbean
out of it.
7. What all possible ways can be used to stat the webogic server?
a). Using the startWeblogic.sh script.
b). Using Node Manager
c). Using weblogic.admin start command
d). As a windows service usingbeasvc.exe
8. What is the difference between web.xml and weblogic.xml?
The web.xml file provides configuration and deployment information for the Web components
that comprise a Web application. Examples of Web components are servlet parameters, servlet
and JavaServer Pages (JSP) definitions, and Uniform Resource Locators (URL) mappings. This is
located in the WEB-INF directory.
Weblogic.xml is the configuration file for all the applications lying in the domain created. It lies
in the META-INF directory and contains parameters such as auth-filter, charset-params,
container-descriptor, context-root, description etc.
9. What do you know about weblogic classloading?
A classloader is part of JVM that loads classes into memory. Classloader is responsible for
finding the classes at runtime.
Weblogic uses the following classloaders:
Bootstrap classloader (JVM): Loads internal classes for JVM
Extensions classloader (JVM): Loads JARs placed in the extensions directory
Application classloader (WebLogic): Loads the EAR/WAR/EJB
10. What is a connection pool?
Connection pool is a named collection of identical JDBC connections to a database. This is done
for the purpose of efficiency so as to reduce the overhead of creating connection objects at
runtime.
11. What is JNDI?
JNDI or the Java Naming and Directory Interface is a naming service used to locate objects in
datasources, JMS, MailSessions etc. It is a kind of abstraction that the clients use while
connecting to the database. So the client looks for the JNDI to get the connection to the
database.
12. What is JMS?
JMS or the Java Messaging Service helps the application sin a domain to communicate with one
another. It simplifies the application development in weblogic by providing a set of methods
through its API that help in creating, sending and receiving messages accross enterprise
applications.
13. What is the difference between a JNDI and a datasource?
JNDI or the Java Naming and Directory Interface is a naming service used to locate objects in
datasources, JMS, MailSessions etc. Datasource is an object used to access the connections in
the pool. JNDI physically connects to the database whereas the datasource is a logical resource.
14. What is a weblogic server cluster?
Weblogic server cluster is a set of multiple weblogic servers running in parallel with each other
to provide increased scalability, reliability and high availability. A cluster gives the end-user the
feel of a single weblogic instance while multiple weblogic servers may be running
simultaneously in the background. All cluster related information/parameters are defined in the
weblogic.xml.
15. Is that possible to start Managed server if admin server is not running ?
Yes, if MSI is enabled.
16. What are the differene modes of Weblogic server?
In development mode, there is an application poller. This is a simple utility that polls the
“<domain>/applications” directory every 3secs (default). If it finds a different version of
application in the directory, then weblogic would redeploy the app automatically.
In production mode application poller is turned off. User would either have to deploy from
console or run weblogic.Deployer utility.
17. What is a virtual host?
A configured host name that routes requests for a particular DNS name to a WebLogic Server
instance or cluster.
18. What are the different staging modes?
Stage: The Administration Server first copies the deployment unit source files to the staging
directories of target servers. (The staging directory is named stage by default, and it resides
under the target server’s root directory.)
The target servers then deploy using their local copy of the deployment files.
NoStage: 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.
External_Stage: External_stage mode is similar to stage mode, in that target servers deploy
using local copies of the deployment files. However, the Administration Server does not
automatically copy the deployment files to targeted servers in external_stage mode; instead,
you must copy the files to the staging directory of each target server before deployment. You
can perform the copy manually or use automated scripts.
Q: - How do I increase WebLogic Server memory?
Increase the allocation of Java heap memory for WebLogic Server. (Set the minimum and the
maximum to the same size.) Start WebLogic Server with the -ms32m option to increase the
allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves
performance and allows WebLogic Server to handle more simultaneous connections. You can
increase this value if necessary.
Q: - Can I start a Managed Server if the Administration Server is unavailable?
By default, if a Managed Server is unable to connect to the specified Administration Server
during startup, it can retrieve its configuration by reading a configuration file and other files
directly. You cannot change the server's configuration until the Administration Server is
available. A Managed Server that starts in this way is running in Maindexindex1naged Server
Independence mode.
Q: - How are notifications made when a server is added to a cluster?
The WebLogic Server cluster broadcasts the availability of a new server instance each time a
new instance joins the cluster. Cluster-aware stubs also periodically update their list of available
server instances.
Q: - What happens when a failure occurs and the stub cannot connect to a WebLogic Server
instance?
When the failure occurs, the stub removes the failed server instance from its list. If there are no
servers left in its list, the stub uses DNS again to find a running server and obtain a current list
of running instances. Also, the stub periodically refreshes its list of available server instances in
the cluster; this allows the stub to take advantage of new servers as they are added to the
cluster.
Q: - Can I enable requests to a JDBC connection pool for a database connection to wait until a
connection is available?
No, there's no way to allow a request to wait for a pool connection, and from the system point
of view there should not be. Each requests that waits for a connection ties up one of the fixed
number of execute threads in the server, which could otherwise be running another server
task. Too many waiting requests could tie up all of the execute threads and freeze the server.
Q: - How do I use multibyte character sets with WebLogic jDriver for Informix?
Currently, multibyte character sets are not supported for the WebLogic jDriver for Informix
driver.
Q: - How do I increase WebLogic Server memory?
Increase the allocation of Java heap memory for WebLogic Server. (Set the minimum and the
maximum to the same size.) Start WebLogic Server with the -ms32m option to increase the
allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves
performance and allows WebLogic Server to handle more simultaneous connections. You can
increase this value if necessary.
Q: - Can I configure the messaging bridge to automatically downgrade the quality of service if
the Exactly-once service isn't available on either the source or target bridge destination?
Yes, just make sure to select the QOS Degradation Allowed check box on the Messaging Bridge
> Configuration > General administration console page.
Q: - How do I restrict access to servlets and JSPs?
The Java Servlet API Specification v2.2 allows you to declaratively restrict access to specific
Servlets and JSPs using the Web Application Deployment descriptor. Section 13.3.2 of the
specification has an example deployment descriptor that uses declarative security. For more
information, see Programming WebLogic HTTP Servlets.
Weblogic Important Question
Q.How many types of weblogic installation ?
Ans:- There are 3 types of weblogic installation.
(a) Grapical Mode (interactive GUI based)
(b) Console Mode (interactive Text Based)
(c) Silent Mode ( Non Interactive method using .xml properties file (-mode =console -silent_xml
=properties_xml_file).
Q. Difference between Unicast and Multicast?
Ans:- Unicast:- Unicast is a one-to one connection between the client and the server.
In cluster, In this concept one server 1st called server always acts like leader, every member
interact with leader, 1st server when brings up it is a Leader.
The main difference between Unicast and Multicast is as follows
Unicast:
Say you have three servers (MS-1,MS-2,MS-3) in a cluster now if they have to communicate
with each other they have to ping (i.e. heartbeats ) the cluster master for informing him that he
is alive.
If MS-1 is the master then MS-2 and MS-3 would send the ping to MS-1
Multicast:
Here there is no cluster master each server has to ping each other to inform everyone that I am
alive.
So MS-1 would send the ping to MS-2 & MS-3 same way MS-2 would send the ping to MS-1 &
MS-3 and MS-3 would ping MS-1 & MS-3.
Thus if you see in multicast the congestion in sending the pings are more compared to unicast
which makes multicast much heavier, thus WLS recommends using Unicast of less congestion in
the network.
Multicast is a very old concept in this concept all managed server talks to eachother in every
fraction of seond to show that they are alive.
Q. What is Cluster and Advantages of clustering?
Cluster:- “cluster is nothing but group or set of managed server so that we can handle tha
task to avoid overloading. “Group of weblogic managed server instance that work together to
provide Scalablity and High Availability”.
A WebLogic Server cluster provides these benefits:
Scalability
The capacity of an application deployed on a WebLogic Server cluster can be increased
dynamically to meet demand. You can add server instances to a cluster without interruption
of service—the application continues to run without impact to clients and end users.
High-Availability
In a WebLogic Server cluster, application processing can continue when a server instance
fails. You “cluster” application components by deploying them on multiple server instances in
the cluster—so, if a server instance on which a component is running fails, another server
instance on which that component is deployed can continue application processing.
The choice to cluster WebLogic Server instances is transparent to application developers and
clients. However, understanding the technical infrastructure that enables clustering will help
programmers and administrators maximize the scalability and availability of their applications.
5.Different between stage and no stage deployment?
Stage Deployment:- Admin server Having the physical copy and it will distribute to remaining
instances.
Staged deployment will copy your deployment units onto the deployment servers, place
them into the $WL_HOME/servers/SERVER_NAME/stage directory and deploy them from
there.
In stage mode, the Administration Server copies the deployment files from their original
location on the Administration Server machine to the staging directories of each target
server. For example, if you deploy a Java EE Application to three servers in a cluster using
stage mode, the Administration Server copies the deployment files to directories on each of
the three server machines. Each server then deploys the Java EE Application using its local
copy of the archive files.
When copying files to the staging directory, the Administration Server creates a subdirectory
with the same name as the deployment name. So if you deployed using the command:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mytestear -stage -targets mycluster
-deploy c:\bea\wlserver_10.0\samples\server\medrecd\dist\physicianEar
a new directory, mytestear, would be created in the staging directory of each server
in mycluster. If you do not specify a deployment name, a default deployment name (and staging
subdirectory) is used:
For exploded archive deployments, the deployment name and staging subdirectory
are the name of the directory you deployed (physicianEar in the example above).
For archived deployments, the default deployment name is the name of the archive
file without the extension. For example, if you deploy physicianEar.ear, the
deployment name and staging subdirectory are physicianEar.
The Administration Console uses stage mode as the default mode when deploying to more than
one WebLogic Server instance. weblogic.Deployer uses the target server’s staging mode as the
default, and Managed Servers use stage mode by default.
Stage mode ensures that each server has a local copy of the deployment files on hand, even if a
network outage makes the Administration Server unreachable. However, if you are deploying
very large applications to multiple servers or to a cluster, the time required to copy files to
target servers can be considerable. Consider nostage mode to avoid the overhead of copying
large files to multiple servers.
Syntax for Stage Mode
To use stage mode, specify -stage as an option to weblogic.Deployer, as in:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mydeploymentname
-targets myserver1,myserver2,myserver3 -stage
-deploy c:\localfiles\myapp.ear
No Stage Deployment:- Using Nostage Mode Deployment
In nostage mode, the Administration Server does not copy the archive files from their source
location. Instead, each target server must access the archive files from a single source directory
for deployment. The staging directory of target servers is ignored for nostage deployments.
For example, if you deploy a Java EE Application to three servers in a cluster, each server must
be able to access the same application archive files (from a shared or network-mounted
directory) to deploy the application.
Note:
The source for the deployment files in nostage mode is the path provided by the user at
deployment time (as opposed to stage mode, where the source is the path in each
server’s staging directory). However, even in nostage mode, WebLogic Server copies out
parts of the deployment to temporary directories. This enables users to update entire
archived deployments or parts of archived deployments.
In nostage mode, the Web application container automatically detects changes to JSPs and
servlets. Nostage also allows you to later update only parts of an application by updating those
parts in one file system location and then redeploying.
The Administration Console uses nostage mode as the default when deploying only to the
Administration Server (for example, in a single-server domain). weblogic.Deployer uses the
target server’s staging mode, and Administration Servers use nostage mode by default. You can
also select nostage mode if you run a cluster of server instances on the same machine, or if you
are deploying very large applications to multiple machines that have access to a shared
directory. Deploying very large applications in nostage mode saves time during deployment
because no files are copied.
Syntax for Nostage Mode
To use nostage mode, specify -nostage as an option to weblogic.Deployer, as in:
java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic
-password weblogic -name mydeploymentname
-targets myserver1,myserver2,myserver3 -nostage
-deploy c:\localfiles\myapp.ear
6.Use of heap:-
JVM Heap Size and Garbage Collection
Garbage collection is the JVM’s process of freeing up unused Java objects in the Java heap.The
Java heap is where the objects of a Java program live. It is a repository for live objects, dead
objects, and free memory. When an object can no longer be reached from any pointer in the
running program, it is considered “garbage” and ready for collection.
The JVM heap size determines how often and how long the VM spends collecting garbage. An
acceptable rate for garbage collection is application-specific and should be adjusted after
analyzing the actual time and frequency of garbage collections. If you set a large heap size, full
garbage collection is slower, but it occurs less frequently. If you set your heap size in
accordance with your memory needs, full garbage collection is faster, but occurs more
frequently.
The goal of tuning your heap size is to minimize the time that your JVM spends doing garbage
collection while maximizing the number of clients that WebLogic Server can handle at a given
time. To ensure maximum performance during benchmarking, you might set high heap size
values to ensure that garbage collection does not occur during the entire run of the benchmark.
You might see the following Java error if you are running out of heap space:
java.lang.OutOfMemoryError <<no stack trace available>>
java.lang.OutOfMemoryError <<no stack trace available>>
Exception in thread "main"
To modify heap space values, see Specifying Heap Size Values.
To configure WebLogic Server to detect automatically when you are running out of heap space
and to address low memory conditions in the server, see Automatically Logging Low Memory
Conditions.
9.States of the Server?
Ans:-There are 9 states of server:-
Shutdown
Starting
Standby
Resuming
Running
Suspending
Shutting down
Failed
Unknown
The series of states through which a WebLogic Server instance can transition is called
the server life cycle.
The Server Life Cycle:-
Q.Use of Stub?
Ans:-
Clients that connect to a WebLogic Server cluster and look up a clustered object obtain a
replica-aware stub for the object. “This stub contains the list of available server instances
that host implementations of the object. The stub also contains the load balancing logic for
distributing the load among its host servers”.
Q.What happens when a failure occurs and the stub cannot connect to a WebLogic Server
instance?
Ans:-When the failure occurs, the stub removes the failed server instance from its list. If
there are no servers left in its list, the stubb uses DNS again to find a running server and
obtain a current list of running instances. Also, the stub periodically refreshes its list of
available server instances in the cluster; this allows the stub to take advantage of new
servers as they are added to the cluster.
Q. How to check port number?
Ans:- netstat -na |grep connected (to find the ports connected in Linux box.)
netstat -na |grep listen (to find the listening ports in HP-UX,Solaris)
Q. Check the version of java.
Ans:- [root@h1vm /]# java -version run this command in linux to know the java version.
1). If two managed servers is there Same Domain is configured in both servers, but one physical
server is crashed then how can you create a domain with the same configuration?
2). Give me the real time scenario to configure weight based algorithm in a cluster?
3). If some servers in cluster are running some of them are down is it deployment is possible?
4). Is it possible two different versions of the same application deploy at the same time?
5). How to recover password in weblogic?
6). How to recover boot.properties?
7). How to recover serializedini.dat, if the file is corrupted?
8). How admin server knows that the managed server is down?
9). What you can do if multicast buffer is full and how you know that?
10). What is the Max amount of information that can be saved in a session object?
11). How do u differentiate a out of memory and memory leak issue?
In this article I will briefly discuss how I conduct interviews for WebLogic Administration roles.
When conducting interviews I prefer to avoid difficult questions, and instead ask fairly simple
questions and look at how well the candidate answers. I would prefer to hire someone who can
clearly and concisely explain how to do a simple task than someone who knows every single
thing about a particular technology.
I explain at the beginning of the interview, it’s acceptable if they are not able to answer every
question; I use their answers to help decide if they will be a good fit for the team and the role.
Here are some of the questions I like to ask after I’ve given them a description of the role on
offer.
Non-Technical Questions
Which of your previous roles do you think have give you experience that could be
important for this role?
Tell me what is involved in a typical day in this role?
Describe the kind of infrastructure you worked with in this role?
On a scale of 1 to 10, with 1 being “no knowledge” and 10 being “know everything”,
how would you rate your own skills? (I don’t look for people who think they “know
everything”).
What are some of the things you need to learn more about?
Technical Questions
If you were trying to access an application via a HTTP proxy and were getting a 404
error, how would you go about determining why you were getting this error?
Describe how you would go about configuring a WebLogic server to give an application
access to a database.
How many threads does a managed server make available to an application? (expect
different answers for different versions of WebLogic)
What kind of problems would you expect to encounter when trying to increase a
managed server’s maximum heap size to 3 GB? (Problems on 32-bit operating systems).
If an application was suffering short periodic freezes, and no errors were appearing in
the logs, can you suggest a possible cause? (Garbage collection)
How could you prevent these periodic lock-ups?
What are the ways you could check when garbage collection is occurring?
If you start an admin server as a Windows service, where is that server’s classpath
defined? (Windows Registry)
If you start a managed server via a node manager, where is that server’s classpath
defined? (config.xml)
If a managed server is crashing with a StackOverflow exception, what could be the
cause?
Describe how you would go about configuring a JMS queue in a WebLogic cluster. (i.e. a
distributed queue).
What is application server?
An application server is a software framework dedicated to the efficient execution of
procedures (scripts, routines, programs …) for supporting the construction of applications. The
term was created in the context of web applications. In these, the application server acts as a
set of components accessible to the software developer through an API defined by the platform
itself. These components are usually performed in the same machine where the web server is
running, and their main job is to support the construction of dynamic pages.
What is the Domain in Weblogic serve?
1) Domain is a logically related group of Oracle WebLogic Server resources that are managed as
a single unit
2) Domain Provides one point of administration
3) Can logically separate:
A) Development, test, and production applications
B) Organizational divisions
What is the server?
A server is an instance of weblogic.Server executing in a Java Virtual Machine (JVM).
A server:
1) Runs on a designated Oracle WebLogic Server machine
2) Has a dedicated amount of RAM
3) Is multithreaded
Two types of servers:
1) Administration Server
2) Managed Server
What is the Administration server?
Administration server is central point of control for a domain. It stores the configuration
information and logs for a domain. And it runs the Weblogic Administration console.
What is the Managed Server?
Managed server is a server in a domain that is not the Administration server. It contacts the
administration server for configuration information. It runs business application in a production
environment. It is independent of all other Managed servers in a domain (unless they are not in
a cluster). You can have many managed servers in a domain. Individual managed servers are
typically added for capacity and application isolation.
How Administration server and Managed servers will interact?
The Administration Server stores the master copy of the domain configuration, including the
configuration for all Managed Servers in the domain. Each Managed Server stores a local copy
of the domain configuration file. When a Managed Server starts, it connects to the
Administration Server to synchronize the configuration. When the configuration is changed, the
Administration Server sends the changed configuration to the Managed Servers.
What is the MSI mode in Weblogic? How can you enable and disable this option?
MSI is nothing but Managed Server Independence.
By default, Managed Servers can function independently of the Administration Server.
A Managed Server instance can start in MSI mode if the Administration Server is
unavailable.
Configure MSI mode from the Administration Console.
To start a Managed Server in MSI mode, perform the following:
o Ensure that the Managed Server’s root directory contains the config
subdirectory.
o If the config subdirectory does not exist, copy it from the Administration Server’s
root directory.
o Start the Managed Server at the command line or by using a script.
Environment > Servers > Server_Name > Tuning > Advanced > Managed Server
Independence Enabled check box.
Describe how you might run a WLST script?
11). How will you enable and disable the domain configuration lock?
The Administration Console Change Center provides a way to lock a domain configuration so
you can make changes to the configuration while preventing other accounts from making
changes during your edit session.
The domain configuration locking feature is always enabled in production domains. It can be
enabled or disabled in development domains. It is disabled by default when you create a new
development domain.
To enable or disable the domain configuration locking feature in a development domain:
In the banner toolbar region at the top of the right pane of the Console, click
Preferences.
Click User Preferences.
Select or clear Automatically Acquire Lock and Activate Changes to enable or disable the
feature.
Click Save.
After you finish
When you enable domain configuration locking, you must use the Change Center to lock and
edit for the domain configuration.
12). What are Dynamic and Non-Dynamic Changes in the Weblogic Console? What is the
difference?
Some changes you make in the Administration Console take place immediately when you
activate them. Other changes require you to restart the server or module affected by the
change. These latter changes are called non-dynamic changes. Non-dynamic changes are
indicated in the Administration Console with this warning icon,.
Changes to dynamic configuration attributes become available once they are activated, without
restarting the affected server or system restart. These changes are made available to the server
and run-time hierarchies once they are activated. Changes to non-dynamic configuration
attributes require that the affected servers or system resources be restarted before they
become effective.
If a change is made to a non-dynamic configuration setting, no changes to dynamic
configuration settings will take effect until after restart. This is to assure that a batch of updates
having a combination of dynamic and non-dynamic attribute edits will not be partially
activated.
Note that WebLogic Server’s change management process applies to changes in domain and
server configuration data, not to security or application data.
13). What is the information is going to store in the “security” folder of the Domain directory
contents?
This directory holds the security-related files that are the same for every WebLogic Server
instance in the domain:
SerializedSystemIni.dat
This directory also holds security-related files that are only needed by the domain’s
Administration Server:
DefaultAuthorizerInit.ldift
DefaultAuthenticatorInit.ldift
DefaultRoleMapperInit.ldift
14). What is the use of SerializedSystemIni.dat file in Weblogic?
It is important to protect passwords that are used to access resources in a WebLogic Server
domain. In the past, usernames and passwords were stored in clear text in a WebLogic security
realm. Now all the passwords in a WebLogic Server domain are hashed. The
SerializedSystemIni.dat file contains the hashes for the passwords. It is associated with a
specific WebLogic Server domain so it cannot be moved from domain to domain.
If the SerializedSystemIni.dat file is destroyed or corrupted, you must reconfigure the WebLogic
Server domain. Therefore, you should take the following precautions:
Make a backup copy of the SerializedSystemIni.dat file and put it in a safe location.
Set permissions on the SerializedSystemIni.dat file such that the system administrator of a
WebLogic Server deployment has write and read privileges and no other users have any
privileges.
15). How many ways you can change the configuration changes?
The change management features of WLS:
o Enable you to distribute configuration changes throughout a domain securely,
consistently, and predictably
o Are the same, regardless of whether you are using:
The WLS Administration Console
The WebLogic Scripting Tool (WLST)
The Java Management Extension (JMX) APIs
16). What is the uses of WLST in Weblogic?
o The WLS command-line tools are useful:
For automating common administration activities
As an alternative to the Administration Console
When graphical tools are not supported
o WLST provides a command-line interface for:
Creating new WLS domains
Retrieving and updating WLS domain configurations
Deploying applications
Obtaining run-time server statistics
17). How many WLST modules are there? Explain?
o Online mode:
Connected to a running server
Access to all WLS configuration and run-time attributes
Create and activate change sessions similar to the WLS console
o Offline mode:
Domain not running
Access to only persisted domain configuration (config.xml)
Create or update domains similar to using the Configuration Wizard
18). What is the Node Manager (NM)? Explain briefly?
Node Manager (NM):
o Starts and stops Managed Servers remotely: server, domain, and cluster
o Available as either a Java-based or (for UNIX or Linux) a script-based process
o Monitors and acts on server health
o Runs on the same computers as the Managed Servers
o Can be run automatically in the background, as a Windows service or a UNIX
daemon
19). How many versions of Node Managers are available?
o There are two versions of Node Manager:
Java-based Node Manager
Script-based Node Manager
o Java-based Node Manager runs within a Java Virtual Machine (JVM) process.
o Script-based Node Manager (used only for UNIX and Linux systems) does not
have as much security, but provides the ability to remotely manage servers over
a network using Secure Shell (SSH).
20). How Node Manager will work with the Weblogic Server? How will you configure Node
Manager in WLS?
o Node Manager must run on each computer that hosts the WLS instances that
you want to control with Node Manager.
o You should configure each computer as a machine in Oracle WebLogic Server,
and assign each server instance, which is to be controlled by Node Manager, to
the machine that the server instance runs on.
o Node Manager should run as an operating system service, so that it
automatically restarts upon system failure or reboot.
1). How are new threads assigned?
Ans:
As work enters a Weblogic Server, it is placed in an execute queue. This work is then
assigned to a thread within the queue that performs the work.
By default, a new server instance is configured with a default execute queue,
weblogic.kernel.default, that contains 15 threads (in development) and 25 threads (in
production).
In addition, Weblogic Server provides two other pre-configured queues:
weblogic.admin.HTTP—Available only on Administration Servers, this queue is reserved for
communicating with the Administration Console; you cannot reconfigure it.
weblogic.admin.RMI—Both Administration Servers and Managed Servers have this queue; it is
reserved for administrative traffic; you cannot reconfigure it.
Unless you configure additional execute queues, and assign applications to them, web
applications and RMI objects use weblogic.kernel.default.
2). Is there an ability to configure the container to kill stuck threads after X amount of time?
Ans:
Currently, Weblogic reports that a thread is stuck after X amount of time, but the thread
keeps running. Once the thread is stuck or processing it cannot be killed.
If they are not stuck or processing the request then they are called idle thread that is
waiting for request (waitforrequest() method: A thread invokes this method when it is
waiting for work to be assigned to it by its manager).
3). Is there a way to manually kill a stuck thread?
Ans:
No, once thread is created it would be reused but cannot be killed.
4). Why does the user “WLS Kernel” own so many threads?
Ans:
WLS Kernel owns only the number of the threads which are configured as a default.
5). What is “WLS Kernel” doing with these threads?
Ans:
As specified earlier it is kept in default execute queue and then assigned to a thread
within the queue that performs the work.
6). Can we make these threads available to the application?
Ans:
No we cannot do that.
I often get mails from people asking what are the questions generally asked in Weblogic by
interviewers.
Generally for an Administrator’s positions, in addition to Weblogic questions, there are a lot of
Unix questions and a few questions related to process and case handling.
These are the important questions that I cover while interviewing.
1. How do you differentiate between a server hang and server crash issue?
When a Server crahes, the JAVA process no longer exists. When the Server is hung, it stops
responding.
We can use the weblogic.ADMIN utilty to ping the server. In case of a hang situation we can
take multiple thread dumps and analyze the cause of hang.
2. What can be the various reasons for a server crash?
a) Native IO
b) SSL Native Libraries
c) JVM
d) Supported Configuration
e) JDBC Driver issue
3. How do you troubleshoot a crash?
JVM crash generates a hs_err_pid file. We need to look into the stack trace of the hs_err_pid file
.
If the thread is from a native io, we need to disable native io.
if the 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 optimzed code, we can turn of optimization.
If the stack is from native calls of application, its a bug with the application and it has to b
modified.
4. Ho do you troubleshoot Server Hang?
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 CTLR Break on Windows.
Analyze the thread dump to find the root cause.
5. What can be the reasons of Server hang?
Memory leak, databse query taking a long time to return, Deadlock.
6. What is memory leak?
Memory leak is when objects are not romved from the heap even when they are not required.
7. What are the various causes for OUT OF MEMORY?
a) Insufficient heap size, not able to match the extra load.
b) Objects licing too long, like HTTP Sessions.
c) Memory leak in application code.
d) Full GC not happening due to JVM Bug.
8. How to troubleshoot and 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.
9. When does High CPU Usage occur?
It occurs when one process or one thread utilizes unexpectedly high proportion of CPU.
10. How to troubleshoot it?
In Solaris environment, we need to take pstack and prstack and see what the threads are doing.
In Windows we need to use pslist and process explorer.
11. What is Clustering and what is achieved through it?
Clustering is the grouping together of servers for the purpose of high availability and scalability.
Load balancing and Failover is achieved.
12. How does Cluster Communication Happen?
Members of the Cluster communicate over the Cluster Multicast IP and Port by sending periodic
heart beat messages.
13. What is the difference between the Sun JVM and BEA JRockit JVM?
The most well know JVM is the implementation from Sun. The Sun JVM is called HotSpot. The
Sun JVM is shipped in the Java Developer’s Kit (JDK) and Java Runtime Environment (JRE)
from Sun.
The BEA JRockit JVM from BEA systems is optimized for reliability and performance for
server side applications. To achieve this, BEA JRockit JVM uses technologies such as code
generation, hot spot detection, code optimization, advanced garbage collection algorithms and
tight operating system integration.
14. TUning JVM Parameters.
If you have a single processor, single thread machine then you should use the serial collector
(default for some configurations, can be enabled explicitly for with -XX:+UseSerialGC). For
multiprocessor machines where your workload is basically CPU bound, use the parallel collector.
This is enabled by default if you use the -server flag, or you can enable it explicitly with -
XX:+UseParallelGC. If you’d rather keep the GC pauses shorter at the expense of using more
total CPU time for GC, and you have more than one CPU, you can use the concurrent collector (-
XX:+UseConcMarkSweepGC). Note that the concurrent collector tends to require more RAM
allocated to the JVM than the serial or parallel collectors for a given workload because some
memory fragmentation can occur.
15. How do you do performance tuning of WLS?
It can be categorized in 4 parts.
a. Application Tuning.
jsp precompilation, ejb pool size cache..
b. OS Tuning
Setting tcp ip parameter.
tcp_time_wait_interval
tcp_conn_req_max_q
c. Core Server Tuning.
tune workmanager, tune chuck size and chunck pool size, using performance packs, conenction
backlog buffering.
d. JVM Tuning
tuning gc strategy, monitoring garbage collection..
Weblogic Admin
Saturday, July 10, 2010
Weblogic Administrator Interview Questions
1)How do I provide user credentials for starting a server?
When you create a domain, the Configuration Wizard prompts you to provide the username and
password for an initial administrative user. If you create the domain in development mode, the
wizard saves the username and encrypted password in a boot identity file. A WebLogic Server
instance can refer to a boot identity file during its startup process. If a server instance does not
find such a file, it prompts you to enter credentials.
If you create a domain in production mode, or if you want to change user credentials in an
existing boot identity file, you can create a new boot identity file.
2)Can I start a Managed Server if the Administration Server is unavailable?
By default, if a Managed Server is unable to connect to the specified Administration Server
during startup, it can retrieve its configuration by reading a configuration file and other files
directly. You cannot change the server's configuration until the Administration Server is
available. A Managed Server that starts in this way is running in Managed Server Independence
mode.
3)What is the function of T3 in WebLogic Server?
T3 provides a framework for WebLogic Server messages that support for enhancements. These
enhancements include abbreviations and features, such as object replacement, that work in the
context of WebLogic Server clusters and HTTP and other product tunneling. T3 predates Java
Object Serialization and RMI, while closely tracking and leveraging these specifications. T3 is a
superset of Java Object. Serialization or RMI; anything you can do in Java Object Serialization
and RMI can be done over T3. T3 is mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional protocols that
can be used to communicate between other processes and WebLogic Server. It depends on what
you want to do. For example, when you want to communicate between a browser and WebLogic
Server-use HTTP, or an ORB and WebLogic Server-IIOP.
4)How do you set the classpath?
WebLogic Server installs the following script that you can use to set the classpath that a server
requires:
WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
WL_HOME/server/bin/setWLSEnv.sh (on UNIX)
5)How do stubs work in a WebLogic Server cluster?
Clients that connect to a WebLogic Server cluster and look up a clustered object obtain a replicaaware
stub for the object. This stub contains the list of available server instances that host
implementations of the object. The stub also contains the load balancing logic for distributing the
load among its host servers.
What happens when a failure occurs and the stub cannot connect to a WebLogic Server instance?
When the failure occurs, the stub removes the failed server instance from its list. If there are no
servers left in its list, the stubb uses DNS again to find a running server and obtain a current list
of running instances. Also, the stub periodically refreshes its list of available server instances in
the cluster; this allows the stub to take advantage of new servers as they are added to the cluster.
6)How does a server know when another server is unavailable?
WebLogic Server uses two mechanisms to determine if a given server instance is unavailable.
Each WebLogic Server instance in a cluster uses multicast to broadcast regular "heartbeat"
messages that advertise its availability. By monitoring heartbeat messages, server instances in a
cluster determine when a server instance has failed. The other server instances will drop a server
instance from the cluster, if they do not receive three consecutive heartbeats from that server
instance
WebLogic Server also monitors socket errors to determine the availability of a server instance.
For example, if server instance A has an open socket to server instance B, and the socket
unexpectedly closes, server A assumes that server B is offline.
7)How are notifications made when a server is added to a cluster?
The WebLogic Server cluster broadcasts the availability of a new server instance each time a
new instance joins the cluster. Cluster-aware stubs also periodically update their list of available
server instances.
8)How do clients handle DNS requests to failed servers?
If a server fails and DNS continues to send requests to the unavailable machine, this can waste
bandwidth. For a Java client application, this problem occurs only during startup. WebLogic
Server caches the DNS entries and removes the unavailable ones, to prevent the client from
accessing a failed server twice.
Failed servers can be more of a problem for browser-based clients, because they always use
DNS. To avoid unnecessary DNS requests with browser-based clients, use a third-party loadbalancer
such as Resonate, BigIP, Alteon, and LocalDirector. These products mask multiple
DNS addresses as a single address. They also provide more sophisticated load-balancing options
than round-robin, and they keep track of failed servers to avoid routing unnecessary requests.
9)How many WebLogic Servers can I have on a multi-cpu machine?
There are many possible configurations and each has its own advantages and disadvantages.
BEA WebLogic Server has no built-in limit for the number of server instances that can reside in
a cluster. Large, multi-processor servers such as Sun Microsystems, Inc. Sun Enterprise 10000,
therefore, can host very large clusters or multiple clusters.
In most cases, WebLogic Server clusters scale best when deployed with one WebLogic Server
instance for every two CPUs. However, as with all capacity planning, you should test the actual
deployment with your target web applications to determine the optimal number and distribution
of server instances.
10)How can I set deployment order for applications?
WebLogic Server allows you to select the load order for applications. WebLogic Server deploys
server-level resources (first JDBC and then JMS) before deploying applications. Applications are
deployed in this order: connectors, then EJBs, then Web Applications. If the application is an
EAR, the individual components are loaded in the order in which they are declared in the
application.xml deployment descriptor.
What is difference between welogic server and WebSphere?
WebLogic is one of the leading J2EE™ application servers in today’s marketplace. Monitoring
WebLogic for its performance and availability becomes inevitable. Applications Manager, a tool
for monitoring the performance and availability of applications and servers, helps in BEA
WebLogic Management. WebSphere is IBM's powerful J2EE application server that enables
businesses and organizations to build robust, Web-based applications. WebSphere, a transactionoriented
web server, allows you to develop, launch, and integrate powerful e-business
applications—customer management systems, transaction processing, infrastructure adjustment,
and many others. This high-performance server provides solutions for connecting people,
systems, and applications with your internal and external resources.
In cluster , the load balancing that simply redirect the client request to any available server
in weblogic server cluster. Suppose assume we have 4 managed servers and one admin
server. can we trace that request is going to which managed server in the cluster? is it
possible to tell that request is going to which ipaddr/managed server?
whenever the request gets routed from any Load balancer or Web-server to any application
server, the routed request contains a header part which includes information of the server like
Port, Listen address etc based on which it routes to its appropriate server hosting application.
And we can trace this information in web-server log file.
Diff b/w managed server and non managed server? can u briefly explain?
Managed servers are the servers which have one and only one separate Admin server.
Admin server manages all the configurations and resources
for managed servers. No managed server could only be Admin server.
what is digital certificate?
For the purposes of digital signing of documents, verification of digital signatures, and
handling digital certificates in the Java platform, the Java
Cryptography Architecture (JCA) is used. JCA is a specification that gives the
programmers a standard way to access cryptographic services, digital
signatures, and digital certificates.
The Most Important Classes in JCA
java.security.KeyStore
java.security.PublicKey
java.security.PrivateKey
java.security.Cert.Certificate
Digital certifiacte is an electronic document which uses a digital signature to bind together
a public key with an identity — information such as the
name of a person or an organization, their address, and so forth. The certificate can be
used to verify that a public key belongs to an individual.
what is core dump? diff b/w core dump and c dump?
Core dump consists of the recorded state of the working memory of a computer program at
a specific time, generally when the program has
terminated abnormally.A copy of the data stored in the core memory of a computer,
usually used for debugging purposes.
What is advantage if silent mode installation ?
for this sailent mode of installation you need to specify the log file and xml file. The
difference between command and sailent mode is command
-mode=console i.e here step by step are visible but in sailent mode every thing is
configured.
The biggest advantage of silent mode installation is that it is non-interactive and hence
your intervention is not required during installation.
All the parameters to be used during installation are defined in xml file (usually silent.xml)
eg:./filename.bin -mode=silent -silent_xml=silent.xml
What is Connection Pool ?
Answer 1
Pool: Maintain equal instance of objects is called Pool
Connection Pool : the connection objects maintain in the form pool is called connection
pool.
Advantages of Connection Pool: the Connection is very precies . application need
connections getting connections from db and close connection's
it's normal process. if we use connection pool no need hit every time db , get from server(in
con pool) , in the middle server will get the some amount
connections that give the connections . server will take physical connection to db , server
will give to logical connection to application if need more
connections server will increase connections are maintained que process.
Answer 2
Pool: Maintain equal instance of objects is called Pool
Connection Pool : the connection objects maintain in the form pool is called connection
pool.
Adv Con Pool: the Connection is very precies . application need connections getting
connections from db and close.
What is the difference between Connection Pool and data source?
The Connection pool means equals instance of connections and it refereed Data Source
object.
What does 'stub' mean in weblogic server?
clients that connect to a WLS instances and look like a single clustered object obtain a
replica-aware-stub of the object. The stub contains the list of
all the available server instancesof the object.It also has a load balancing logic to distribute
the load across the multiple hosts.
What is managed server ?
Any WebLogic Server instance apart from Administration Server is called as Managed
Servers. This is weblogic server where you deploy your
application (Though you can deploy your application in Administration server as well but
it is not recommended in production/UAT instance).
A weblogic server instance is called managed server.An administration have no of manager
servers.
How to find the heap memory of managedServer?
1. For weblogic 8 you can get the details from
/weblogic81/common/bin/startManagedWebLogic.sh Here there is a parameter set in the
script with
memory details.
2. you can varify it from out file of that server by searching Xms and Xms keyword. in ant
cersion of WLS.
3. use the below command .ps -auwwwx | grep .In the output you will find parameters Xms
and Xmx for heap size.
in which file/script we need to change the heap size?.What is the variable name to search to
change the heap size ?
In start up script,we can change ms and mx value.we can change the heap size in Javaw.exe
file, which is located in bin folder.
what is WLS T3 protocol?
Answer 1. Weblogic's implementationof the RMI specification uses a proprietary wireprotocol
known as T3. javasoft's reference implementation of
RMI uses a proprietary protocol called JRMP. weblogic developed T3 because they needed
a scalable,efficient protocol for building enterprise-class
destributed object systems with java.
Answer 2. T3 provides a framework for WebLogic Server messages that support for
enhancements. These enhancements include abbreviations and
features, such as object replacement, that work in the context of WebLogic Server clusters
and HTTP and other product tunneling. T3 predates Java
Object Serialization and RMI, while closely tracking and leveraging these specifications.
T3 is a superset of Java Object. Serialization or RMI;
anything you can do in Java Object Serialization and RMI can be done over T3. T3 is
mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional
protocols that can be used to communicate between other
processes and WebLogic Server. It depends on what you want to do. For example, when
you want to communicate between a browser and
WebLogic Server-use HTTP, or an ORB and WebLogic Server-IIOP.
Answer 3. T3 protocal is used to communicate betwen the EJB's in the wl serevr instances.
Answer 4. T3 is an optimized protocol used to transport data between WebLogic Server
and other Java programs,including clients and other
WebLogic Servers. WebLogic Server keeps track of every Java Virtual Machine (JVM)
with which it connects, and creates a single T3 connection to
carry all traffic for a JVM.For example, if a Java client accesses an enterprise bean and a
JDBC connection pool on WebLogic Server, a single
network connection is established between the WebLogic Server JVM and the client JVM.
The EJB and JDBC services can be written as if they had
sole use of a dedicated network connection because the T3 protocol invisibly multiplexes
packets on the single connection.
T3 is an efficient protocol for Java-to-Java applications because it avoids unnecessary
network connection events and uses fewer OS resources.
The protocol also has internal enhancements that minimize packet sizes
What happens when database down in weblogic ?
Answer 1 : Connection pool staus changes to suspended.it tries to poll the connection. It
depends on the configuration of connection pool .I will log
an error if
application tires to use the connection pool.
Answer 2 : using connection pool we can retrive the value in the database.
Answer # 3 : in app server u will diffine that connect to which data base according to that
connection will be establised and u can get data from data
base.if the data base is not working then u will get a error page(related to database).if u
want to give 100% availability for clint then u can use failover
concept and place the data in to different databases and give instructions for u r
application that if one data base is fail to serve the data after
partucular time the request will rediirect to another database where data is present.
Answer # 4 : in WLSS 9.2 When DB is down the connection pool/Data source will go to
SUSPENDED state waiting to re-establish the connection
with DB. when DB is up it will automaticaly re-connect with DB . but in the middle if you
re-cycle the server. the server will go to ADMIN mode.
Answer # 5 : Impact only particular application which is using failure database. Mean
while we need to untarget the failure database to aviod erros in
logs. Once DB back needs to target the same.
How to set Connection Pool size in Weblogic Server ?
we can set connection pool size in weblogic server through admin console.At first you have
to login to the adminserver and after putting username
and password you will see connectionpool within service configuration,then you have to go
through the connectionpool and there will be two tab one is
configuration and another will be monitoring.From monitoring tab you can view
maxcapasity and highconnection of connectionpool(jdbc).From that
you can customize the value .
What is multicast Address?
an address that can be used to send the messages to the same host addresses but in different
network addresses.that addresses can be referred
as multicast address.The multicast addresses are in the range 224.0.0.0 to 239.255.255.255.
how can we handle if server is hang? and how to handle out of memory in weblogic?
When a Server is hanging, we can ping the server using java weblogic.Admin
t3://server:port PING. If the server can respond to the ping, it may be
that the application is hanging and not the server itself.
We can use -verbose gc flag to check whether the server is doing the proper garbage
collection or not.
Also we can analyze the thread dumps to check out which thread are actually stucking.
where can we set classpath, which will reflect to whole domain ?
right click on my computer icon->advanced->environment
variables.here you will find to panels
1.path and
2.classpth.
1. go to path click on add
a)name: name of the path variable.
b)value: Absolute path of your bin folder or your application path.
what is the differencees between work manager and executequeue?
1.Unlike execute queues, all WorkManagers share a common thread pool and a prioritybased
queue.
2. The size of the thread pool is determined automatically by the kernel and resized as
needed.
3.WorkManagers become very lightweight, and customers can create WorkManagers
without worrying about the size of the
thread pool.
4.Thread dumps look much cleaner with fewer threads. In the new model, it is possible to
specify different service-level agreements (SLAs) such as
fair shares or response-time goals for the same servlet invocation depending on the user
associated with the invocation.
5.In earlier releases, each servlet or RMI request was associated with a dispatch policy that
mapped to an execute queue.Requests without an
explicit dispatch policy use the server-wide default execute queue. In WebLogic Server 9.0,
requests are still associated with a dispatch policy but
are mapped to a WorkManager instead of to an execute queue.
6.Execute queues are always global whereas WorkManagers are always application scoped.
Even WorkManagers defined globally in the console are
application scoped during runtime. This means that each application gets into own runtime
instance that is distinct from others, but all of them share
the same characteristics like fair-share goals.
7. Another advantage is Thread Count Self-tuning. One of the major differences between
execute queues and the new thread scheduling model is
that the thread count does not need to be set. In earlier releases, customers defined new
thread pools and configured their size to avoid deadlocks
and provide differentiated service. It is quite difficult to determine the exact number of
threads needed in production to achieve optimal throughput
and avoid deadlocks. WebLogic Server 9.0 is self-tuned, dynamically adjusting the number
of threads to avoid deadlocks and
achieve optimal throughput subject to concurrency constraints. It also meets objectives for
differentiated service. These objectives are stated as fair
shares and response-time goals as explained in the next section.
8. Execute Queue concepts used till 8.1+ weblogic releases. Work Manager came from
Weblogic 9+.
dIFFERNCE BETWEEN VERSIONS 8.X,9.X,10.X ?
There are various differences ranging from 8.X,9.X,10.X
1. Changes made in console UI.
2. The node Manager uses the port no 5555 in 8.x and in 10.x it uses 5556.
3. Every functionality should be done only after hitting LOCK AND EDIT option in the
version of 10x, Where as it is not needed in the version of 8.x.
4. There is no need of creating Connection pools in 10.x . Datasource itself directs requests
where as Connection pools should be created in the
version 8.x.
8.x-----------------------------------------9.x and 10.x
1)In 8 no loc& edit option--------1)In 9 lock & edit option
2)here Execute ques are there-----2)here work managers
3)here you can use in node manager portno:-5556--3)5557
What is config.xml.booted file ?
Config.xml.booted file is a replica of config.xml file. It is stored inside the root file of the
admin server.When your msi-config.xml is not running on
independent mode and your config.xml file is destroyed or currupted for any cause,then
you can start your managed server by taking the
configuration from this file.
What is config.xml?
it is heart of the weblogic server and its maintains the all the info about managed and
admin server details like Ipadd,portno...etc, and whenever you
update the admin console that info is updated in config.xml and while restart the
server,server will get details from config.xml only and using we can
deploy the application nothing but hard deployment.
What is DataSource ?how can its associated with connection pools ?
DataSoource is an Interface that is an alternative to Driver manager.It has methods :
getConnection()
getConnection(username,pwd)
...and many more..
Through JNDI it connects with database.Or It takes from Connection pool.
1. What is the difference between URL instance and URLConnection instance? - A URL instance
represents the location of a resource, and a URLConnection instance represents a link for accessing or
communicating with the resource at the location.
2. What are the two important TCP Socket classes? - Socket and ServerSocket. ServerSocket is used for
normal two-way socket communication. Socket class allows us to read and write through the sockets.
getInputStream() and getOutputStream() are the two methods available in Socket class.
3. What technologies are included in J2EE? - The primary technologies in J2EE are: Enterprise
JavaBeansTM (EJBsTM), JavaServer PagesTM (JSPsTM), Java Servlets, the Java Naming and Directory
InterfaceTM (JNDITM), the Java Transaction API (JTA), CORBA, and the JDBCTM data access API.
4. What is the Java Authentication and Authorization Service (JAAS) 1.0? - The Java Authentication
and Authorization Service (JAAS) provides a way for a J2EE application to authenticate and authorize a
specific user or group of users to run it. JAAS is a Java programing language version of the standard
Pluggable Authentication Module (PAM) framework that extends the Java 2 platform security architecture to
support user-based authorization.
5. What’s the difference between JNDI lookup(), list(), listBindings(), and search()? - lookup()
attempts to find the specified object in the given context. I.e., it looks for a single, specific object and either
finds it in the current context or it fails. list() attempts to return an enumeration of all of the
NameClassPair’s of all of the objects in the current context. I.e., it’s a listing of all of the objects in the
current context but only returns the object’s name and the name of the class to which the object belongs.
listBindings() attempts to return an enumeration of the Binding’s of all of the objects in the current context.
I.e., it’s a listing of all of the objects in the current context with the object’s name, its class name, and a
reference to the object itself. search() attempts to return an enumeration of all of the objects matching a
given set of search criteria. It can search across multiple contexts (or not). It can return whatever attributes
of the objects that you desire. It’s by far the most complex and powerful of these options but is also the most
expensive.
6. Components of JNDI - Naming Interface- The naming interface organizes information hierarchically and
maps human-friendly names to addresses or objects that are machine-friendly. It allows access to named
objects through multiple namespaces. Directory Interface - JNDI includes a directory service interface that
provides access to directory objects, which can contain attributes, thereby providing attribute-based
searching and schema support. Service Provider Interface - JNDI comes with the SPI, which supports the
protocols provided by third parties.
7. What is the Max amount of information that can be saved in a Session Object? - As such there is
no limit on the amount of information that can be saved in a Session Object. Only the RAM available on the
server machine is the limitation. The only limit is the Session ID length(Identifier), which should not exceed
more than 4K. If the data to be store is very huge, then it’s preferred to save it to a temporary file onto hard
disk, rather than saving it in session. Internally if the amount of data being saved in Session exceeds the
predefined limit, most of the servers write it to a temporary cache on Hard disk.
8. Must my bean-managed persistence mechanism use the WebLogic JTS driver? - BEA
recommend that you use the TxDataSource for bean-managed persistence.
9. Do EJBs have to be homogeneously deployed across a cluster? Why? - Yes. Beginning with
WebLogic Server version 6.0, EJBs must be homogeneously deployed across a cluster for the following
reasons:
To keep clustering EJBs simple
To avoid cross server calls which results in more efficiency. If EJBs are not deployed on all servers,
cross server calls are much more likely.
To ensure that every EJB is available locally
To ensure that all classes are loaded in an undeployable way
Every server must have access to each EJB’s classes so that it can be bound into the local JNDI tree.
If only a subset of the servers deploys the bean, the other servers will have to load the bean’s classes in
their respective system classpaths which makes it impossible to undeploy the beans.
10. Is an XSLT processor bundled in WebLogic Server? - Yes, an XSLT processor, based on Apache’s
Xalan 2.0.1 processor, in WebLogic Server 6.1.
11. I plugged in a version of Apache Xalan that I downloaded from the Apache Web site, and now
I get errors when I try to transform documents. What is the problem? - You must ensure that the
version of Apache Xalan you download from the Apache Web site is compatible with Apache Xerces version
1.3.1. Because you cannot plug in a different version of Apache Xerces , the only version of Apache Xerces
that is compatible with WebLogic Server 6.1 is 1.3.1. The built-in parser (based on version 1.3.1 of Apache
Xerces) and transformer (based on version 2.0.1 of Apache Xalan) have been modified by BEA to be
compatible with each other.
12. How do I increase WebLogic Server memory? - Increase the allocation of Java heap memory for
WebLogic Server. (Set the minimum and the maximum to the same size.) Start WebLogic Server with the -
ms32m option to increase the allocation, as in this example:
$ java ... -ms32m -mx32m ...
This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves performance and
allows WebLogic Server to handle more simultaneous connections. You can increase this value if necessary.
13. What causes Java.io exceptions in the log file of WebLogic Server? - You may see messages like
these in the log file:
(Windows NT) java.io.IOException Connection Reset by Peer java.io.EOFException
Connection Reset by Peer (Solaris) java.io.Exception: Broken pipe
These messages occur when you are using servlets. A client initiates an HTTP request, and then performs a
series of actions on the browser:
Click Stop or enter equivalent command or keystrokes
Click Refresh or enter equivalent command or keystrokes
Send a new HTTP request.
The messages indicate that WebLogic Server has detected and recovered from an interrupted HTTP request.
14. What is the function of T3 in WebLogic Server? - T3 provides a framework for WebLogic Server
messages that support for enhancements. These enhancements include abbreviations and features, such as
object replacement, that work in the context of WebLogic Server clusters and HTTP and other product
tunneling. T3 predates Java Object Serialization and RMI, while closely tracking and leveraging these
specifications. T3 is a superset of Java Object. Serialization or RMI; anything you can do in Java Object
Serialization and RMI can be done over T3. T3 is mandated between WebLogic Servers and between
programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional protocols that can be used
to communicate between other processes and WebLogic Server. It depends on what you want to do. For
example, when you want to communicate between a browser and WebLogic Server-use HTTP, or an ORB
and WebLogic Server-IIOP.
15. What are the enhancements in EJB 2.0 specification with respect to Asynchronous
communication? - EJB 2.0 mandates integration between JMS and EJB. We have specified the
integration of Enterprise JavaBeans with the Java Message Service, and have introduced message-driven
beans. A message-driven bean is a stateless component that is invoked by the container as a result of the
arrival of a JMS message. The goal of the message-driven bean model is to make developing an enterprise
bean that is asynchronously invoked to handle the processing of incoming JMS messages as simple as
developing the same functionality in any other JMS MessageListener.
16. What are the enhancements in EJB 2.0 with respect to CMP? - EJB 2.0 extends CMP to include far
more robust modeling capability, with support for declarative management of relationships between entity
EJBs. Developers no longer need to re-establish relationships between the various beans that make up their
application — the container will restore the connections automatically as beans are loaded, allowing bean
developers to navigate between beans much as they would between any standard Java objects.
EJB 2.0 also introduces for the first time a portable query language, based on the abstract schema, not on
the more complex database schema. This provides a database and vendor-independent way to find entity
beans at run time, based on a wide variety of search criteria.
17. Can you briefly describe local interfaces? - EJB was originally designed around remote invocation
using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard
CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing
applications without consideration for the deployment scenario, and was a strong feature in support of a goal
of component reuse in J2EE. Many developers are using EJBs locally - that is, some or all of their EJB calls
are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a
local interface mechanism. The local interface may be defined for a bean during development, to allow
streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved
with RMI like marshalling etc. This facility will thus improve the performance of applications in which colocation
is planned. Local interfaces also provide the foundation for container-managed relationships among
entity beans with container-managed persistence.
18. What are the special design care that must be taken when you work with local interfaces? - It
is important to understand that the calling semantics of local interfaces are different from those of remote
interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local
interfaces use call-by-reference. This means that in order to use local interfaces safely, application
developers need to carefully consider potential deployment scenarios up front, then decide which interfaces
can be local and which remote, and finally, develop the application code with these choices in mind. While
EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices,
especially when changing requirements and component reuse are taken into account, need to be factored
into the design decision.
19. What happens if remove( ) is never invoked on a session bean? - In case of a stateless session bean
it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed
by the container. In case of stateful session bean, the bean may be kept in cache till either the session times
out, in which case the bean is removed or when there is a requirement for memory in which case the data is
cached and the bean is sent to free pool.
20. What is the difference between creating a distributed application using RMI and using a EJB
architecture? - It is possible to create the same application using RMI and EJB. But in case of EJB the
container provides the requisite services to the component if we use the proper syntax. It thus helps in easier
development and lesser error and use of proven code and methodology. But the investment on application
server is mandatory in that case. But this investment is warranted because it results in less complex and
maintainable code to the client, which is what the end client wants. Almost all the leading application servers
provide load balancing and performance tuning techniques. In case of RMI we have to code the services and
include in the program the way to invoke these services.
21. Why would a client application use JTA transactions? - One possible example would be a scenario in
which a client needs to employ two (or more) session beans, where each session bean is deployed on a
different EJB server and each bean performs operations against external resources (for example, a database)
and/or is managing one or more entity beans. In this scenario, the client’s logic could required an all-ornothing
guarantee for the operations performed by the session beans; hence, the session bean usage could be
bundled together with a JTA UserTransaction object. In the previous scenario, however, the client
application developer should address the question of whether or not it would be better to encapsulate these
operations in yet another session bean, and allow the session bean to handle the transactions via the EJB
container. In general, lightweight clients are easier to maintain than heavyweight clients. Also, EJB
environments are ideally suited for transaction management.
Context c = new InitialContext(); UserTransaction ut = (UserTransaction)
c.lookup("java:comp/UserTransaction"); ut.begin(); // perform multiple
operations... ut.commit() ...
22. Can the bean class implement the EJBObject class directly? If not why? - It is better not to do it
will make the Bean class a remote object and its methods can be accessed without the containers? security,
and transaction implementations if our code by mistake passed it in one of its parameters. Its just a good
design practice.
23. What does isIdentical() method return in case of different type of beans? - Stateless - true
always. Stateful - depends whether the references point to the same session object. Entity - Depends whether
the primary key is the same and the home is same.
24. How should you type cast a remote object? Why? - A client program that is intended to be
interoperable with all compliant EJB Container implementations must use the
javax.rmi.PortableRemoteObject.narrow(…) method to perform type-narrowing of the client-side
representations of the remote home and remote interfaces. Programs using the cast operator for narrowing
the remote and remote home interfaces are likely to fail if the Container implementation uses RMI-IIOP as
the underlying communication transport.
25. What should you do in a passive method? - You try to make all nontransient variables, which are not
one of the following to null. For the given list the container takes care of serializing and restoring the object
when activated. Serializable objects, null, UserTransaction, SessionContext, JNDI contexts in the beans
context, reference to other beans, references to connection pools.
Things that must be handled explicitly are like a open database connection etc. These must be closed and set
to null and retrieved back in the activate method.
What is BEA Weblogic?
BEA WebLogic is a J2EE application server and also an HTTP web server by BEA Systems
of San Jose, California, for Unix, Linux, Microsoft Windows, and other platforms. WebLogic
supports Oracle, DB2, Microsoft SQL Server, and other JDBC-compliant databases.
WebLogic Server supports WS-Security and is compliant with J2EE 1.3.
BEA WebLogic Server is part of the BEA WebLogic Platform™. The other parts of
WebLogic Platform are:
* Portal, which includes Commerce Server and Personalization Server (which is built on a
BEA-produced Rete rules engine),
* WebLogic Integration,
* WebLogic Workshop, an IDE for Java, and
* JRockit, a JVM for Intel CPUs.
WebLogic Server includes .NET interoperability and supports the following native
integration capabilities:
* Native enterprise-grade JMS messaging
* J2EE Connector Architecture
* WebLogic/Tuxedo Connector
* COM+ Connectivity
* CORBA connectivity
* IBM WebSphere MQ connectivity
BEA WebLogic Server Process Edition also includes Business Process Management and
Data Mapping functionality.
WebLogic supports security policies managed by Security Administrators. The BEA
WebLogic Server Security Model includes:
* Separate application business logic from security code
* Complete scope of security coverage for all J2EE and non-J2EE components
Which of the following statements are true regarding MDBs (Message Driven
Beans) on version 6.0 of WebLogic App Server?
a. MDBs support concurrent processing for both Topics and Queues.
b. MDBs support concurrent processing for only Topics.
c. MDBs support concurrent processing for only Queues.
d. MDBs support concurrent processing neither Topics nor Queues.
Choice A is correct. MDBs support concurrent processing for both Topics and
Queues. Previously, only concurrent processing for Queues was supported. To ensure
concurrency, change the weblogic-ejb-jar.xml deployment descriptor max-beans-infree-
pool setting to >1. If this element is set to more than one, the container will
spawn as many threads as specified. WebLogic Server maintains a free pool of EJBs
for every stateless session bean and message driven bean class.
The max-beans-in-free-pool element defines the size of this pool. By default, maxbeans-
in-free-pool has no limit; the maximum number of beans in the free pool is
limited only by the available memory.
Can I use a "native" two-tier driver for a browser applet?
No. Within an unsigned applet, you cannot load native libraries over the wire, access
the local file system, or connect to any host except the host from which you loaded the
applet. The applet security manager enforces these restrictions on applets as protection
against applets being able to do unsavory things to unsuspecting users.
If you are trying to use jDriver for Oracle from an applet, then you are violating the
first restriction. Your applet will fail when it attempts to load the native (non-Java
layer) library that allows jDriver for Oracle to make calls into the non-Java Oracle
client libraries. If you look at the exception that is generated, you will see that your
applet fails in java.lang.System.loadLibrary, because the security manager determined
that you were attempting to load a local library and halted the applet.
You can, however, use the WebLogic JTS or Pool driver for JDBC connectivity in
applets. When you use one of these WebLogic multitier JDBC drivers, you need one
copy of WebLogic jDriver for Oracle (or any other two-tier JDBC driver) for the
connection between the WebLogic Server and the DBMS.
I'm using a WebLogic multitier driver in an applet as an interface to a DBMS. If I run
the class using the Sun Appletviewer on my local machine, I have no problems. But
when I try to run the applet in a Netscape browser, it will not connect.
If Appletviewer works and Netscape does not, it is an indication that you are violating
a Netscape security restriction. In this case, the violation is that an applet cannot open
a socket to a machine other than the one from which it loaded the applet. To solve this
problem, you will have to serve your applet code from the same machine that hosts
the DBMS.
In addition, the IP naming format you use in the applet CODEBASE and the
constructor for the T3Client must match. That is, you can't use dot-notation in one
place and a domain name in the other.
I tried to run two of the applets in the examples directory of the distribution. I installed the
WebLogic classes on my local machine (NT server) and on another machine (a Windows 95
client). I am not using any browsers, just trying to run the applets with Appletviewer. The applets
work fine when I run Appletviewer from the NT server, but do not work at all from the Windows 95
client.
There are two possible problems: Either the CODEBASE tag is not properly set in the
applet HTML file, or the class files are not properly loaded on the HTTP server.
The applet works on the NT server because you installed the WebLogic distribution on your
NT server. Even if the applet cannot successfully load the necessary classes from the
HTTP server, it does find them in your local CLASSPATH. But when you try to run it from
the Windows 95 client, the applet must load the classes over the wire from the HTTP
server, and if you haven't installed them correctly, it will fail.
The two primary cluster services provided by WebLogic Server are?
a. Http Session State Clustering
b. File Service Clustering
c. Time Service Clustering
d. Object Clustering
e. Event Clustering
Choices A and D are correct. A WebLogic Server cluster is a group of servers that
work together to provide a more scalable and reliable application platform than a
single server. A clustered service is an API or interface that is available on multiple
servers in the cluster. HTTP session state clustering and object clustering are the two
primary cluster services that WebLogic Server provides. WebLogic Server also
provides cluster support for JMS destinations and JDBC connections. WebLogic
Server provides clustering support for servlets and JSPs by replicating the HTTP
session state of clients that access clustered servlets and JSPs. To benefit from HTTP
session state clustering, you must ensure that the session state is persistent, either by
configure in-memory replication, file system persistence, or JDBC persistence. If an
object is clustered, instances of the object are deployed on all WebLogic Servers in
the cluster. The client has a choice about which instance of the object to call. This is
Object Clustering. The APIs and internal services that cannot be clustered in
WebLogic Server version6.0 are File services, Time services, WebLogic Events,
Workspaces and ZAC.
How do stubs work in a WebLogic Server cluster?
Clients that connect to a WebLogic Server cluster and look up a clustered object
obtain a replica-aware stub for the object. This stub contains the list of available
server instances that host implementations of the object. The stub also contains the
load balancing logic for distributing the load among its host servers.
What happens when a failure occurs and the stub cannot connect to a WebLogic Server instance?
When the failure occurs, the stub removes the failed server instance from its list. If
there are no servers left in its list, the stub uses DNS again to find a running server
and obtain a current list of running instances. Also, the stub periodically refreshes its
list of available server instances in the cluster; this allows the stub to take advantage
of new servers as they are added to the cluster.
Why did my JDBC code throw a rollback SQLException?
Your JDBC code may throw the following exception:
"The coordinator has rolled back the transaction.
No further JDBC access is allowed within this transaction."
The WebLogic JTS JDBC driver throws this exception when the current JDBC
connection transaction rolls back prior to or during the JDBC call. This exception
indicates that the transaction in which the JDBC connection was participating was
rolled back at some point prior to or during the JDBC call.
The rollback may have happened in an earlier EJB invoke that was part of the
transaction, or the rollback may have occurred because the transaction timed out. In
either case, the transaction will be rolled back, the connection returned to the pool and
the database resources released. In order to proceed, the JTS JDBC connection must
be closed and reopened in a new transaction.
Must my bean-managed persistence mechanism use the WebLogic JTS driver?
Use the TxDataSource for bean-managed persistence.
Why is there no polymorphic-type response from a create() or find() method?
The EJB Specification prohibits this behavior, and the weblogic.ejbc compiler checks
for this behavior and prohibits any polymorphic type of response from a create() or
find() method.
The reason the create() and find() methods are not polymorphic is similar to the
reason constructors are not polymorphic in Java. The derived classes generally do not
know or cannot initialize the base class properly.
Must EJBs be homogeneously deployed across a cluster? Why?
Yes. Beginning with WebLogic Server version 6.0, EJBs must be homogeneously
deployed across a cluster for the following reasons:
* To keep clustering EJBs simple
* To avoid cross server calls which results in more efficiency. If EJBs are not
deployed on all servers, cross server calls are much more likely.
* To ensure that every EJB is available locally
* To ensure that all classes are loaded in an undeployable way
* Every server must have access to each EJB's classes so that it can be bound into the
local JNDI tree. If only a subset of the servers deploys the bean, the other servers will
have to load the bean's classes in their respective system classpaths which makes it
impossible to undeploy the beans.
Which of the following are recommended practices to be performed in the
ejbPassivate() method of a stateful session bean?
a. Close any open resources, like database connections
b. All non-transient, non-serializable fields(except some special types) should be set
to null.
c. All transient fields should be set to null
d. Make all database connection reference fields transient
e. All primitive type fields should be set to null
Choices A, B and D are correct. When a bean is about to be passivated, its ejbPassivate()
method is invoked, alerting the bean instance that it is about to enter the Passivated state.
At this time, the bean instance should close any open resources and set all non transient,
non serializable fields to null. This will prevent problems from occurring when the bean is
serialized. Transient fields will simply be ignored.Serializable fields will be saved. Open
resources such as sockets or JDBC connections must be closed whenever the bean is
passivated. In stateful session beans, open resources will not be maintained for the life of
the bean instance. When a stateful session bean is passivated, any open resource can
cause problems with the activation mechanism.
A bean's conversational state may consist of only primitive values, objects that are
serializable, and the following special types-SessionContext, EJBhome, EJBObject,
UserTransaction and Context (only when it references the JNDI ENC) . The types in this list
(and their subtypes) are handled specially by the passivation mechanism. They don't need
to be serializable; they will be maintained through passivation and restored automatically to
the bean instance when it is activated
While packaging the Web Application DefaultWebApp for deployment into the
WebLogic server, the home and remote interfaces of the enterprise beans used by
the servlets should reside in which directory?
a. DefaultWebApp/META_INF/classes
b. DefaultWebApp/META_INF/lib
c. DefaultWebApp/WEB_INF/lib
d. DefaultWebApp/WEB_INF/classes
e. DefaultWebApp/classes
Choice D is correct. When packaging a web application create META-INF and WEB-INF subdirectories in
the application directory to hold deployment descriptors and compiled Java classes. All servlet classes
and helper classes should reside in the WEB-INF/classes subdirectory. The home and remote interface
classes for enterprise beans used by the servlets into the WEB-INF/classes subdirectory.
All the HTML files, JSP files, images, and any other files that these Web pages reference should exist in
the application directory, maintaining the directory structure for referenced files. The META_INF directory
contains the deployment descriptors for the enterprise beans, but not the classes.
How do I set up my CLASSPATH?
Setting up your CLASSPATH correctly depends on what you are trying to do. The most common tasks
are described below:
* Starting WebLogic Server. See Setting the Classpath Option in the Starting and Stopping WebLogic
Servers section of the Administration Guide. In addition, your WebLogic distribution includes shell scripts
that you can use to start the server. These scripts, which are located in the domain directories under the
config directory of your WebLogic Server distribution, automatically set up the CLASSPATH variable in
the shell before starting the server.
Why do I get the following exception when viewing the JNDI tree?
isSerializable(class.javax.naming.Binding)
java.io.NotSerializableException:
java.io.PrintWriter at
java.io.ObjectOutputStream.OutputObject
The Weblogic Server JNDI implementation requires objects to be serializable, not referencable. A
PrintWriter cannot be serialized and therefore should be declared transient.
When deploying a resource adapter (.rar) to WebLogic Server, are its classes placed
in the WebLogic classpath?
For instance, I am deploying an EJB and a resource adapter (.rar), the EJB has no
dependencies on the .rar because the EJB is writing to the common client interface
(CCI). The EJB client application has sends/marshals as parameter classes that are
defined in the .rar. For some reason the EJB's class loader hierarchy cannot find the
definition of this .rar-specific class, even though the .rar is deploying successfully. I
receive the following error on the EJB client:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception
is:
java.lang.ClassNotFoundException:
com.mycompany.InteractionSpecImpl
When you pass an instance of com.myclientcompany.server.eai.InteractionSpecImpl as an argument to
your EJB, the appServer needs to de-serialize (unmarshal) the object under the EJB context, and it needs
the required class for unmarshalling, inside the ejb-jar(raTester.jar). So if you include the
interactionspecimpl class in your ejb-jar file, then you do not need to include those classes in your
server's classpath.
How is security handled in the WebLogic J2EE Connector Architecture?
Due to the fact that the current configuration and packaging requirements for resource adapters in
WebLogic Server require the hand-editing of the weblogic-ra.xml file, any new passwords specified in the
security-principal-map entries are done in clear-text.
BEA understands the importance of protecting security passwords. Hence, we provide a Converter Tool
that allows for the encryption of all passwords present in the weblogic-ra.xml file. The Converter Tool is
shipped in the standard weblogic.jar file.
Can I enable requests to a JDBC connection pool for a database connection to wait
until a connection is available?
No, there's no way to allow a request to wait for a pool connection, and from the system point of view
there should not be. Each requests that waits for a connection ties up one of the fixed number of execute
threads in the server, which could otherwise be running another server task. Too many waiting requests
could tie up all of the execute threads and freeze the server.
How do I use multibyte character sets with WebLogic jDriver for Informix?
Currently, multibyte character sets are not supported for the WebLogic jDriver for Informix driver.
How do I connect to an SQL Server instance that is running on a machine with
multiple instances of SQL Server 2000?
Each instance of MS SQL Server must be listening on a different port. So, you can use the port number in
the properties that you pass to the getConnection() method or, in case of connection pools, you can
specify the port property in the following properties:
server=machineName
port=instancePort
To find the port number where each MS SQL Server instance is running, run the server network utility (in
the Microsoft SQL Server program group), select the server instance, select TCP/IP, and click the
properties button.
Why does FOR UPDATE in Oracle 8 cause an ORA-01002 error?
The Oracle 8 server generates an ORA-01002:fetch out of sequence error message when you use a FOR
UPDATE statement with AUTOCOMMIT turned on (which is the default state when using JDBC). This is
known to happen on Oracle 8.0 and 8.1 on Solaris and on Oracle 8.1 on Windows NT. If you turn
AUTOCOMMIT off, you will not receive this error. Because this problem is due to a change in the Oracle
8 server, you should contact Oracle support for more information.
What causes an OCIW32.dll error?
You may receive the following error message when using your JDBC driver for Oracle: "The ordinal 40
could not be loaded in the dynamic link library OCIW32.dll." This problem is caused by an out-of-date
version of OCIW32.DLL in your system directory. Some programs install this file in the system directory in
order to run. If you remove this file from the system directory you should no longer receive this error.
What transaction isolation levels does the WebLogic jDriver for Oracle support?
Your servlet application may use Oracle Thin Drivers to access a database that includes BLOB fields. If
you install and try to use WebLogic jDriver for Oracle and the same code fails and produces an exception
similar to the following:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
The Stack Trace:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
at
com.roguewave.jdbtools.v2_0.jdbc.JDBCServer.createConnection
(JDBCServer.java :46)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection_
(ConnectionPool.jav a:412)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection
(ConnectionPool.java :109)
Setting the Isolation_level to 1 in the code that calls the RogueWave JDBCServer class works with the
Oracle thin driver but fails with WebLogic jDriver for Oracle.
WebLogic jDriver for Oracle supports the following transaction isolation levels:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
According to the Oracle documentation, the Oracle DBMS only supports these two isolation levels. Unlike
other JDBC drivers, WebLogic's drivers throw an exception if you try to use an isolation level that is
unsupported. Some drivers silently ignore attempts to set an unsupported isolation level. WebLogic
suggests testing whether the Oracle thin driver is not just ignoring settings for unsupported isolation
events.
How do I use OS Authentication with WebLogic jDriver for Oracle and Connection
Pools?
Using OS authentication in connection pools essentially means that you are using the
UserId of the user who started WebLogic Server. OS authentication is available on NT and
UNIX, but not on Solaris. This means that database security will rely strictly on the
security of WebLogic; that is, if you are allowed to make a client connection to the
WebLogic Server and access the pool, then you can get to the database.
You can do this with WebLogic jDriver for Oracle because Oracle uses the process owner to
determine who is attempting the connection. In the case of WebLogic JDBC, this is always
the user that started the WebLogic Server.
To set up your Oracle instance to use this feature, your DBA needs to follow these basic
steps. The full procedure is described in more detail in your Oracle documentation.
1. Add the following line to the INIT[sid].ORA file:
OS_AUTHENT_PREFIX = OPS$
Note that the string "OPS$" is arbitrary and up to the DBA.
2. Log in to the Oracle server as SYSTEM.
3. Create a user named OPS$userid, where userid is some operating system login ID. This
user should be granted the standard privileges (for example, CONNECT and RESOURCE).
4. Once the userid is set up, you can connect with WebLogic jDriver for Oracle by
specifying "/" as the username property and "" as the password property. Here is an
example for testing this connection with the dbping utility:
$ java utils.dbping ORACLE "/" "" myserver
Here is a code example for WebLogic jDriver for Oracle:
Properties props = new Properties();
props.put("user", "/");
props.put("password", "");
props.put("server", "myserver");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:oracle",
props);
1. Use the Administration Console to set the attribute for your connection pool. The
following code is an example of a JDBC connection pool configuration using the WebLogic
jDriver for Oracle:
<JDBCConnectionPool
Name="myPool"
Targets="myserver,server1"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="1"
MaxCapacity="10"
CapacityIncrement="2"
Properties="databaseName=myOracleDB"
What type of object is returned by ResultSet.getObject()?
WebLogic jDriver for Oracle always returns a Java object that preserves the precision of
the data retrieved. WebLogic jDriver for Oracle returns the following from the getObject()
method:
* For columns of types NUMBER(n) and NUMBER(m,n): a Double is returned if the defined
precision of the column can be represented by a Double; otherwise BigDecimal is returned.
* For columns of type NUMBER: Because there is no explicit precision, the Java type to
return is determined based on the actual value in each row, and this may vary from row to
row. An Integer is returned if the value has a zero-valued fractional component and the
value can be represented by an integer.
For example, 1.0000 will be an integer. A long is returned for a value such as
123456789123.00000. If a value has a non-zero fractional component, a Double is
returned if the precision of the value can be represented by a Double; otherwise a
BigDecimal is returned.
How do I limit the number of Oracle database connections generated by WebLogic
Server?
You can use connection pools to limit the number of Oracle database connections
generated by WebLogic Server in response to client requests. Connection pools allow T3
applications to share a fixed number of database connections. For information on how to
set up connection pools,
How do I call Oracle stored procedures that take no parameters?
Here is what we use that works:
CallableStatement cstmt = conn.prepareCall("Begin procName;
END;");
cstmt.execute();
where procName is the name of an Oracle stored procedure. This is standard Oracle SQL
syntax that works with any Oracle DBMS. You might also use the following syntax:
CallableStatement cstmt = conn.prepareCall("{call procName};");
cstmt.execute();
This code, which conforms to the Java Extended SQL spec, will work with any DBMS, not
just Oracle.
Why do I get unexpected characters from 8-bit character sets in WebLogic jDriver
for Oracle?
If you are using an Oracle database with an 8-bit character set on Solaris, make sure you
set NLS_LANG to the proper value on the client. If NLS_LANG is unset, it defaults to a 7-
bit ASCII character set, and tries to map characters greater than ASCII 128 to a
reasonable approximation (for example, á, à, â would all map to a). Other characters are
mapped to a question mark (?).
How do I learn what codesets are available in Oracle?
To find out what codesets you currently have available in Oracle, execute the following
SQL query from SQLPlus at the command line:
SQL> SELECT value FROM v$nls_valid_values WHERE parameter='CHARACTERSET';
The response lists of all codesets currently installed on your system. This listing will look
something like the following shortened list:
VALUE
---------------
US7ASCII
WE8DEC
WE8HP
US8PC437
WE8EBCDIC37
WE8EBCDIC500
WE8EBCDIC285
...
If you want to constrain the value in the query to a specific codeset you are searching for,
you might use a SQL query like the following:
SQL> SELECT value FROM v$nls_valid_values
WHERE parameter='CHARACTERSET' and VALUE='AL24UTFFSS';
This would produce the following response if the codeset is installed:
VALUE
-------------------
AL24UTFFSS
You can use Oracle's installation tools to install additional codesets. Contact Oracle for
more information.
How many deployment descriptor files does a CMP entity bean deployed on the
WebLogic Server have?
a. One J2EE specific deployment descriptor and two WebLogic specific deployment
descriptors
b. One J2EE specific deployment descriptor and one WebLogic specific deployment
descriptors
c. One J2EE specific deployment descriptor only
d. One WebLogic specific deployment descriptor only
Choice A is correct. Deployment descriptors are text documents formatted with XML tags.
The J2EE specifications define standard, portable deployment descriptors for J2EE
components and applications. BEA defines additional WebLogic-specific deployment
descriptors required to deploy a component or application in the WebLogic Server
environment.
When packaging an enterprise bean, we need to create an ejb-jar.xml deployment
descriptor in the META-INF subdirectory and add entries for the bean. We also need to
create a weblogic-ejb-jar.xml deployment descriptor in the META-INF subdirectory and add
entries for the bean. If the bean is an entity bean with container-managed persistence,
first we create a weblogic-rdbms-cmp-jar-bean_name.xml deployment descriptor in the
META-INF directory with entries for the bean. Then we map the bean to this CMP
deployment descriptor with a attribute in the weblogic-ejb-jar.xml file.
Why do I get an error while trying to retrieve the text for ORA-12705?
This error occurs when you have not set the ORACLE_home environment variable properly
— a common mistake. In order to use WebLogic jDriver for Oracle, the Oracle client
software needs to be installed and ORACLE_home must be set.
You may also see this error message if you try to use WebLogic jDriver for Oracle's
internationalization capabilities with a language/codeset combination that is not installed
on your system. If you get the ORA-12705 error with the correct error text, then either you
have set NLS_LANG improperly, or you do not have the right codesets installed on your
system.
Why do I run out of resources during updates with Oracle's database link?
When you use Oracle's database link to update your database, you may get error
"maximum number of temporary table locks exceeded" even if you close your result sets
and statements when you finish.
The database link is an object in the local database that allows you to access tables, views,
and such in a remote database. The database link is controlled by the Oracle server, so the
driver has no control over its use of resources. The link appears to perform the commit
(since other processes could see the records that were being created), but it doesn't free
any resources until the connection is closed. The solution is to remove the database link
and use the JDBC driver to do your selects, inserts, and updates.
How do I prevent errors when running t3dbping?
When you are testing your Oracle database connections under UNIX, you can run
SQL*PLUS and can successfully ping the database using utils.dbping. However, when you
use the multitier utils.t3dbping utility, you receive an ORA-12154 error message.
First, make sure that your ORACLE_home environment variable is correctly set to point to
your Oracle installation. This variable must be set in the environment where the WebLogic
server is running.
In the C-shell issue the following command:
$ setenv ORACLE_home path
where path is the path to your Oracle installation.
In the Bourne shell, issue the following commands:
$ ORACLE_home=path
$ export ORACLE_home
Where path is the path to your Oracle installation. When you ping your database
using the two-tier utils.dbping utility, the JDBC driver loads the database client
library and establishes the connection to the database. When you use the multitier
utils.t3dbping utility, the WebLogic Server loads a two-tier driver and uses it to
establish a database connection. In both cases, the same method is used to
connect to the database. SQL*PLUS works because it doesn't require
ORACLE_home to find the client libraries.
If you are still experiencing problems, try this:
1. Open a command shell.
2. Run the two-tier version of utils.dbping in this shell.
3. Start WebLogic in this shell from the command line:
$ java -ms32m -mx32m weblogic.server
4. Open a second command shell.
5. Run the utils.t3dbping in the second shell against the server running in the first
command shell.
If this procedure doesn't work, please send the output from these commands to WebLogic
technical support.
Why does executing the PreparedStatement class cause a "TRUNC fails: ORA-00932:
inconsistent datatypes" error?
According to Oracle Metalink Bug Database Doc ID: 144784.1, in the absence of explicit
data typecasting, OCI assumes that a bind variable is a CHAR data type. If the SQL
statement intends to use the bind variable as a DATE data type, but OCI thought it was a
CHAR, the SQL parser will have a conflict in data types. The fix is to explicitly use data
conversion functions to convert the bind variables in the problem queries. For example, a
select string of
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(?)";
should be changed to:
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(TO_DATE(?))";
Why am I getting an "ORA-01000: maximum open cursors exceeded" error, even
though I closed all ResultSet, Statement, and Connection objects?
This is an Oracle issue. According to Oracle's documentation, dynamic cursors can remain
open from run to run in a session and are not closeable when a procedure closes. To work
around this issue, you can increase the number of open cursors allowed in the database
or you can reset the connection pool (close and reopen database connections in the
connection pool).
To reset the connection pool, you can untarget and retarget the connection pool using the
Administration Console. You can also use the reset() method through the JMX API or the
RESET_POOL command on the WebLogic Server command line interface.
An instance of stateful session EJB when accessed simultaneously from more than
one clients on same VM results in RemoteException or EJBException. In case the
client is a Servlet thread, which of the following techniques can be used to avoid
RemoteException/EJBException?
a. Not possible.
b. Store the reference to the EJB instance as an instance variable of Servlet class.
c. Store the reference to the EJB instance as a local variable of Servlet class.
d. Make the Servlet client to be remote instead of internal to WebLogic server.
Choice C is the correct choice. An instance of a stateful session EJB can be accessed from
only one client virtual machine at a time. Multiple client threads from the same virtual
machine can access the same instance of a stateful session EJB, but they must do so in a
serial fashion. If a client-invoked business method is in progress on an instance when
another client-invoked call, from the same or different client, arrives at the same instance
of a stateful session bean class, the container may throw the java.rmi.RemoteException to
the second client , if the client is a remote client, or the javax.ejb.EJBException, if the
client is a local client. Thus choice D is incorrect.
To avoid any exception, each Servlet should store a reference to a particular EJB instance
in a local variable of the Servlet's service() method. Please note that variables local to
methods like service(), doGet(), doPost() are not shared between different requests and are
automatically thread safe. Thus choice C is correct. An instance variable unlike local
variable is shared. Thus Choice B is incorrect.
An implication of this rule is that an application cannot make loop back calls to a session
bean instance.
This restriction does not apply to a stateless session bean because the container routes
each request to a different instance of the session bean class.
Are there C/C++ interfaces to WLS JMS?
No, this is not supported.
* Write your own interfaces using JNI.
* Setup a Servlet that your C/C++ client calls to generate a JMS message. You should
spawn multiple threads in C++ and use multiple posts to pass messages via http.
How do I start WLS and configure JMS?
On Windows, start WLS 6.X by selecting Start -< Programs -< BEA WebLogic E-Business
Platform -< WebLogic Server 6.X -< Start Default Server and enter the administrator
password.
On Windows, to configure JMS, start the console by selecting Start -< Programs -< BEA
WebLogic E-Business Platform -< WebLogic Server 6.X -< Start Default Console.
1. In the console tree view on the left, select JMS.
2. If you want persistent messages, first create a Store - Select Stores. In the window on
the right, Select Create a new JMSFile Store for a file store, give it a name, give it a
directory, select create. If you want a JDBCStore, you first need to create a JDBC
connection pool by selecting JDBC in the tree view, Connection Pools, create a new JDBC
Connection Pool. Select Targets, select a Target server, select the arrow that points to the
right and select Apply. Then go back to Stores, Create a new JMSJDBCStore.
3. If you want to use a template, first create a Template - Select Templates. You need a
template to create temporary queues. Select Create a new JMS Template, give it a name,
select create, then you can move to the Thresholds &Quotas tab or the Override tab. Select
Apply when done with your changes.
4. Select Servers. Select Create a new JMSServer, give it a name, select a Store if you
created one, select a template if you created one, Select Create. Now you can move to the
other tabs, make changes, select Apply. In particular, you must select Targets, select a
Target server, select the arrow that points to the right, and select Apply. This is the server
on which JMS will boot.
5. Create Destinations - from the tree view in the left panel, select the + in front of JMS,
select the + in front of Servers, select the + in front of your server, select Destinations,
Select Create a new JMSQueue or Create a new JMSTopic, fill in the first page and Select
Create, then you can select, fill in, and Apply other tabs.
6. Create Connection Factories - on left tree view, open JMS. Select Connection Factory.
Select Create a new JMS Connection Factory on the right panel. Type in the name and
JNDI name. Select Create (lower right hand corner). Select the Targets tab. Select the
name of the server on which you want to deploy the connection factory. Select the arrow
pointing to the right - the server moves to chosen. Then select Apply (lower right hand
corner).
How do I configure JMS security?
The correct way to set up security for JMS is to go to the console, select ACLs in the tree
view, then create some access control lists.
1. Set the ACL name which should be weblogic.jms.queue.QUEUENAME or
weblogic.jms.topic.TOPICNAME.
2. Select Create.
3. Enter the New Permission of send or receive.
4. Select Create.
5. Enter a comma separated list of users or groups.
6. Select Grant Permission.
7. Select "saved to the realm implementation" to save your changes.
8. Select Yes.
This will update the fileRealm.properties file with lines that look like the following:
acl.send.weblogic.jms.queue.TestQueue1=user1
acl.receive.weblogic.jms.queue.TestQueue1=user1
If you don't have an ACL for a queue or topic, security is wide open.
There are also ACL's for accessing the JNDI context; the JNDI context is a requirement for
initially accessing JMS. See the JNDI documentation.
Can I still use the default connection factories supported in WebLogic Release 5.1?
Yes. The following two names for the default connection factories have been deprecated:
javax.jms.QueueConnectionFactory
javax.jms.TopicConnectionFactory.
However, these connection factories are still defined and usable in this release for
backwards compatibility.
WebLogic JMS 6.1 defines one connection factory, by default:
weblogic.jms.ConnectionFactory
You have to Enable the JMS default connection factories. Go to the console->your server-
>tuning->click on the check box Enable Default JMS Connection Factories.
You can also specify user-defined connection factories using the Administration Console.
Why does JMSSession.createTopic or JMSSession.createQueue fail to create a
destination in WLS JMS 6.1 (it worked in 5.1)?
In WLS 5.1 createTopic() or createQueue() creates the destination permanently in the
database if it doesn't already exist, but does not modify the weblogic.properties file.
According to the JavaSoft JMS specification version 1.0.2 regarding createQueue() and
createTopic(), they are not for creating destinations dynamically. They are used to retrieve
the destination referenced by using a string name instead of using JNDI lookup. The
destination has to be in your config.xml file first. This change is documented in WLS 6.0
since it behaves differently than the previous release. You can use the WLS JMS helper
class (weblogic.jms.extensions.JMSHelper) or the console to create destinations at the run
time (note that there was a bug in 6.0 that caused a problem when the server restarted;
this is fixed in Service Pack 1). These mechanisms create the destination and also modify
the configuration file.
For more information on the JMSHelper classes, see the subsection called Creating
Destinations Dynamically in Programming WebLogic JMS.
The following program creates a Topic.
import java.io.*;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.*;
import weblogic.jms.extensions.JMSHelper;
class t {
public final static String
JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
public final static String JMS_SERVER_NAME="TestJMSServer";
public final static String DEST_JNDI_PREFIX="javax.destination.";
static public void main(String [] args) throws Exception {
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(env);
String topicName = "JMSHelperTestQueue01";
String topicJNDI = DEST_JNDI_PREFIX + topicName;
System.out.println("topic name=" + topicName + ", jndi=" +
topicJNDI);
JMSHelper.createPermanentTopicAsync(ctx, JMS_SERVER_NAME,
topicName,
topicJNDI);
} catch (JMSException e) {
e.printStackTrace();
}
}
}
How do I programmatically get a list of Queues or Topics?
The following program uses Mbeans:
import weblogic.management.*;
import weblogic.management.configuration.*;
InitialContext ic = new InitialContext();
MBeanhome home = (MBeanhome)ic.lookup(MBeanhome.ADMIN_JNDI_NAME);
for(Iterator i = o.getMBeansByType("JMSTopic").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("topic name found: " + wmb.getName());
}
for(Iterator i = o.getMBeansByType("JMSQueue").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("queue name found: " + wmb.getName());
}
How do I use a temporary destination?
You must create a template on every JMSServer where you want to be able to create
temporary destinations. You can specify multiple JMSServer entries to support
TemporaryTemplate and the system will load balance among those JMS servers to setup
the temporary destination. See How do I start WLS and configure JMS? for a description
about how to configure JMS. The resulting template definition looks something like the
following:
<JMSTemplate Name="MyTemplate"/>
The JMSServer is defined something like:
After the template name, you can set any queue/topic attribute you want in the template
(not including a JNDI name or topic multicast settings). The template is at the outer most
level; that is, it should not be nested in your .
Temporary destinations can only be consumed by the creating connection. Using topics,
you create your temporary topic and subscribe to that temporary topic. If you want
someone to publish to that temporary topic, you need to tell that someone what your topic
is. You can send them a message and include your temporary topic in the JMSReplyTo
field. The creator of the TemporaryTopic and the subscriber must be one in the same.
import javax.jms.TopicSession;
TemporaryTopic myTopic = mySession.createTemporaryTopic();
TopicSubscriber = mySession.createSubscriber(myTopic);
Temporary topics do not get names and cannot be subscribed to by other connections.
When you create a temporary topic, the JMS provider returns a javax.jms.Topic. You then
need to advertise that topic to other parties (those who want to publish to the topic),
putting it in your JMSReplyTo field so that they can respond. In general, no one else can
subscribe to the topic. You advertise the topic any way you want. Topics are serializable
(or, in our case, externalizable), which allows you to pass them around in RMI calls,
through a file, binding it to a name in JNDI, etc. In short, create the topic at the
subscriber side and advertise so that others can publish. You can get multiple subscribers
on the same connection and get concurrent processing using multiple sessions.
Can two JMS servers share the same persistent store?
No. Each JMS server must have its own unique persistent store. Two file-based JMS
persistent stores may share the same directory, but their messages will be stored in
different files. In this case, the filenames will contain different prefixes.
Two JDBC-based JMS persistent stores may share the same database, but they must be
configured to use a different Prefix Name which will be prepended to the database tables.
For more information on configuring the JDBC Prefix Name, see "JMS JDBC Stores" in the
Administration Console Online Help. If they are configured with the same Prefix Name,
persistent messages will be corrupted and/or lost.
Which types of JDBC databases does WebLogic JMS support?
The JMS database can be any database that is accessible through a JDBC driver.
WebLogic supports and provides JDBC drivers for the following databases:
* Cloudscape
* Informix
* Microsoft SQL (MSSQL) Server (Versions 6.5 and 7)
* Oracle (Version 8.1.6)
* Sybase (Version 12)
How do I use a third-party JDBC driver with JMS?
If your JDBC driver is not included in the list of drivers in the question about JDBC
databases supported by WebLogic JMS, then the tables required by JMS must be created
manually.
Note: WebLogic Server only guarantees support for the JDBC drivers included in the
previous list. Support for any other JDBC driver is not guaranteed.
The .ddl files located in the weblogic/jms/ddl directory of the weblogic.jar file may be used
as templates. Use the jar utility supplied with the JDK to extract them to the
weblogic/jms/ddl directory using the following command:
jar xf weblogic.jar weblogic/jms/ddl
Note: If you omit the second parameter (weblogic/jms/ddl), the entire jar file is extracted.
Follow the procedures in JDBC Database Utility in Programming WebLogic JMS to
manually create the database tables for the JDBC store.
Another option is to consider using a file store instead of a JDBC store. File stores are
easier to configure and may provide significantly better performance.
The Multicast TTL setting for a cluster in the WebLogic Admin console sets which
of the following values?
a. Maximum time taken for multicast messages to reach their final destination
b. The number of routers a multicast message can pass through before the packet
can be discarded
c. The multicast address to be used by the messages sent from the cluster
d. Minimum time taken for broadcasting a multicast message from the cluster
Choice B is correct. The Multicast TTL(TTL-Time to Live) setting specifies the number of
routers a multicast message can pass through before the packet can be discarded. To
configure the multicast TTL for a cluster, you should change the Multicast TTL value in
the WebLogic Server administration console. This sets the number of network hops a
multicast message makes before the packet can be discarded.
If you choose to distribute a cluster over a WAN (or across multiple subnets), you must
plan and configure your network topology to ensure that multicast messages are reliably
transmitted to all servers in the cluster. One of the requirements to be met by the network
is that the multicast Time To Live (TTL) value must be high enough to ensure that routers
do not discard multicast packets before they reach their final destination.
Which of the following algorithms is used by the WebLogic Server as the default
load balancing strategy for clustered object stubs when no algorithm is specified ?
a. Round-robin
b. Weight-based
c. Random
d. None of the above
8. Choice A is correct. The basic idea behind load balancing is that by distributing the load
proportionally among all the servers in the cluster, the servers can each run at full
capacity. WebLogic Server clusters support several algorithms for load balancing clustered
objects. The particular algorithm you choose is maintained within the replica-aware stub
obtained for the clustered object. Configurable algorithms for load balancing clustered
objects are: Round-robin, Weight-based and Random.
WebLogic Server uses the round-robin algorithm as the default load balancing strategy for
clustered object stubs when no algorithm is specified. Round-robin is the only load
balancing strategy used by WebLogic proxy plug-ins for HTTP session state clustering. The
round-robin algorithm cycles through a list of WebLogic Server instances in order. For
clustered objects, the server list consists of WebLogic Server instances that host the
clustered object. For proxy plug-ins, the list consists of all WebLogic Servers that host the
clustered servlet or JSP.
How do I use persistence?
Use the following guidelines:
1. Make sure the JMSServer you are using has a store configured. The JMSServer
configuration entry in the config.xml file should contain a line of the form
Store=""
Note that if JMS boots without a store configured, it is assumed the customer did not want
one, and persistent messages are silently downgraded to non-persistent (as specified for
JMS 1.0.2).
2. Make sure you are not using "Message.setJMSDeliveryMode". This is overwritten, as it is
a vendor-only method.
3. Make sure you are calling either:
QueueSender.send(msg, deliveryMode, ...)
-- or --
QueueSender.setDeliveryMode(deliveryMode)
-- or --
set the DefaultDeliveryMode mode on connection factory in the config.xml file to persistent
(the QueueSender.setDeliver/send overrides this value). Similarly, for topics, you would
set this via the TopicPublisher.
4. Make sure you don't have "DeliveryModeOverride" set to Non-Persistent on the
Destination in the config.xml file.
5. If you are using pub/sub, only durable subscriptions persist messages. Non-durable
subscriptions have no need to persist messages, as by definition they only exist for the life
of the server.
6. If you are using JDBC, the JDBC tables, JMSSTATE and JMSSTORE, are created
automatically when the JMS server boots. The DDL files used to create the tables are
stored in weblogic.jar in weblogic/jms/ddl. The example configuration below shows a
JDBC store for Oracle (client version 8.1.7 or later is needed to run with WLS 6.1 on JDK
1.3). To manually create the tables (also deleting any existing tables), run java
utils.Schema as described in the previous question.
See the question, "How do I start WLS and configure JMS?" for a description of how to
configure JMS.
Here is a sample config.xml file resulting from configuring JMS. It should look similar to
yours. If you want JMS to use a file store instead of a database, just change JDBCStore to
FileStore in the JMSServer section.
ListenPort="7001" DefaultProtocol="t3"
ThreadPoolSize="8" >
GuestDisabled="false" />
FileRealm="defaultFileRealm" />
<FileRealm Name="defaultFileRealm"
/>
TemporaryTemplate="TestTemplate1"
Targets="myserver" Store="JDBCStore">
JNDIName="jms.queue.TestQueue1"
Template="TestTemplate1"
/>
<JMSTemplate Name="TestTemplate1"
/>
<JMSFileStore Name="FileStore"
Directory="myfilestore"
JMSServer="TestJMSServer"
/>
ConnectionPool="testpool2"
JMSServer="TestJMSServer"
/>
<JDBCConnectionPool Name="testpool2"
Targets="myserver"
URL="jdbc:weblogic:oracle"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="0"
MaxCapacity="1"
CapacityIncrement="1"
Properties="user=SCOTT;password=tiger;server=bay816"
/>
The following is a sample class that sends
a Topic message on construction:
import javax.naming.*;
import javax.jms.*;
import java.util.Hashtable;
public class t
{
public final static String DESTINATION="jms.topic.TestTopic1";
private TopicConnectionFactory connectionFactory;
private TopicConnection connection;
private TopicSession session;
private TopicPublisher producer;
private TextMessage message;
private Topic destination;
public t()
{
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
InitialContext ctx = new InitialContext(env);
destination = (Topic) ctx.lookup(DESTINATION);
connectionFactory = (TopicConnectionFactory)
ctx.lookup("javax.jms.TopicConnectionFactory");
connection = (TopicConnection)
connectionFactory.createTopicConnection();
session = (TopicSession) connection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
producer = (TopicPublisher) session.createPublisher(destination);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
message = (TextMessage) session.createTextMessage();
message.setText("hello world");
producer.publish(message);
} catch (Exception e) {
}
}
}
How does a file store compare with a JDBC store?
The following are some similarities and differences between file stores and JDBC stores:
* Both have the same transaction semantics, including rolling back transactions (e.g.,
received messages are put back on the queue).
* Both have the same application interface (no difference in application code).
* The file store should be much faster.
* JDBC may make it easier to handle failure recovery since the JDBC interface can access
the database from any client machine; with the file store, the disk must be shared or
migrated.
* File store reliability is limited to reliability of disk and O/S; run it on Veritas or a RAID 5
system. Database reliability may be higher.
* File stores will require more memory, but perhaps not significantly more; it depends on
how fragmented the file store gets, if the application works roughly
* FIFO it shouldn't get very fragmented at all.
* File stores generate no additional network traffic, database stores do if the database
server is on a different JVM or machine.
How do the WLS JMS 6.1 server/destination message maximum and threshold
values work?
The byte and message maximum values are quotas - not flow control. Message quotas
prevent a WebLogic JMS server from filling up with messages and possibly running out of
memory, causing unexpected results. When you reach your quota, JMS prevents further
sends with a ResourceAllocationException (rather than blocking). You can set quotas on
individual destinations or on a server as a whole.
The thresholds are also not flow control - though they would be better suited to that
application than the quotas. The thresholds are simply settings that when exceeded cause
a message to be logged to the console to let you know that you are falling behind.
Note that the messages maximum setting on a connection factory is not a quota. This
specifies the maximum numbers of outstanding messages that can exist after they have
been pushed from the server but before an asynchronous consumer has seen them; it
defaults to a value of 10.
How do I configure JDBC so that the JMS JDBC Store recovers automatically?
Several customers have reported a problem where they are using a JDBC store, the DBMS
goes down and back up, but JMS can no longer use the store until WLS is shutdown and
restarted. You can get around this problem by configuring the following attributes on the
JDBC Connection Pool associated with the JMSJDBCStore:
TestConnectionsOnReserve="true"\
TestTableName="[[[catalog.]schema.]prefix]JMSState"
If they are not set, then if the JDBC resource goes down and comes back up, JMS cannot
re-use the connection pool until WLS is shutdown and restarted. This has been tested
against WLS 6.0 SP02 and WLS 6.1.
Does WebLogic JMS support clustering?
WebLogic JMS supports cluster-wide, transparent access to destinations from any server
in the cluster. A system administrator can establish cluster-wide, transparent access to
destinations from any server in the cluster by configuring multiple connection factories
and using targets to assign them to WebLogic Servers. Each connection factory can be
deployed on multiple WebLogic Servers.
The application uses the Java Naming and Directory Interface (JNDI) to look up a
connection factory and create a connection to establish communication with a JMS server.
Each JMS server handles requests for a set of destinations. Requests for destinations not
handled by a JMS server are forwarded to the appropriate server.
You can configure multiple JMS servers on the various nodes in the cluster as long as you
give them different names. You can assign destinations to the various JMS servers.
One problem to be aware of is the propagation delay in replicating entries in JNDI. If you
have an MDB deployed on one node but reference a destination on another node, the
deployment may fail with a javax.naming.NamingException exception. The problem occurs
because the server is not synced up to the JNDI from the remote server (JMS server) yet,
so the JNDI lookup of destination as part of MDB deployment will fail. One workaround is
for each MDB to reference a local destination. Another approach is deploy the MDBs after
the server boots (plus a delay for JNDI propagation). To get around losing messages before
the MDB is deployed, use durable subscribers. This problem is fixed for MDBs in WLS 6.1,
where the MDB will be deployed and reconnection will be retried until the destination is
available. Note that this is still a problem for EJBs in general that try to reference a nonlocal
JMS destination.
How do I do HTTP tunneling?
If you want to use HTTP tunneling (wrap every message in HTTP to get through a firewall),
you need to add TunnelingEnabled="true" into your &lr;ver> definition in the config.xml
file or check the appropriate box on the console. Then use a URL like
http://localhost:7001 instead of t3://localhost:7001 for Context.PROVIDER_URL when
getting your InitialContext. If you want HTTP tunneling with SSL, use
https://localhost:7002 (where https uses HTTP tunneling with SSL and 7002 is the secure
port that you configured). You will pay a performance penalty for doing this, so only use
tunneling it if you really need to (i.e., need to go through a firewall).
Which of the following statements are true regarding the identity of two EJBs?
a. Two stateful session beans are identical if their data attributes are identical.
b. Two stateful session beans are identical if their session contexts are equal.
c. Two stateless session beans are identical if they are of the same type.
d. Two stateless session beans are identical if their session contexts are equal.
e. Two entity beans are identical if they have same primary key but different home
interface.
f. Two entity beans are identical if they have different primary key but same home
interface.
B and C are correct. Since the stateful session beans maintain the conversational state of
the clients, they are identical when their session contexts are equal. Two stateful session
beans may have identical data attributes, but if the session contexts are different they are
not identical. Thus choice A is incorrect and B is correct. Since stateless beans do not
retain the conversational state, they are considered identical if they are of the same type.
Thus choice C is correct.
If two entity objects have the same home interface and primary key, they are considered
identical. The EJB specification does not mention object equality based on the = =
operator. Also, if you compare two object references using the Java API,
Object.equals(Object obj), the result is unspecified. The only way to compare object
equality is through the isIdentical (EJBObject) API. Thus choice E and F are incorrect.
Why is my JMS work not part of a user transaction (i.e., called within a transaction
but not rolled back appropriately)? How do I track down transaction problems?
Usually this problem is caused by explicitly using a transacted session which ignores the
external, global transaction by design (JMS spec requirement). A transacted JMS session
always has its own inner transaction. It is not affected by any transaction context that the
caller may have.
It may also be caused by using a connection factory that is configured with
"UserTransactionsEnabled" set to false.
1. You can check if the current thread is in a transaction by adding these two import lines:
import javax.transaction.*
import weblogic.transaction.*;
and adding the following lines (i.e., just after the begin and just before every operation).
Transaction tran = TxHelper.getTransaction();
System.out.println(tran);
System.out.println(TxHelper.status2String(tran.getStatus()));
This should give a clear idea of when new transactions are starting and when infection is
occurring.
2. Ensure that the thread sending the JMS message is infected with a transaction. Check
that the code is not using a transacted session by setting the first parameter of
createQueueSession or createTopicSession to false. Note that creating the connection
and/or session is orthogonal to the transaction. You can begin your transaction before or
after. You need only start the transaction before you send or receive messages.
3. Check that the UserTransactionsEnabled flag is explicitly set to true for the connection
factory in the config.xml file since the default for user-configured connection factories for
this value is false. If you are using one of the pre-configured connection factories they are
set as follows:
weblogic.jms.ConnectionFactory disables user transactions so
don't use this one for the case where user transactions are
desired;
javax.jms.QueueConnectionFactory and
javax.jms.TopicConnectionFactory enable user transactions.
4. You can trace JTA operations by starting the server with this additional property:
-Dweblogic.Debug.DebugJMSXA=true
You should see trace statements like these in the log:
XA ! XA(3163720,487900)
This can be used to ensure that JMS is infected with the transaction.
In the WebLogic server, if stateless session bean instances are getting frequently
created and removed, performance can improved by setting a high value for which of
the following?
a. max-beans-in-free-pool
b. max-beans-in-cache
c. max-beans-in-memory
d. max-stateless-beans-in-cache
Choice A is correct. WebLogic Server maintains a free pool of EJBs for every stateless
session bean class. The max-beans-in-free-pool element defines the size of this pool. By
default, max-beans-in-free-pool has no limit; the maximum number of beans in the free
pool is limited only by the available memory.
When EJBs are created, the session bean instance is created and given an identity. When
the client removes a bean, the bean instance is placed in the free pool. When you create a
subsequent bean, you can avoid object allocation by reusing the previous instance that is
in the free pool. So the max-beans-in-free-pool element can improve performance if EJBs
are frequently created and removed. Keeping this parameter too high uses extra memory
and keeping it too low causes unnecessary object creation.
WebLogic Server allows you to configure the number of active beans that are present in the
EJB cache (the in-memory space where beans exist). The max-beans-in-cache element
specifies the maximum number of objects of this class that are allowed in memory. When
max-bean-in-cache is reached, WebLogic Server passivates some EJBs that have not been
recently used by a client. Choices C and D are not valid properties.
How can an application do a JMS operation and have it succeed, independent of
the result of the transaction?
Basically, the JMS operation must be done using a transacted session or the transaction
must be suspended/disabled as follows (pick one or more of the following).
1. Suspend the current transaction prior to making the JMS call and resume it after
completing it. The code looks something like this:
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
TransactionManager tranManager=
TxHelper.getTransactionManager();
Transaction saveTx = null;
try {
saveTx = tranManager.suspend();
... do JMS work, it will not participate in transaction
} finally {
// must always resume suspended transactions!
if (saveTx != null) tranManager.resume(saveTx);
}
2. Use a transacted session by specifying true for the first parameter to
createQueueSession or createTopicSession.
3. Use a connection factory with user transactions disabled. That is, check that the
UserTransactionsEnabled flag is explicitly set to false for the connection factory in the
config.xml file or use the default for a user-configured connection factory for this value
which is false. The pre-configured connection factory weblogic.jms.ConnectionFactory
disables user transactions.
A transacted JMS session always has its own inner transaction. It is not affected by any
transaction context that the caller may have. A non-transacted JMS session is more
complicated. If you use the WLS 6.1 default factory weblogic.jms.ConnectionFactory, the
session does not participate in a user transaction because the UserTransactionsEnabled
flag is set to "False". If you use the deprecated default factory
javax.jms.QueueConnectionFactory or javax.jms.TopicConnectionFactory or you define
your own factory and set the UserTransactionsEnabled flag to "True", the JMS session
participates in the outer transaction, if one exists and the JMS session is not transacted.
What happens if acknowledge() is called within a transaction?
As per the JMS specification, when you are in a transaction, the acknowledgeMode is
ignored. If acknowledge() is called within a transaction, it is ignored.
Is it possible to set aside a message and acknowledge it later?
There are no special primitives for doing this. Here are two possible solutions.
One approach is to use multiple sessions as in the following:
while (true) {
Create a session, subscribe to one message on durable
subscription
Close session
Save session reference in memory
To acknowledge the message, find the session reference and call
acknowledge() on it.
}
Another solution is to use transactions and suspend the work as follows:
start transaction
while(true) {
message = receive();
if (message is one that I can handle)
process the message
commit
} else {
suspend transaction
put transaction aside with message
start transaction
}
}
To "acknowledge" the message:
resume user transaction
commit
To "recover" the message:
resume user transaction
rollback
Each time you suspend, you need to push the transaction onto a stack or list possibly
with the message so you can process it or roll it back later. This solution is high overhead
in that there can be a large build up of outstanding transactions. Note that transactions
have timeouts and it may rollback on its own, which means you can get the message again
(in a different transaction). Note also that there are some practical limits on the number of
transactions you should leave outstanding. The default limit is something like 10000.
Eventually you want to go back to your stack/list and commit/rollback the transactions.
Note that transaction references (javax.transaction.Transaction) are not Serializable.
How should I use sorted queues?
Destination keys are used to define the sort order for a specific destination. Destination
keys can be message header or property fields. For a list of valid message header and
property fields, refer to the Programming WebLogic JMS.
Queues can be sorted in ascending or descending order based on the destination key. A
destination is considered to be first-in-first-out if a destination key is defined as ascending
for the JMSMessageID message header field, and last-in-first-out if defined as descending.
The key defined for the JMSMessageID header field, if specified, must be the last key
defined in the list of keys.
You can define multiple destination keys to sort a destination.
Which of the following attributes in the Monitoring tab for a JDBC connection pool in
the Administrative console tell us how many clients are currently waiting for a
connection?
a. Waiters high
b. Waiters
c. Connections high
d. Clients
e. Wait seconds high
Choice B is correct. JDBC subsystem resources can also be monitored via the
Administration Console. The Monitoring tab for a JDBC connection pool allows you to
access a table listing statistics for the instances of that pool. These attributes provide
important information for managing client database access.
The Waiters High field indicates the highest number of clients waiting for a connection at
one time. The Waiters field tells you how many clients are currently waiting for a
connection. The Connections High field indicates the highest number of connections that
have occurred at one time. The Wait Seconds High field tells you the longest duration a
client has had to wait for a database connection. These attributes allow you to gauge the
effectiveness of the current configuration in responding to client requests.
The MaxPostTimeSecs attribute set in the Administration console under Servers or
virtual hosts section corresponds to which of the following?
a. The amount of time that WebLogic Server waits between receiving chunks of data
in an HTTP POST.
b. The total amount of time that WebLogic Server spends receiving HTTP POST data.
c. The time spent by WebLogic server to post data to other servers in the cluster.
d. The number of bytes of data received in a POST from a single request.
Choice B is correct. Web servers may face denial-of-service attacks, which is usually
carried out by sending huge amounts of data in an HTTP POST method. You can set three
attributes in WebLogic Server that help prevent this type of attack. These attributes are set
in the console, under Servers or virtual hosts. You can limit the amount of time that
WebLogic Server waits between receiving chunks of data in an HTTP POST by setting the
attribute PostTimeoutSecs.
The MaxPostTimeSecs attribute limits the total amount of time that WebLogic Server
spends receiving post data. If this limit is triggered, a PostTimeoutException is thrown and
a message is sent to the server log. MaxPostSize attribute limits the number of bytes of
data received in a POST from a single request. If this limit is triggered, a
MaxPostSizeExceeded exception is thrown and a message is sent to the server log.
How does sorting on message priority work?
First, you need to add a key to the destination (by default, they are not sorted), choosing
JMSPriority as the key. If you want 0 to be your highest priority, make the key ascending.
If you want 9 to be the highest priority, make the key descending.
Second, the priority must be set using either the producer or on the send, not the
message.
Third, the priority sorting only comes into play if there are multiple messages waiting on
the queue. If the receiver is always caught up with the sender, then the messages will be
processed in the order in which they come in.
How do I get a thread dump to help track down a problem?
Ways to get a thread dump:
* Try running this from the command line (after running the setEnv script in
/bea/wlserver6.1/config/mydomain/):
java weblogic.Admin -url t3://localhost:7001 THREAD_DUMP
* On Windows, from the console window, enter Ctrl+Break.
* On UNIX, signal the server using kill -3.
How do I manage a queue to view and delete specific messages?
Write a program that uses a QueueBrowser. Then delete specific messages by using a
selector with the message identifier as in the following example:
String selector = "JMSMessageID = '" + message.getMessageID() + "'";
Keep in mind that the queue browser is a not a "live" view of the queue. It is a snap-shot.
Why do I get an exception when trying to find a connection factory?
The exception is usually something like java.io.InvalidClassException or
java.lang.NoClassDefFoundError.
Make sure weblogic.jar is in the CLASSPATH of the client. Also make sure you have the
correct Java run-time jar files included (i.e., you might need rt.jar).
What precautions should I take when I use blocking receive() calls?
If your application design requires messages to be received synchronously, we recommend
using one of the following methods listed in order of preference:
* Pass a timeout value as an argument to the receive() method and set it to the minimum
value greater than zero, that is allowed by the application to avoid consuming threads that
are waiting for a response from the server.
* Use the receiveNoWait() method which returns the next message or a null value if no
message is currently available. In this case, the call does not block. The servlet should
provide a way to return to or reschedule the request, without calling wait().
Note: Use of this option should be minimized, as it may deadlock a busy server.
* Ensure that more threads are configured than the number of possible simultaneous
blocking receive() calls.
What is the NO_ACKNOWLEDGE acknowledge mode used for?
The NO_ACKNOWLEDGE acknowledge mode indicates that received messages do not need
to be specifically acknowledged which improves performance, but risks that messages are
lost. This mode is supported for applications that do not require the quality of service
provided by session acknowledge and that do not want to incur the associated overhead. v
Messages sent to a NO_ACKNOWLEDGE session are immediately deleted from the server.
Messages received in this mode are not recovered and, as a result, messages may be lost
and/or duplicate message may be delivered if an initial attempt to deliver a message fails.
Note: You should avoid using this mode if your application cannot handle lost or duplicate
messages. Duplicate messages may be sent if an initial attempt to deliver a message fails.
In addition, we do not recommend that this acknowledge mode be used with persistent
messaging, as it implies a quality of service that may be too low for persistent messaging
to be useful.
When should I use multicast subscribers?
Multicasting enables the delivery of messages to a select group of hosts that subsequently
forwards the messages to multicast subscribers. The benefits of multicasting include:
* Near real-time delivery of messages to host group.
* High scalability due to the reduction in the amount of resources required by the JMS
server to deliver messages to multicast subscribers.
Note: Multicasting is only supported for the Pub/sub messaging model.
For an example of when multicasting might be useful, consider a stock ticker. When
accessing stock quotes, timely delivery is more important than reliability. When accessing
the stock information in real-time, if all, or a portion, of the contents is not delivered, the
client can simply request the information be resent. Clients would not want to have the
information recovered in this case because by the time it is redelivered it would be out-ofdate.
Multicast messages are not guaranteed to be delivered to all members of the host group.
For messages requiring reliable delivery and recovery, you should not use multicasting.
When should I use server session pools and connection consumers?
WebLogic JMS implements an optional JMS facility for defining a server-managed pool of
server sessions. This facility enables an application to process messages concurrently. A
ConnectionConsumer object uses a server session to process received messages. If
message traffic is heavy, the connection consumer can load each server session with
multiple messages to minimize thread context switching. Multiple connection consumers
can share server sessions in a server session pool.
To learn how to use the connection consumers within an application, see the section
Processing Messages Concurrently in Programming WebLogic JMS, or the
javax.jms.ConnectionConsumer javadoc.
Note: Server session pools can also be implemented using Message Driven Beans. Using
MDBs is preferable to using server session pools - see the answer to the question, "How do
server session pools and Message Driven Beans compare?" For information on using
message driven beans to implement server session pools, see Programming WebLogic
Enterprise JavaBeans.
How do I issue the close() method within an onMessage() method call and what are
the semantics of the close() method?
If you wish to issue the close() method within an onMessage() method call, the system
administrator must select the Allow Close In OnMessage check box when configuring the
connection factory. For more information, see JMS Connection Factories in the
Administration Console Online Help. If this check box is not selected and you issue the
close() method within an onMessage() method call, the call will hang.
The close() method performs the following steps to execute an orderly shutdown:
* Terminates the receipt of all pending messages. Applications may return a message or
null if a message was not available at the time of the close.
* Waits until all message listeners that are currently processing messages have completed
(except for the message listener from which the close() method is being called).
* Rolls back in-process transactions on its transacted sessions (unless such transactions
are part of an external JTA user transaction).
* Does not force an acknowledge of client-acknowledged sessions. By not forcing an
acknowledge, no messages are lost for queues and durable subscriptions that require
reliable processing.
When you close a connection, all associated objects are also closed. You can continue to
use the message objects created or received via the connection, except the received
message's acknowledge() method. Closing a closed connection has no effect.
Note: Attempting to acknowledge a received message from a closed connection's session
throws an IllegalStateException.
When you close a session, all associated producers and consumers are also closed.
For more information about the impact of the close() method for each object, see the
appropriate javax.jms javadoc.
How do I publish an XML message?
Follow these steps:
1. Generate XML from the DOM document tree.
2. Serialize the generated DOM document to a StringWriter.
3. Call toString on the StringWriter and pass it into message.setText.
4. Publish the message.
A client wants to preserve the reference to the EJBhome object of an enterprise
bean instance and use it later. Which of the following can be serialized for this
purpose ?
a. home
b. Handle
c. homeHandle
d. EJBhomeHandle
e. homeObject
Choice C is correct. Once a client has obtained the EJBhome object for an EJB instance, it
can create a reference to the home object by calling gethomeHandle(). gethomeHandle()
returns a homeHandle object, which can be used to obtain the home interface to the same
EJB instance at a later time.
A client can pass the homeHandle object as arguments to another client, and the receiving
client can use the handle to obtain a reference to the same EJBhome object. Clients can
also serialize the homeHandle and store it in a file for later use. The homeHandle interface
has only one method getEJBhome(), which returns the EJBhome reference.
Is it possible to send or receive a message from within a message listener?
Yes. You can send to or receive from any queue or topic from within in a message listener.
If it's not an MDB, you can use the same Connection or Session that the onMessage() is
part of to do this. When you create your message listener, you pass in a session in your
constructor. Then you have access to the session in your onMessage method and you
would be able to make synchronous, not asynchronous, calls from within the onMessage
method. Do not use another Session that is servicing another onMessage() because that
would multi-thread that Session and Sessions don't support multi-threading.
When things are done non-transactionally, there can be duplicates or lost messages
(assuming your onMessage() code is attempting to forward messages):
1. If you call acknowledge after the publish() and the acknowledge fails for whatever reason
(network/server failure), then you will see the message again and will end up publishing
twice (possible duplicate semantics). You can try to keep track of sequence numbers to
detect duplicates but this is not easy.
2. If you call acknowledge before the publish(), you get at-most-once semantics. If the
publish() fails, you don't know if the failure occurred before or after the message reached
the server.
If you want exactly once, transactional semantics using onMessage, you must use
transactional MDBs. The onMessage() for a transactional MDB starts the transaction,
includes the WebLogic Server JMS message received within that transaction and the
publish() would also be in the same transaction. The following code sends a response to
each message that it receives. It creates the connection, etc. in the ejbCreate method so
that it doesn't need to create it every time onMessage is called. The QueueSender is
anonymous (null Queue) since we don't know to whom we will have to reply. The
ejbRemove method cleans up by closing the connection. This same approach can be used
to create a receiver, subscriber or publisher.
import javax.ejb.CreateException;
import javax.ejb.EJBContext;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.*;
public class MDB
implements MessageDrivenBean, MessageListener {
public static final String WLSqcf =
"javax.jms.QueueConnectionFactory";
public static final String WLSqname =
"jms.queue.TestQueue1";
public static final String WLSurl =
"t3://localhost:7001";
public static final String WLSJNDIfactory =
"weblogic.jndi.WLInitialContextFactory";
private MessageDrivenContext context;
private QueueSession session;
private QueueConnection connection = null;
private QueueConnectionFactory factory;
private InitialContext ctx;
private QueueSender QueueSender;
// Required - public constructor with no argument
public MDB() {}
// Required - ejbActivate
public void ejbActivate() {}
// Required - ejbRemove
public void ejbRemove() {
context = null;
if (connection != null) {
try {
connection.close();
} catch(Exception e) {}
connection = null;
}
}
// Required - ejbPassivate
public void ejbPassivate() {}
public void setMessageDrivenContext(
MessageDrivenContext mycontext) {
context = mycontext;
}
// Required - ejbCreate() with no arguments
public void ejbCreate () throws CreateException {
try {
// Get the initial context
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, WLSJNDIfactory);
env.put(Context.PROVIDER_URL, WLSurl);
env.put(Context.REFERRAL, "throw");
ctx = new InitialContext(env);
factory = (QueueConnectionFactory)ctx.lookup(WLSqcf);
// Create a QueueConnection, QueueSession, QueueSender
connection = factory.createQueueConnection();
session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
queueSender = session.createSender(null);
connection.start();
} catch (Exception e) {
throw(new CreateException(e.toString()));
}
}
// Implementation of MessageListener
// Throws no exceptions
public void onMessage(Message msg) {
try {
System.out.println("MDB: " +
((TextMessage)msg).getText());
msg.clearBody();
((TextMessage)msg).setText("reply message");
queueSender.send((Queue)msg.getJMSReplyTo(), msg);
}
catch(Exception e) { // Catch any exception
e.printStackTrace();
}
}
}
This approach creates a connection per EJB/MDB instance, so you might want to create a
producer pool that is shared by the EJB instances. This is done by writing a class that
populates a static pool with producers (see the next question for a sample producer pool).
The onMessage call grabs a producer when needed. Since Sessions must be single
threaded, make sure there is only one producer per session within the producer pool.
How do I create a producer pool?
The following is some pseudo-code
for a producer class.
class ProducerPool {
static Hashmap pSets = new Hashtable();
static Hashmap inUse = new Hashtable();
QueueSender get(String contextURL,
String connectionFactoryName,
String destinationName) {
String lookup = contextURL+";
"+connectionFactName+";"+destName;
synchronized(pSets) {
producer set = pSets.get(lookup);
if (set != null && set not empty)
qs = set.removeFirst();
}
if (producer == null) {
create ctx
get connect factory
create connection
create session
look up destination
qs = create queue sender
}
synchronized(inUse) {
inUse.put(qs, lookup);
}
return qs;
}
void put(QueueSender qs) {
String lookup;
synchronized(inUse) {
lookup = inUse.remove(p);
}
synchronzied(pSets) {
producer set = pSets.get(lookup);
if (set == null) {
producer set = new producer set
pSets.put(lookup, producer set);
}
producer set.add(qs);
}
}
}
Note: Static classes may be garbage collected if there are no references to them, so make
sure the application server has a permanent pointer to them in some manner. One way is
to reference it permanently from within a servlet or EJB when they are initialized at
startup.
Here is an example of using the producer pool within the onMessage method.
onMessage() {
QueueSender qs = ProducerPool.get(...);
qs.send(...);
ProducerPool.put(qs);
}
You can pre-populate this pool by calling it from
a startup class or a load-on-start servlet class.
What are pending messages in the console?
Pending means the message could have been:
* sent in a transaction but not committed.
* received and not acknowledged.
* received and not committed.
* subject to a redelivery delay (as of WebLogic Server 6.1).
* subject to a delivery time (as of WebLogic Server 6.1).
A rolled back message remains pending until the transaction actually rolls back. Rolling it
back multiple times does not cause double counting, nor does an exception that set a
transaction as rollbackOnly followed by an actual rollback.
Current implies messages that are not pending.
Total implies total since server last started. The byte counts only consider the payload of
messages which includes the properties and the body but not the header.
How do I use a less than or greater than on a message selector in ejb-jar.xml?
Enclose the selector in a CDATA section. That will prevent the XML parser from thinking
that less than or greater than is a tag.
<jms-message-selector>
'user' ]]>
Is it better to have more or fewer sessions for a given number of subscribers?
Using N sessions for N subscribers gives you concurrency up to N simultaneous threads of
execution provided you have as many threads to work with. Each Session gets its own
thread as long as there are enough threads available. Otherwise, the sessions serially
reuse the available threads.
One session for N subscribers serializes all subscribers through that one session. If the
load is heavy they may not be able to keep up without the extra threads.
If you are using CLIENT_ACKNOWLEDGE, N sessions gives you N separate message
streams that can be individually recovered. Having one session crosses the streams giving
you less control.
Match the EJB functions given below with the functionality equivalent in SQL
A.) ejbStore() 1.) INSERT
B.) ejbLoad() 2.) UPDATE
C.) ejbCreate() 3.) SELECT
a. A->1, B->2, C->3
b. A->2, B->1, C->3
c. A->3, B->2, C->1
d. A->1, B->3, C->2
e. A->2, B->3, C->1
f. A->3, B->1, C->2
Choice E is correct. When the create() method on a home interface is invoked, the
container delegates the create() method call to the bean instance's matching ejbCreate()
method. The ejbCreate() methods are used to initialize the instance state before record is
inserted into the database. The ejbCreate() method is analogous to INSERT. The ejbStore()
method is invoked just before the container the container is about to write the bean
container-managed fields to the database. It is analogous to the UPDATE . The ejbLoad() is
invoked just after the container has refreshed the bean container-managed files with its
state from the database. It is analogous to the SELECT. Thus choice E is correct and
others are not.
A client invokes a method on a stateful session bean instance deployed in the
WebLogic Server. While the method execution is in progress another method call
arrives on the server. What will be the result?
a. RemoteException is thrown if the value of concurrency-strategy property is false
b. EJBException is thrown if the value of concurrency-strategy property is false
c. The EJB container blocks the concurrent method call and allows it to proceed
when the previous call has completed if the value of allow-concurrent-calls is true
d. In all cases, RemoteException is thrown
Choice C is correct. By default, simultaneous access to a stateful session EJB results in a
RemoteException. However, you can set the allow-concurrent-calls option in the WebLogic
EJB deployment descriptor to specify that a stateful session bean instance will allow
concurrent method calls. This access restriction on stateful session EJBs applies whether
the EJB client is remote or internal to WebLogic Server. By default, allows-concurrentcalls
is false. However, when this value is set to true, the EJB container blocks the
concurrent method call and allows it to proceed when the previous call has completed.
The concurrency-strategy element determines ejbLoad() and ejbStore() behavior for entity
EJB instances.
Posted by vijay balan at 7:21 AM
Email ThisBlogThis!Share to TwitterShare to Facebook
No comments:
Post a Comment
Newer Post Home
Subscribe to: Post Comments (Atom)
Followers
Blog Archive
▼ 2010 (2)
o ▼ July (2)
weblogic WIKI
Weblogic Administrator Interview Questions
About Me
vijay balan
View my complete profile
Picture Window template. Powered by Blogger.
1. How to know the Managed Servers status, when admin console is not available?
2. What is the performance issue in weblogic and how can you resolve, explain in brief?
3. What is the Digital Certificate? How do we generate a Digital Certificate?
4. What is Thread Dump? What is the UNIX command to take Thread Dumps?
5. What is a cluster? What is High Availability and Fail over?
6. How to handle out of memory in weblogic and if server is getting more requests then what we
have to do in production environment?
7. What is clustering? How do weblogic instances communicate in a clustered environment? In a
cluster, if one of the servers has an issue and it is not accessible, will the other servers know
about it and how?
8. What are the roles you have played and what are the day today activities?
9. WHAT IS TROUBLE SHOOTING IN WEBLOGIC?
10. How to integrate apache webserver with weblogic server? What is the purpose of integrating
both?
11. Define the different groups of Users?
12. What are the different thread queues?
13. How will you analyze if a page responds slowly?
14. What is Work manager? Explain briefly?
15. What are the different types of drivers?
16. What are the various types of log files?
17. What are you commonly used fine tuning commands?
18. What is Session replication? What are the different types of Session Replications?
19. What happens if we change config.xml while server is running?
20. What is HTTP tunneling?
21. What is asynchronous communication? Is there any synchronous communication in JMS?
22. How to find Weblogic Version?
23. What is the use of log4j?
24. What is Work manager?
25. What is virtual host?
26. What is eden size and perm size?
27. What is Weblogic shrink?
28. What is diff b/w JNDI and JDBC?
29. What are the different types of drivers?
30. What driver you are using?
31. What is diff b/w unicast and multicast?
32. When core dump will not be created even if the server crashed?
33. Can we change the heart beat interval?
34. What are the various types of log files?
35. What is WorkManager?
36. What is Multicast IP Address? What are the things done by it? How to
test multicast IP?
37. How to check whether the cluster multicast adress is available or not?
What is the command to check in UNIX environment?
38. What is Virtual Host in Weblogic, how to create it & what is the
advantage ?
39. How can you find the jdbc version on server side?
40. What you do to close the connections automatically in JDBC?
41. What are the things that we take care under Database fine tuning apart
from increasing or decreasing connections?
42. What is MBean, how many types are there?
43. How to restart proxy?
44. Reasons for server crash?
45. Reasons for servers hang?
46. What is the thread hogging?
47. Various garbage collection algorithms?
48. How to find whether the PORT No is free or not?
49. What is the command to find CPU utilization?
50. What is the command to find version of Unix?
51. How to find CPU utilization? What if top command doesn’t work?
52. What are you commonly used fine tuning commands?
53. What is the difference between webservers and Proxy server?
54. How to sort the files?
55. What is Session replication? What are the different types of Session Replications?
56. Which IP segment will you use for Multicasting?
57. Is it possible to manage multiple domains through a single weblogic
admin console?
58. What happens if we change config.xml while server is running?
1. What is domain in WLS ? how to create a domain in WLS ?
2. What is CONFIG.XML ?
3. What is cluster and how to create a cluster in WLS ? how to configure cluster in webserver /
PROXY ? tell complete configuration ?
4. What kind of PROXY u are using in your project ?
5. What is SSL and how to provide security ? what is certificate ?
6. What is one way SSL and two way ssl ?
7. How to generate certificates ? where you can store certificates ?
8. What is THREAD DUMP , why thread dump is necessary in which scenario we will be taking
thread dump ?
9. How do u take thread dump ?
10. What is performance tuning ? how do u tune the performance step by step procedure ? ANS
: tell from OS Lever to Our Application Level
11. What is HEAP and how to increase it ?
12. What is OOM problem / memory leak , how to overcome this problem ?
13. Complete trouble shooting steps ?
14. How to provide the security in proxy ?
15. Can you create Admin Server and managed servers in a single machine ?
16. Project architecture ? which architecture you are using ? (DMZ)
17. Which JVM you used ?
18. What is HS_ERR_PID<>.log
19. What is server log ?
20. How to provide JDBC log ?
21. How view log files in linux ?
22. Recovering admin password ?
23. How to open a file in UNIX ?
24. What certificate chaining ?
25. Session stickness ?
26. What is the use of multi cast ID ?
27. What will be there in Access Log ?
28. What is the use of boot.properties file ?
29. JMS ?
30. Connection pooling and how to create connection pool ?
31. Which performance tool you are using for monitoring the performance WLS ?
32. How to verify the network performance in any OS ?
33. Application is working but the DB is not supporting what kind of exception u will get ?
34. How to deploy an application through command line ?
35. How to check CPU utilization in UNIX ?(top)
36. How to check the disk space in UNIX ? (df –k)
37. What is node manager and what is use of it ?
38. What is garbage collection ?
39. What are the variables of the HEAP SIZE ?
40. What is head and tail command ?
41. What is Certificate Signature Request ?
42. What is the default port of the node manager ?
43. How do u find the port number is used by some the other server ?
44. What are the deployment stages ?
45. tesstart command ?
46. what is the role of JNDI ?
47. what is difference static and dynamic deployment ?
48. how do u know which thread is executing and how much time it will take ?
49. How do u give the prevalization to users and groups in UNIX?
50. Url Rewriting in weblogic?
51. What is VMSTAT command in sun Solaris?
52. How do you find port numbers in Linux?
53. What is the use of netstat command?
54. Daily activities?
55. How do u monitoring the CPU Utilization?(top or sar)
Ans: # sar -u 12 5 ` Where,-u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 time
57. How the sar command shows the out put?
58. Questions on SSL(Complete)?
59. Did u attend any calls with u r clients?
60. What are Handling Disaster Recovery and Failover activities?
61. What are the things you did if the database server fails?
62. From where you are getting the trail certificates?
63. How much size you for the key generation?
64. HOW we configure SSL in proxy?
65. How we view the log files?
66. Which tool you are using for building an application?
67. What is your admin level? (L2)
68. Can we create two admin servers in a single domain?
69. What are the disadvantages of connection pooling?
70. Could you explain folder structure in bea?
71. How can we verify file size in Linux?(du –sh)
72. Why connection pooling?
73. What are the difference between authentication and authorization?
74. What are the role, user and principle?
75. Why clustering in weblogic?
76. Did you prepare any documentation as solved the any problem?
77. If you don’t have any work what can you do at that time?
78. How many machines are using in your project?
79. Can you explain your project flow? How it takes requests and give response to the clients?
80. How to generate jdbc log files?
81. If config.xml file is lost at runtime what is the solution to run the application successfully?
82. Explain different deployment stages in weblogic?
When conducting interviews I prefer to avoid difficult questions, and instead ask fairly simple
questions and look at how well the candidate answers. I would prefer to hire someone who can
clearly and concisely explain how to do a simple task than someone who knows every single
thing about a particular technology.
I explain at the beginning of the interview, it's acceptable if they are not able to answer every
question; I use their answers to help decide if they will be a good fit for the team and the role.
Here are some of the questions I like to ask after I've given them a description of the role on
offer.
Non-Technical Questions
Which of your previous roles do you think have give you experience that could be
important for this role?
Tell me what is involved in a typical day in this role?
Describe the kind of infrastructure you worked with in this role?
On a scale of 1 to 10, with 1 being "no knowledge" and 10 being "know everything", how
would you rate your own skills? (I don't look for people who think they "know
everything").
What are some of the things you need to learn more about?
Technical Questions
If you were trying to access an application via a HTTP proxy and were getting a 404
error, how would you go about determining why you were getting this error?
Describe how you would go about configuring a WebLogic server to give an application
access to a database.
How many threads does a managed server make available to an application? (expect
different answers for different versions of WebLogic)
What kind of problems would you expect to encounter when trying to increase a managed
server's maximum heap size to 3 GB? (Problems on 32-bit operating systems).
If an application was suffering short periodic freezes, and no errors were appearing in the
logs, can you suggest a possible cause? (Garbage collection)
How could you prevent these periodic lock-ups?
What are the ways you could check when garbage collection is occurring?
If you start an admin server as a Windows service, where is that server's classpath
defined? (Windows Registry)
If you start a managed server via a node manager, where is that server's classpath
defined? (config.xml)
If a managed server is crashing with a StackOverflow exception, what could be the
cause?
Describe how you would go about configuring a JMS queue in a WebLogic cluster. (i.e. a
distributed queue).
Describe how you might run a WLST script?
What are clusters?
Cluster is a logical set of multiple Weblogic Server instances running
simultaneously across different geographies and working together to achieve high
availability and scalability
Weblogic Server clusters support multiple algorithms for load balancing and
failover: round-robin, weight-based, random, round-robin-affinity, weight-basedaffinity,
and random-affinity(By default, a Weblogic Server cluster will use the
round-robin method)
What is session replication?
Weblogic Server provides clustering support for servlets and JSPs by
replicating 'HTTP session state' of clients that access servlets and JSPs through a
cluster service
Weblogic Server can use 'memory, file based and database' persistence for
storing session information
How you deploy your applications on weblogic server?
Auto Deployment
Console
Command line – weblogic.deployer
ANT / WLST
What are stating modes are available in Weblogic Server ?
Stage mode: Administration Server copies the deployment files from their
original location on the Administration Server machine to the staging directories
of each target server
External Stage: target servers deploy using local copies of the deployment files,
here the Administration Server does not automatically copy the deployment files
to targeted servers in external_stage mode ; instead, you must copy the files to the
staging directory of each target server before deployment.
No Stage: 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.
What is a Thread dump? How will you take in unix/linux and windows?
A Java thread dump is a way of finding out what every thread in the JVM is
doing at a particular point in time. This is especially useful if your Java
application sometimes seems to hang when running under load, as an analysis of
the dump will show where the threads are stuck.
Linux : kill -3 <ps_id>
Windows (console mode) : crtl+break
Windows (service) : beasvc -dump -svcname:mydomain_myserver
How should u look for in a Thread Dump?
Always have 7-10 thread dumps taken in an interval of 5 seconds each
A thread dump will give you an insight on what every thread in the JVM is
currently doing
While analyzing the thread dump you should be looking for stuck threads
(threads which have not moved from a long time) – could be a resource (file / db)
lock not allowing the thread to complete the task and free the monitor
Look for thread locsk(if two threads store references to different objects into
the same reference value, the variable will subsequently contain a reference to one
object or the other, not a reference to some other object or a corrupted reference
value)
Look for recursive loops in application / server code traces, usually hampers
server performance by utilizing CPU
What is difference between 8.1 and 9.2, 10.x versions?
8.1 uses JDK 1.4.2 ; 9.2/10.0 uses JDK 1.5 ; 10.3 uses JDK 1.6
8.1 uses execute worker threads ; 9.2/10/10.3 uses work manager for work load
distribution within the server
Directory structures
Console applet bases in 8.1 ; while it is portlet based in later versions
8.1 has one big config.xml ; later versions have basic info in config.xml and
subsystem level info in different directories(jms, jdbc, etc)
What are multi pools / multi data sources?
MultiPools are 'pools of connection pools' that you can set up according to
either a high availability or load balancing algorithm
You can use a MultiPool in the same manner that you use a connection pool.
When an application requests a connection, the MultiPool determines which
connection pool will provide a connection, based on the selected algorithm
What is IIS server?
IIS is a webserver developed by Microsoft which is shipped with Windows
NT/2000/2003 +
Available versions : 5, 6, 7
Usually used for hosting static HTML pages and used as an aplkication server
for ASP.NET application developed using DOT NET framework 1+.
Can be used as a proxy server for routing requests to weblogic server
Where are user credentials stored?
User credentials are stored in the 'boot.properties' file , which has its encryption
key in the 'SerializedSystemIni.dat'
If you use a script to start a server instance, it is recommended that you do not
use this technique because it requires you to store an unencrypted password in the
startup script.
Suggest few JVM tuning parameters.
Initial heap size and maximum heap size to be same (-xms and –xmx):T his
ensures less is spend by the CPU to allocate memory in rutime
Young generation (-XX:MaxNewSize): The bigger the young generation, the
less often minor collections occur. However, for a bounded heap size a larger
young generation implies a smaller tenured generation, which will increase the
frequency of major collections. The optimal choice depends on the lifetime
distribution of the objects allocated by the application.
the Administration Server does not copy the archive files from their source
ReplyDeletelocation. Instead, each target server must access the archive files from a single source directory
for deployment.
you manage a server that runs your company website the web server has reached its capacity