Wednesday, 20 January 2016

WebLogic Interview Questions

 Top 50 WebLogic Interview Questions



1. Explain deployment descriptors?
Deployment descriptors are associated with almost all the modules as well as applications. The deployment descriptors can be seen in the form of XML documents and they are capable of describing the contents that are part of directory or the jar file. J2EE specifications usually define the standard as well as the deployment descriptors which are portable for J2EE applications and modules.
2. What is web.xml ?
Web.xml is an XML document that is mainly for application purpose and it helps in listing out the J2EE components and configuration that of your application in J2EE modules format.
3. What is the name of default JVM that is made used for WebLogic?
The sun hotspot JDK default is made used for development, JRockit is the one used for production of WebLogic 11g as well as 12c. Operating system is another factor that helps in choosing the certified JDK JVM.
4. Explain the methods for providing user credentials for starting the server?
At the time of the creation of domain, the wizard for setting configuration asks for the details like user name, password etc. from the user who is logging in for the first time as an administrator. If the domain is created in development mode, the configuration wizard saves the encrypted password as well as the username inside an identity file. This file is available for reference during the time of booting so that in the absence of this file, system can prompt the user for the purpose of entering credentials. A new boot – identity file can be created if you want to change the use credentials or else if you are having the requirement of creating domain in the production mode.
5. Is there any possibility for starting managed server during the absence of administrator server?
The usual process is that in case of any difficulty for the manager server to get connected to any administration server at the time of start up, there is an option for the managed server to retrieve the configuration related to it from the configuration files as well as other files involved.  The information thus retrieved cannot be altered and it is possible only when the administration server is really available. When the administration server is unavailable, then the managed server enters into its independence mode for carrying out its operations.
OracleBoxWebLogic_598x598
6. Explain WebLogic server.
This is a kind of server that supports various services as well as infrastructure that are related with JEE applications. WebLogic server is capable of deploying components as well as applications through WSDL, UDDI and SOAP. This server gets configured as a web server by making use of HTTP listener for supporting the HTTP. Web servers like that of Apache, Netscape and Microsoft are utilized.  The configuration of a web server allows WebLogic is capable of providing services to dynamic and static requests that are usually generated by servlets, HTML and JSP.
7. What are the capabilities of WebLogic server?
There are various capabilities associated with WebLogic server and they are
·        Changes in dynamic configuration.
·        Production application redeployment
·        Rolling upgrades.
8. Explain about the function associated with T3 in WebLogic server ?
T3 provides enhancements support for the messages of WebLogic server. The enhancements comprise of the object replacement, the working of the seblogic server – clusters and also HTTP. T3 also performs serialization of java object and also predation of RMI. T3 can be considered as a superset associated with java object. T3 is mandated between WebLogic servers, programmatic clients and cluster associated with WebLogic server. The protocols HTTP and IIOP are made used for enabling communication between WebLogic server and processes.
9. Explain the use of HTTP ?
HTTP is the protocol that is made used for the purpose of enabling communication between the WebLogic server and processes.
10. Explain the functionality of IIOP ?
IIOP is a kind of protocol helpful in enabling the communication between WebLogic server and object request broker.
11. How do stubs function inside WebLogic server cluster at the time of failure?
Stubs perform the process of removing the failed instance from the list whenever there is a failure. The stub usually makes use of DNS for finding the running server and also for obtaining the list of the instances that are currently available with the application. List of the instances available with the server inside cluster gets periodically refreshment and allows in acquiring advantages associated with new servers. The advantages are gained as the server gets added to the cluster.
12. How can default JVM be changed to other?
For changing the JVM can be done by following the steps below.
·        You should first set the JAVA_HOME in the start script of the server.
·        Change the config.xml of domain for using the JRockit javac.exe
·        Remove any kind of switches specific to Sun JVM from start scripts of server.
13. How clients handle the DNS – requests to the failed servers?
Bandwidth gets wasted in the case of continues DNS requests to that of unavailable machine at the time of server failure. This problem usually occurs during the time of startup associated with the application that of client side. The servers that are unavailable are removed by searching DNS entries provided by WebLogic server. This removal prevents the clients from accessing failed servers. A third party load – balancers are made used for avoiding the unnecessary DNS requests. Some of the third party load – balancers are BigIP, resonate, local director and Alteon. The main function of these third party loads – balancers is to mask multiple addresses of DNS in to a single one.
14. Explain the functionality of T3 associated with WebLogic server?
T3 is capable of providing framework or overall structure for the messages that are capable of supporting the enhancements. The enhancements comprises of product tunneling, working in the context associated with clusters of WebLogic server and also in object replacement.
15. How can classpath be set?
Classpath can be set by making use of the following script WL_HOME\server\bin\setWLSEnv.cmd (in case of windows).
16. Explain the functioning of Stub?
Stub is usually expected by the people who connect to the WebLogic server cluster. The stub has the list that consists of the available instances of server that perform host implementations associated with object. The stub also has the functionality of balancing the load by distributing load amongst the host servers.
17.  What are the steps for the creation of Pooling within Tomcat server?
·        The first step involved in this process of creating pooling is to download 3 jar files which are the commons-dbcp-1.2 jar, commons-pool-1.3.jar and commons-collections-3.1 jar.
·        The next step is to make an entry inside server.xml of tomcat factory.
18. How can you differentiate server crash and server hang?
With a server crash, there is no existence for the Java process and if it is a server hang, then the Java process stops responding.
19. What are the causes for server crash?
The major reasons for the occurrence of server crash are the native IO, JVM, supported configuration, JDBC driver issues and SSL native libraries.
20. How can you solve the issue of server crash?
A crash associated with JVM is capable of generating hs_err_pid file. You need to refer this file for finding out the root cause for such a crash. In the case of native IO being the origin of thread, you need to disable it. If the origin of the problem is from the driver, need to contact the driver team.
21. How can Server Hang be solved?
Java WebLogic.Admin PING needs to be checked for finding whether you get a normal and positive response. You can find out the root cause for hanging from this file. You just need to rectify the errors that are identified from this file.
22. Explain the reasons for server hang?
The major reasons that lead to the server hang are memory leak, deadlock, and long time for returning.
23. Define memory leak ?
Memory leak is the condition that arises when the objects get retained in the heap even after they have no use.
24. What causes the condition OUT OF MEMORY?
There are various reasons that can lead to this condition and they are
·        Insufficient size of the heap compared to the extra load.
·        Placing of the objects takes longer period of time like that of HTTP sessions.
·        Occurrence of memory leak inside the application code.
·        The prevention of occurrence of full GC because of JVM bug.
25. How can the OUT OF MEMORY be solved?

There is a possibility for collecting the memory data after enabling GC – verbose. If the condition has aroused because of HTTP session, then it will be automatically solved when the session gets time out. You should also verify the code associated with the handling of jdbc connectivity. You should also optimize the size of the heap by considering the load.
26. When can high usage of CPU occur?
This is the condition that usually occurs when a single thread or process makes use of a larger portion of the CPU in an unexpected manner.
27. How can the issue associated with high CPU usage be solved?
In windows platform the issue of CPU high usage can easily be solved by making use of pslist and also with the process explorer to observe the function performed by the thread or the process.
28. Explain the term clustering?
Clustering is the process of grouping the servers together for accomplishing high percentage of scalability and availability.
29. What is the purpose of clustering?
The major goal of performing the process of clustering is to make high scalability as well as availability of the servers possible. This process also helps in balancing the load in a proper manner and also accomplishes failover.
30. How can cluster communication occur?
The communication through cluster is made possible by the multicast IP as well as port by the process of sending periodic messages which are normally called as heartbeat messages.
31. What are the various types of WebLogic installations?
The WebLogic installation usually occurs in three different modes which are:
·        Graphical mode
·        Console mode
·        Silent mode.
32. What is Graphic mode?
It is a kind of installation type that makes use of interactive GUI.
33. What is console mode?
This is a kind of installation type that follows interactive text based method.
34. What is silent mode?
This is a method of installation that is non-interactive and is usually based on the .xml properties – file.
35. What is Unicast?
Unicast is the method used in the clustering technique where there are cluster master and each server should ping to this cluster master for informing that the server is alive.
36. What is Multicast?
It is a kind of clustering system where there is no cluster master and each and every server needs to ping each other for informing their existence. Multicasting has many messages to be sent in the form of ping as each server needs to inform all others about its existence. This condition creates much complexity associated with the method compared to unicast.
37. What is a stage deployment?
Stage deployment is a kind of process in which the admin gets a physical copy which is distributed to the other instances.
38. What is non-stage deployment?
There is no copy in the administrator but each and every server needs to contact the source directly for getting the item to be deployed.
39. How can port number be checked?
Port number can be checked by using netstat-na|grep connected.
40. How to find out the listening ports?
Listening ports can be found out by using netstat-na|grep listen.
41. How to check the version of Java?
Version of java can be checked by using [roo@h1vm/]#java-version.
42. How is it informed when the server is added to the cluster?
The availability of the new server in the cluster is broadcasted by the WebLogic server – cluster.
43. How many WebLogic servers can be held inside a multi-processor machine?
There is no limitation for the number of servers.
44. What is application tuning?
This process involves ejb pool – size cache and jsp recompilation.
45. What is OS tuning?
This is the process of setting up TCP/IP parameters.
46. What is Core Server tuning?
This is the process involving the tuning of work manager, chuck size, performance packs, chunk pool size and connection backlog buffering.
47. What is JVM tuning?
This process involves monitoring of the garbage collection and the tuning of gc strategy.
48. What is a Machine?
Machine is the logical representation that of the physical machine.
49. What is Node Manager?
Node manager is a service from Java that is capable of running separate process other than that of WebLogic server.
50. What is a domain?
Domain can be defined as the group which comprises of various WebLogic – server resources.

 

Hibernate Interview Questions

 Top 50 Hibernate Interview Questions



1. What’s Hibernate?
Hibernate is a popular framework of Java which allows an efficient Object Relational mapping using configuration files in XML format. After java objects mapping to database tables, database is used and handled using Java objects without writing complex database queries.
2. What is ORM?
ORM (Object Relational Mapping) is the fundamental concept of Hibernate framework which maps database tables with Java Objects and then provides various API’s to perform different types of operations on the data tables.
3. How properties of a class are mapped to the columns of a database table in Hibernate?
Mappings between class properties and table columns are specified in XML file as in the below example:
4. What’s the usage of Configuration Interface in hibernate?
Configuration interface of hibernate framework is used to configure hibernate. It’s also used to bootstrap hibernate. Mapping documents of hibernate are located using this interface.
5. How can we use new custom interfaces to enhance functionality of built-in interfaces of hibernate?
We can use extension interfaces in order to add any required functionality which isn’t supported by built-in interfaces.
6. Should all the mapping files of hibernate have .hbm.xml extension to work properly?
No, having .hbm.xml extension is a convention and not a requirement for hibernate mapping file names. We can have any extension for these mapping files.
7. How do we create session factory in hibernate?
hibernate interview questions
To create a session factory in hibernate, an object of configuration is created first which refers to the path of configuration file and then for that configuration, session factory is created as given in the example below:
1
2
3
4
Configuration config = new Configuration();
config.addResource("myinstance/configuration.hbm.xml");
config.setProperties( System.getProperties() );
SessionFactory sessions = config.buildSessionFactory();
8. What are POJOs and what’s their significance?
POJOs( Plain Old Java Objects) are java beans with proper getter and setter methods for each and every properties.
Use of POJOs instead of simple java classes results in an efficient and well constructed code.
9. What’s HQL?
HQL is the query language used in Hibernate which is an extension of SQL. HQL is very efficient, simple and flexible query language to do various type of operations on relational database without writing complex database queries.
10. How can we invoke stored procedures in hibernate?
In hibernate we can execute stored procedures using code as below:
[xml]
<sql-query name=”getStudents” callable=”true”>
<return alias=”st” class=”Student”>
<return-property name=”std_id” column=”STD_ID”/>
<return-property name=”s_name” column=”STD_NAME”/>
<return-property name=”s_dept” column=”STD_DEPARTMENT”/>
{ ? = call selectStudents() }
</return>
</sql-query>
[/xml]
11. What is criteria API?
Criteria is a simple yet powerful API of hibernate which is used to retrieve entities through criteria object composition.
12. What are the benefits of using Hibernate template?
Following are some key benefits of using Hibernate template:
a. Session closing is automated.
b. Interaction with hibernate session is simplified.
c. Exception handling is automated.
13. How can we see hibernate generated SQL on console?
We need to add following in hibernate configuration file to enable viewing SQL on the console for debugging purposes:
[xml]
<property name=”show_sql”>true</property>
[/xml]
14. What are the two types of collections in hibernate?
Following are the two types of collections in hibernate:
a. Sorted Collection
b. Order Collection
15. What’s the difference between session.save() and session.saveOrUpdate() methods in hibernate?
Sessionsave() method saves a record only if it’s unique with respect to its primary key and will fail to insert if primary key already exists in the table.
saveOrUpdate() method inserts a new record if primary key is unique and will update an existing record if primary key exists in the table already.
16. What the benefits are of hibernate over JDBC?
a. Hibernate can be used seamlessly with any type of database as its database independent while in case of JDBC, developer has to write database specific queries.
b. Using hibernate, developer doesn’t need to be an expert of writing complex queries as HQL simplifies query writing process while in case of JDBC, its job of developer to write and tune queries.
c. In case of hibernate, there is no need to create connection pools as hibernate does all connection handling automatically while in case of JDBC, connection pools need to be created.
17. How can we get hibernate statistics?
We can get hibernate statistics using getStatistics() method of SessionFactory class as shown below:
SessionFactory.getStatistics()
18. What is transient instance state in Hibernate?
If an instance is not associated with any persistent context and also, it has never been associated with any persistent context, then it’s said to be in transient state.
19. How can we reduce database write action times in Hibernate?
Hibernate provides dirty checking feature which can be used to reduce database write times. Dirty checking feature of hibernate updates only those fields which require a change while keeps others unchanged.
20. What’s the usage of callback interfaces in hibernate?
Callback interfaces of hibernate are useful in receiving event notifications from objects. For example, when an object is loaded or deleted, an event is generated and notification is sent using callback interfaces.
21. When an instance goes in detached state in hibernate?
When an instance was earlier associated with some persistent context (e.g. a table) and is no longer associated, it’s called to be in detached state.
22. What the four ORM levels are in hibernate?
Following are the four ORM levels in hibernate:
a. Pure Relational
b. Light Object Mapping
c. Medium Object Mapping
d. Full Object Mapping
23. What’s transaction management in hibernate? How it works?
Transaction management is the process of managing a set of statements or commands. In hibernate; transaction management is done by transaction interface as shown in below code:

[java]
Session s = null;
Transaction tr = null;
try {
s = sessionFactory.openSession();
tr = s.beginTransaction();
doTheAction(s);
tr.commit();
} catch (RuntimeException exc) {
tr.rollback();
} finally {
s.close();
}
[/java]
24. What the two methods are of hibernate configuration?
We can use any of the following two methods of hibernate configuration:
a. XML based configuration ( using hibernate.cfg.xml file)
b. Programmatic configuration ( Using code logic)
25. What is the default cache service of hibernate?
Hibernate supports multiple cache services like EHCache, OSCache, SWARMCache and TreeCache and default cache service of hibernate is EHCache.
26. What are the two mapping associations used in hibernate?
In hibernate; we have following two types of mapping associations between entities:
a. One-to-One Association
b. Many-to-Many Association
27. What’s the usage of Hibernate QBC API?
Hibernate Query By Criteria (QBC) API is used to create queries by manipulation of criteria objects at runtime.
28. In how many ways, objects can be fetched from database in hibernate?
Hibernate provides following four ways to fetch objects from database:
a. Using HQL
b. Using identifier
c. Using Criteria API
d. Using Standard SQL
29. How primary key is created by using hibernate?
Database primary key is specified in the configuration file hbm.xml. Generator can also be used to specify how primary key is being created in the database.
In the below example, deptId acts as primary key:
[xml]
<id name=”deptId” type=”string” >
<column name=”columnId” length=”30″/>
<generator/>
</id>
[/xml]
30. How can we reattach any detached objects in Hibernate?
Objects which have been detached and are no longer associated with any persistent entities can be reattached by calling session.merge() method of session class.
31. What are different ways to disable hibernate second level cache?
Hibernate second level cache can be disabled using any of the following ways:
a. By setting use_second_level_cache as false.
b. By using CACHEMODE.IGNORE
c. Using cache provider as org.hibernate.cache.NoCacheProvider
32. What is ORM metadata?
All the mapping between classes and tables, properties and columns, Java types and SQL types etc is defined in ORM metadata.
33. Which one is the default transaction factory in hibernate?
With hibernate 3.2, default transaction factory is JDBCTransactionFactory.
34. What’s the role of JMX in hibernate?
Java Applications and components are managed in hibernate by a standard API called JMX API. JMX provides tools for development of efficient and robust distributed, web based solutions.
35. How can we bind hibernate session factory to JNDI ?
Hibernate session factory can be bound to JNDI by making configuration changes in hibernate.cfg file.
36. In how many ways objects can be identified in Hibernate?
Object identification can be done in hibernate in following three ways:
a. Using Object Identity: Using == operator.
b. Using Object Equality: Using equals() method.
c. Using database identity: Relational database objects can be identified if they represent same row.
37. What different fetching strategies are of hibernate?
Following fetching strategies are available in hibernate:
1. Join Fetching
2. Batch Fetching
3. Select Fetching
4. Sub-select Fetching
38. How mapping of java objects is done with database tables?
To map java objects with database tables, we need to have Java beans properties names same as column names of a database table. Then mapping is provided in hbm.xml file as given below:
[xml]
<hibernate-mapping>
<class name=”Student”  table=”tbl_student”>
<property  column=”studentname” length=”255″
name=”studentName” not-null=”true”  type=”java.lang.String”/>
<property  column=”studentDisciplne” length=”255″
name=”studentDiscipline” not-null=”true”  type=”java.lang.String”/>
</class>
</hibernate-mapping>
[/xml]
39. What are derived properties in hibernate?
Derived properties are those properties which are not mapped to any columns of a database table. Such properties are calculated at runtime by evaluation of any expressions.
40. What is meant by a Named SQL Query in hibernate and how it’s used?
Named SQL queries are those queries which are defined in mapping file and are called as required anywhere.
For example, we can write a SQL query in our XML mapping file as follows:
[xml]
<sql-query name = “studentdetails”>
<return alias=”std”/>
SELECT std.STUDENT_ID AS {std.STUDENT_ID},
std.STUDENT_DISCIPLINE AS {std.discipline},
FROM Student std WHERE std.NAME LIKE :name
</sql-query>
[/xml]
Then this query can be called as follows:
[java]
List students = session.getNamedQuery(&amp;quot;studentdetails&amp;quot;)
.setString(&amp;quot;TomBrady&amp;quot;, name)
.setMaxResults(50)
.list();
[/java]
41. What’s the difference between load() and get() method in hibernate?
Load() methods results in an exception if the required records isn’t found in the database while get() method returns null when records against the id isn’t found in the database.
So, ideally we should use Load() method only when we are sure about existence of records against an id.
42. What’s the use of version property in hibernate?
Version property is used in hibernate to know whether an object is in transient state or in detached state.
43. What is attribute oriented programming?
In Attribute oriented programming, a developer can add Meta data (attributes) in the java source code to add more significance in the code. For Java (hibernate), attribute oriented programming is enabled by an engine called XDoclet.
44. What’s the use of session.lock() in hibernate?
session.lock() method of session class is used to reattach an object which has been detached earlier. This method of reattaching doesn’t check for any data synchronization in database while reattaching the object and hence may lead to lack of synchronization in data.
45. Does hibernate support polymorphism?
Yes, hibernate fully supports polymorphism. Polymorphism queries and polymorphism associations are supported in all mapping strategies of hibernate.
46. What the three inheritance models are of hibernate?
Hibernate has following three inheritance models:
a. Tables Per Concrete Class
b. Table per class hierarchy
c. Table per sub-class
47. How can we map the classes as immutable?
If we don’t want an application to update or delete objects of a class in hibernate, we can make the class as immutable by setting mutable=false
48. What’s general hibernate flow using RDBMS?
General hibernate flow involving RDBMS is as follows:
a. Load configuration file and create object of configuration class.
b. Using configuration object, create sessionFactory object.
c. From sessionFactory, get one session.
d. Create HQL query.
e. Execute HQL query and get the results. Results will be in the form of a list.
49. What is Light Object Mapping?
Light Object Mapping is one of the levels of ORM quality in which all entities are represented as classes and they are mapped manually.
50. What’s difference between managed associations and hibernate associations?
Managed associations relate to container management persistence and are bi-directional while hibernate associations are unidirectional.