Sie sind auf Seite 1von 18

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

Java Jotter
JavaJotter About Us OnlineTraining Advertise With Us Contact Us Testimonials Java/J2ee Jobs .NET Jobs Java Java Servlet

About Us

Contact Us

Online Training

Site Map

Advertise With Us

APPLICATION SERVERS INTERVIEW QUESTIONS

First

Prev

Page 1/8

Next

Last

Q) Can I set the deployment order for application modules? For standalone modules? A) The Load Order attribute controls the deployment order of standalone modules and applications relative to other modules and applications of the same type. For example, standalone EJBs with smaller Load Order values are deployed before those with higher values. Modules that are deployed as part of an Enterprise Application (EAR file or directory) are deployed in the order in which they are specified in the application.xml deployment descriptor. Q) Can I start a Managed Server if the Administration Server is unavailable? A) 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.

Your Advertisement Goes Here JavaServer Pages (JSP) Enterprise JavaBeans (EJB) JDBC Q) Can I refresh static components of a deployed application without having to redeploy the entire application?

A) Yes. You can use weblogic.Deployer to specify a component and target a server, using the following syntax: JavaServer Faces (JSF) java weblogic.Deployer -adminurl http://admin:7001 -name appname -targets server1,server2 -deploy jsps/*.jsp JSP Standard Tag Library Q) How can I set deployment order for applications? Java/J2EE Design Patterns A) WebLogic Server allows you to select the load order for applications. WebLogic Server deploys server-level Spring Hibernate Apache Struts Java Web Services Java Swing Q) How do I increase WebLogic Server memory? Java FX Java Message Service(JMS) A) 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 ... 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. Q) How are notifications made when a server is added to a cluster? A) 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.

This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves performance and allows Remote Method Invocation WebLogic Server to handle more simultaneous connections. You can increase this value if necessary. (RMI) XML AJAX JavaScript CORBA Application Servers UML OOAD Q) How do clients handle DNS requests to failed servers? A) 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 load-balancer 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. Q) How do stubs work in a WebLogic Server cluster? A) 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

1 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

contains the load balancing logic for distributing the load among its host servers. Q) How will you load properties file? A) Use a ResourceBundle. See the Java docs for the specifics of how the ResourceBundle class works. Using this method, the properties file must go into the WEB-INF/classes directory or in a jar file contained in the WEB-INF/lib directory. Another way is to use the method getResourceAsStream() from the ServletContext class. This allows you update the file without having to reload the webapp as required by the first method. Here is an example code snippet, without any error trapping: // Assuming you are in a Servlet extending HttpServlet // This will look for a file called "/more/cowbell.properties" relative // to your servlet Root Context InputStream is = getServletContext().getResourceAsStream("/more/cowbell.properties"); Properties p = new Properties(); p.load(is); is.close(); Q) How do I configure Tomcat to work with IIS and NTLM? A) Follow the standard instructions for when the isapi_redirector.dll Configure IIS to use "integrated windows security" In server.xml, make sure you disable tomcat authentication: <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" tomcatAuthentication="false"/> Q) How do I turn the auto-deployment feature off? A) The auto-deployment feature checks the applications folder every three seconds to determine whether there are any new applications or any changes to existing applications and then dynamically deploys these changes. The auto-deployment feature is enabled for servers that run in development mode. To disable auto-deployment feature, use one of the following methods to place servers in production mode: In the Administration Console, click the name of the domain in the left pane, then select the Production Mode checkbox in the right pane. At the command line, include the following argument when starting the domain's Administration Server: -Dweblogic.ProductionModeEnabled=true Production mode is set for all WebLogic Server instances in a given domain.

Your Advertisement Goes Here

Q) How can I access members of a custom Realm or Principal? A) When you create a custom subclass of RealmBase or GenericPrincipal and attempt to use those classes in your webapp code, you'll probably have problems with ClassCastException. This is because the instance returned by request.getUserPrincipal() is of a class loaded by the server's classloader, and you are trying to access it through you webapp's classloader. While the classes maybe otherwise exactly the same, different (sibling) classloaders makes them different classes. This assumes you created a My``Principal class, and put in Tomcat's server/classes (or lib) directory, as well as in your webapp's webinf/classes (or lib) directory. Normally, you would put custom realm and principal classes in the server directory because they depend on other classes there. Here's what you would like to do, but it throws ClassCastException: MyPrincipal p = request.getUserPrincipal(); String emailAddress = p.getEmailAddress(); Here are 4 ways you might get around the classloader boundary: 1) Reflection Principal p = request.getUserPrincipal(); String emailAddress = p.getClass().getMethod("getEmailAddress", null).invoke(p, null); 2) Move classes to a common classloader You could put your custom classes in a classloader that is common to both the server and your webapp - e.g., either the "common" or bootstrap classloaders. To do this, however, you would also need to move the classes that your custom classes depend on up to the common classloader, and that seems like a bad idea, because there a many of

2 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

them and they a core server classes. 3) Common Interfaces Rather than move the implementing custom classes up, you could define interfaces for your customs classes, and put the interfaces in the common directory. You're code would look like this: public interface MyPrincipalInterface extends java.security.Principal { public String getEmailAddress(); } public class MyPrincipal implements MyPrincipalInterface { ... public String getEmailAddress() { return emailAddress; } } public class MyServlet implements Servlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { MyPrincipalInterface p = (MyPrincipalInterface)request.getUserPrincipal(); String emailAddress = p.getEmailAddress(); ... } Notice that this method gives you pretty much the webapp code you wanted in the first place 4) Serializing / Deserializing You might want to try serializing the response of 'request.getUserPrincipal()' and deserialize it to an instance of [webapp]MyPrincipal. Q) How do I provide user credentials for starting a server? A) 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. Q) How do I enable Server Side Includes (SSI)? A) Two things have to be done for tomcat to aknowledge SSI scripts: 1. Rename $CATALINA_BASE/server/lib/servlets-ssi.renametojar to $CATALINA_BASE/server/lib/servlets-ssi.jar. 2. Uncomment the section of web.xml found in $CATALINA_BASE/conf/web.xml that deals with SSI. it looks like this when it is uncommented: < servlet> < servlet-name> ssi< /servlet-name> < servlet-class> org.apache.catalina.ssi.SSIServlet < /servlet-class> < init-param> < param-name> buffered< /param-name> < param-value> 1< /param-value> < /init-param> < init-param> < param-name> debug< /param-name> < param-value> 0< /param-value> < /init-param> < init-param> < param-name> expires< /param-name> < param-value> 666< /param-value> < /init-param> < init-param> < param-name> isVirtualWebappRelative< /param-name> < param-value> 0< /param-value> < /init-param> < load-on-startup> 4< /load-on-startup> < /servlet>

3 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

Your Advertisement Goes Here

Q) How do I use DataSources with Tomcat? A) When developing J2EE web applications, the task of database connection management can be daunting. Best practice involves using a J2EE DataSource to provide connection pooling, but configuring DataSources in web application servers and connecting your application to them is often a cumbersome process and poorly documented. The usual procedure requires the application developer to set up a DataSource in the web application server, specifying the driver class, JDBC URL (connect string), username, password, and various pooling options. Then, the developer must reference the DataSource in his application's web.xml configuration file, and then access it properly in his servlet or JSP. Particularly during development, setting all of this up is tedious and error-prone. With Tomcat 5.5, the process is vastly simplified. Tomcat allows you to configure DataSources for your J2EE web application in a context.xml file that is stored in your web application project. You don't have to mess with configuring the DataSource separately in the Tomcat server.xml, or referencing it in your application's web.xml file. Here's how: Install the JDBC Driver Install the .jar file(s) containing the JDBC driver in Tomcat's common/lib folder. You do not need to put them in your application's WEB-INF/lib folder. When working with J2EE DataSources, the web application server manages connections for your application. Create META-INF/context.xml In the root of your web app directory structure, create a folder named META-INF (all caps). Inside that folder, create a file named context.xml that contains a Resource like this: < ?xml version="1.0" encoding="UTF-8"?> < Context> < Resource name="jdbc/WallyDB" auth="Container" type="javax.sql.DataSource" username="wally" password="wally" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost;DatabaseName=mytest;SelectMethod=cursor;" maxActive="8" /> < /Context> This example shows how to configure a DataSource for a SQL Server database named mytest located on the development machine. Simply edit the Resource name, driverClassName, username, password, and url to provide values appropriate for your JDBC driver. Access the DataSource in Your Application From a Servlet Here's how you might access the data in a servlet: InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/WallyDB"); Connection c = ds.getConnection(); ... c.close(); Notice that, when doing the DataSource lookup, you must prefix the JNDI name of the resource with java:comp/env/ Q) How do I override the default home page loaded by Tomcat? A) After successfully installing Tomcat, you usually test it by loading http://localhost:8080 . The contents of that page are compiled into the index_jsp servlet. The page even warns against modifying the index.jsp files for this reason. Luckily, it is quite easy to override that page. Inside $TOMCAT_HOME/conf/web.xml there is a section called < welcome-file-list> and it looks like this: < welcome-file-list> < welcome-file> index.html< /welcome-file> < welcome-file> index.htm< /welcome-file> < welcome-file> index.jsp< /welcome-file> < /welcome-file-list> The default servlet attempts to load the index.* files in the order listed. You may easily override the index.jsp file by creating an index.html file at $TOMCAT_HOME/webapps/ROOT. It's somewhat common for that file to contain a new static home page or a redirect to a servlet's main page. A redirect would look like: < html> < head>

4 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

< meta http-equiv="refresh" content="0;URL=http://mydomain.com/some/path/to/servlet/homepage/"> < /head> < body> < /body> < /html> This change takes effect immediately and does not require a restart of Tomcat.

Your Advertisement Goes Here

Q) How do you create multiple virtual hosts? A) If you want tomcat to accept requests for different hosts e.g., www.myhostname.com then you must 0. create ${catalina.home}/www/appBase , ${catalina.home}/www/deploy, and ${catalina.home}/conf/Catalina /www.myhostname.com 1. add a host entry in the server.xml file < Host appBase="www/appBase" name="www.myhostname.com"/> 2. Create the the following file under conf/Catalina/www.myhostname.com/ROOT.xml < ?xml version="1.0" encoding="UTF-8"?> < Context path="/" docBase="www/deploy/mywebapp.war" reloadable="true" antiJARLocking="true"> < /Context> Add any parameters specific to this hosts webapp to this context file 3. put your war file in ${catalina.home}/www/deploy When tomcat starts, it finds the host entry, then looks for any context files and will start any apps with a context To add more sites just repeat and rinse, all webapps can share the same war file location and appbase Q) What is the function of T3 in WebLogic Server? A) 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. Q) How do you set the classpath? A) 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) where WL_HOME is the directory in which you installed WebLogic Server. Q) What happens when a failure occurs and the stub cannot connect to a WebLogic Server instance? A) 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) When should I use the external_stage option? A) Set -external_stage using weblogic.Deployer if you want to stage the application yourself, and prefer to copy it to its target by your own means. Q) When should I use the -nostage option? A) Set the staging mode to -nostage (using weblogic.Deployer or the Administration Console) if you don't want to copy deployment files but want to deploy an application from its present location. All target servers must be able to access the same set of deployment files.

5 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

Q)

What

is

the

difference

between

the

WL_HOME/config/examples/applications

folder

and

the

WL_HOME/config/examples/stage folder? A) The applications folder is intended for applications that are not yet ready for a production environment. WebLogic Server dynamically deploys the contents of the applications folder. The stage folder (or a folder that you create for the same purpose) is for storing copies of deployment files that are ready for deployment in a production environment (deployments that use the stage or external_stage deployment modes). Q) Is an XSLT processor bundled in WebLogic Server? A) Yes, an XSLT processor, based on Apache's Xalan 2.0.1 processor, in WebLogic Server 6.1.

Your Advertisement Goes Here

Q) 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? A) 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. Q) What causes Java.io exceptions in the log file of WebLogic Server? A) 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. Q) What can I do when I get java.lang.OutOfMemoryError because producers are faster than consumers? A) Quotas can be used to help this situation. Your sender will then receive ResourceAllocationExceptions and the server will stay up. WLS 6.X does not support paging of messages out of memory. As of WLS 6.1 SP02 or later, you can use the Message Paging feature, which can free up valuable virtual memory during peak message load periods by swapping out messages from virtual memory to persistent storage when message loads reach a specified threshold. Q) Why do I get an exception when trying to find a connection factory? A) 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). Q) How can I control on which WebLogic Server(s) my application will run? A) A system administrator can specify on which WebLogic Server(s) applications will run by specifying targets when configuring connection factories. Each connection factory can be deployed on multiple WebLogic servers. Note: If you use the default connection factory, you have no control over the WebLogic server on which the connection factory may be deployed. If you would like to target a particular WebLogic server, create a new connection factory and specify the appropriate JMS server target(s). Q) How do I restrict access to servlets and JSPs? A) 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. Q) How can I run multiple instances of the same servlet class in the same WebLogic Server instance?

6 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

A) If you want to run multiple instances, your servlet will have to implement the SingleThreadModel interface. An instance of a class that implements the SingleThreadModel interface is guaranteed not to be invoked by multiple threads simultaneously. Multiple instances of a SingleThreadModel interface are used to service simultaneous requests, each running in a single thread. When designing your servlet, consider how you use shared resources outside of the servlet class such as file and database access. Because there are multiple instances of servlets that are identical, and may use exactly the same resources, there are still synchronization and sharing issues that must be resolved, even if you do implement the SingleThreadModel interface. Q) Which XML parser comes with WebLogic Server 6.1? A) We bundle a parser, based on Apache's Xerces 1.3.1 parser, in WebLogic Server 6.1. In addition, we include a WebLogic proprietary high-performance non-validating parser that you can use for small to medium sized XML documents. The WebLogic XML Registry allows you to configure the parser you want to use for specific document types.

Your Advertisement Goes Here

Q) What is BEA Weblogic? A) 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 Q) How do I identify the document type of an XML document? A) If the XML document has a Public ID, then that is its document type. For example, if an XML document contains the following DOCTYPE declaration: "http://foo.com/url/to/my/dtd"> then its document type is My public ID String. If the DOCTYPE declaration does not contain a Public ID, but specifies a System ID, then the document type is the System ID. For example, in the following DOCTYPE declaration: the document type is http://foo.com/url/to/my/dtd. Note: The System ID is of the DTD, not of the XML document itself. It can, however, still be used as a way to identify the XML document. If the XML document does not specify a DOCTYPE declaration, then the document type can be either the root element name or the namespace URI, if it has one. Q) Must my bean-managed persistence mechanism use the WebLogic JTS driver? A) Use the TxDataSource for bean-managed persistence. Q) How do I set up my CLASSPATH? A) Setting up your CLASSPATH correctly depends on what you are trying to do. The most common tasks are described

7 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

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. Q) How does a server know when another server is unavailable? A) 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. Q) How many WebLogic Servers can I have on a multi-cpu machine? A) 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.

Your Advertisement Goes Here

Q) What is error "ORA-6502?" A) The default length of a string bound to an OUTPUT parameter of a CallableStatement is 128 characters. If the value you assign to the bound parameter exceeds that length, you will get this error. You can adjust the length of the value of the bound parameter by passing an explicit length with the scale argument to the CallableStatement.registerOutputParameter() method. Q) Which of the statements below is true for a web application using session management? a.) The session object is invalidated, when the session times out. b.) The session object is invalidated, when sessionInvalidate() method of HttpSession is invoked. a. Both of the above statements are true. b. Only statement a.) is true. c. Only statement b.) is true. d. None of the above statements is true. A) B is the correct choice. The session object will become invalid in either of the following scenarios: a.) When the session times out. b.) When invalidate() method of the HttpSession interface is invoked. Please note that invalidate() and not sessionInvalidate() is the method of HttpSession interface. Thus choice B is correct. Q) 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 A) 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

8 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

activated Q) 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 A) 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. Q) Must EJBs be homogeneously deployed across a cluster? Why? A) 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. Q) Why is there no polymorphic-type response from a create() or find() method? A) 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.

Your Advertisement Goes Here

Q) 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." A) 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. Q) Which of the following is NOT true about deploying EJBs in the WebLogic Server? a. The weblogic/config/examples/applications directory acts as an automatic deployment directory for EJB 2.0 .jar files and EJB .jar deployment directories b. The automatic redeployment feature of the WebLogic Server can only redeploy an EJB's implementation classes, you cannot redeploy an EJB's public interfaces c. Before deploying a packaged jar file containing uncompiled EJB classes and interfaces, we have to use weblogic.ejbc on the packaged .jar file to generate WebLogic Server container classes. A) Choice C is correct because it is NOT true. A and B are true about deploying EJBs in the WebLogic server. The weblogic/config/examples/applications directory acts as an automatic deployment directory for EJB 2.0 .jar files and EJB .jar deployment directories. When you start WebLogic Server, it automatically deploys any valid EJB 2.0 .jar files or .jar directories that reside in the applications directory. WebLogic Server also checks the contents of applications every

9 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

ten seconds to determine whether an EJB deployment has changed. If a deployment has changed, it is automatically redeployed using the dynamic deployment feature. If you change the contents of a compiled EJB .jar file in applications, WebLogic Server automatically attempts to redeploy the .jar using the dynamic deployment feature. Since the automatic redeployment feature uses dynamic deployment, WebLogic Server can only redeploy an EJB's implementation classes. You cannot redeploy an EJB's public interfaces. You create compiled EJB 2.0 .jar files by Compiling your EJB classes and interfaces, packaging the EJB classes and interfaces into a valid .jar file and then Using weblogic.ejbc on the .jar file to generate WebLogic Server container classes. An uncompiled EJB .jar file has the same structure as a compiled file, but you do not have to compile individual class files and interfaces and you do not have to use weblogic.ejbc on the packaged .jar file to generate WebLogic Server container classes. So C is not true. Q) How do I protect WebLogic Server from security attacks from bogus clients using the WL-Proxy-Client-Cert header? A) The WL-Proxy-Client-Cert header can be spoofed (used) by any client which has direct access to WebLogic Server. WebLogic Server takes the certificate information from that header, trusting that is came from a secure source (the plug-in) and use that information to authenticate the user. In previous releases of WebLogic Server, the default behavior was to always trust that header. Now you need to explicitly define trust of the WL-Proxy-Client-Cert header. A new parameter clientCertProxy allows WebLogic Server to on the implicit trust of the certificate header. If you need an additional level of security, use a connection filter to limit all connections into WebLogic Server (therefore allowing WebLogic Server to only accept connections from the machine on which the plug-in is running). The clientCertProxy parameter has been added to the HTTPClusterServlet and Web applications. For the HTTPClusterServlet, add the parameter to the web.xml file as follows: < param-name> clientCertProxy < param-value> true For Web applications, add the parameter to the web.xml file as follows: ServletRequestImpl context-param < param-name> weblogic.http.clientCertProxy < param-value> true You can also use this parameter in a cluster as follows: ClientCertProxyHeader="true"/> Q) 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. A) 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-in-free-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, max-beans-in-free-pool has no limit; the maximum number of beans in the free pool is limited only by the available memory.

Your Advertisement Goes Here

Q) 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 A) 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

10 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

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. Q) How do I get a thread dump to help track down a problem? A) 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. Q) 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. A) 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. Q) How do I connect to an SQL Server instance that is running on a machine with multiple instances of SQL Server 2000? A) 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. Q) Can I enable requests to a JDBC connection pool for a database connection to wait until a connection is available? A) 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? A) Currently, multibyte character sets are not supported for the WebLogic jDriver for Informix driver.

Your Advertisement Goes Here

Q) How is security handled in the WebLogic J2EE Connector Architecture? A) 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

11 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

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. Q) 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 A) 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. Q) 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 A) The Weblogic Server JNDI implementation requires objects to be serializable, not referencable. A PrintWriter cannot be serialized and therefore should be declared transient. Q) How do I call Oracle stored procedures that take no parameters? A) 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. Q) Why do I get unexpected characters from 8-bit character sets in WebLogic jDriver for Oracle? A) 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 (?). Q) Why do I get an error while trying to retrieve the text for ORA-12705? A) 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. Q) How do I limit the number of Oracle database connections generated by WebLogic Server? A) 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, Q) Why do I run out of resources during updates with Oracle's database link? A) 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,

12 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

inserts, and updates. Q) Why am I getting an "ORA-01000: maximum open cursors exceeded" error, even though I closed all ResultSet, Statement, and Connection objects? A) 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.

Your Advertisement Goes Here

Q) 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 A) 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. Q) 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 A) 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. Q) 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 A) 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

13 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

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. Q) 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 A) 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.

Your Advertisement Goes Here

Q) How do I do HTTP tunneling? A) 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 <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). Q) How to choose websphere over other application servers? A) Selecting application server is part of architechtural process when infrastructure is defined. It depends on several facots: * External systems your application will be interacting * Type of application you have * Target availability of system * Corporate standards * Budget Q) How many ways can you deploy applications in websphere? A) * Directly copy files to deployedapplication folder in websphere- hot deployment. * Use websphere specific ant tasks and building automated scripts for deploying application. * Through administration console Q) How to import jaxp package in IBM WSAD? A) * Open WSAD * Go to project * Click properties * Select javaBuildPath * Add any jar file like jaxp select add external jars. Q) How to implement JDBC-ODBC bridge driver (Type 1) in Websphere? A) If you use JDBC type (I) driver you dont need to add any driver in websphere.You simply created DSN and use it locally, same we use java class, if you use Type(2) and Type(4) so first go to admin console then go to connection, then add driver there fill other info like conn. size, uname pass, max conn. and connect it to you applications. Q) Explain about web sphere? A) The word web sphere popularly refers to IBM middleware technology products. Web sphere is known for its turn key

14 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

operation in e business applications.It has run time components and tools which can help in creating applications which run on WAS. WAS refers to web sphere application server. Q) Explain about web sphere commerce? A) IBM web sphere commerce has a single platform which offers complete ecommerce solutions to developers. It can be very productive if you are planning to do business with consumers, business and indirectly through channel partners. This can be used to perform business with consumers, business and channel partners altogether. Q) Explain about IBM Web Sphere edge server? A) Web sphere edge server is used to improve the performance of web based systems. It can be used as forward or proxy server. Basically four components are present in the web sphere they are Network dispatcher, Caching proxy, Content distribution and application service at the edge. Q) State some of the features present in web sphere? A) Some of the features which are present in web sphere are: * Order management * Web sphere commerce accelerator * Analytical and business intelligence * Open standards such as Java, EJB, etc * Web sphere commerce payments and customer care, etc Q) Explain about extended deployment? A) Web sphere application server extended deployment increases the functionality of the server in two main areas they are manageability and performance. Dynamic virtualization between servers is possible with the help of XD. A stand alone distributed cache was added to it under the performance header, it is known as Object Grid.

Your Advertisement Goes Here

Q) Explain about the security features present in WAS? A) Security model for web sphere is primarily based on JAVA EE security model. It also depends upon the operating system. User authentication and authorization mechanisms are also provided in WAS. Light weight third party authentication mechanism is the main security feature present in WAS. Q) Explain about caching proxy of IBM Web sphere Edge sphere? A) A caching proxy can be configured in forward direction or as a proxy. Content requested by the user is cached by edge before sending or adhering to the query. Page fragments arising from JSP or servlets are cached by Edge and the caching process is slow. Performance and scalability of J2EE applications can be increased by edge. Q) Explain about IBM web sphere integration developer? A) Web sphere integration developer provides an IDE to build applications based on service oriented architecture. Web sphere process server and web sphere ESB were built with WID. WID was built with RAD Eclipse based technology. Q) Explain the attribute CHANNEL in web sphere MQ? A) CHANNEL specifies the name of the server connection channel. Generally this is Web Sphere MQ network abstraction. The default standard used by CHANNEL is SVRCONN which is the server connection channel. This server is generally used to communicate to the queue manager by the client. Q) What is WSRR? A) IBM WebSphere Service Registry and Repository Q) How to choose web sphere over other application servers? A)Selecting application server is part of architectural process when infrastructure is defined. It depends on several factors: 1. External systems your application will be interacting 2. Type of application you have 3. Target availability of system. 4. Corporate standards 5. Budget.

15 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

n parameters. Q) Is there any difference between Web logic and Web sphere application servers? A) Functionally these two products are fairly close except for some minor differences in supported standards. While WebSphere tends to focus more on integration, connectivity, and web services - Web Logic has in the past focused more on emerging J2EE standards and ease-of-use. Because of Web Sphere's rich implementations of J2EE it is a little more involved, but benefits with better performance, more extensive integration and transaction management In terms of transaction Web Logic is having default transaction attribute as "Supports", but WebSphere does not have any default transaction attribute. WebSphere strictly follows the J2EE architecture Q) what are the different application servers and web servers supporting JAVA,.NET and VC++ Technologies A) Application Server that supports J2EE - JBoss IBM Websphere and BEA Weblogic servers are a combination of Application Server, Web Server & container Jakarta Tomcat is a Serlet container +a web server. Web Server - Apache Sever Q) Explain about compute Grid? A) Compute grid is also known as Web sphere batch. Web sphere extended deployment offers a Java batch processing system called as Compute Grid. This forms an additional feature to Web sphere network environment. Various features are provided which help a developer to create, manage and execute batch jobs. Job scheduler, xJCL, batch container and batch programming controller. Q) Explain about web sphere MQ Real time transport? A) This feature is very useful in instant messaging across different clients through intranet and internet. This supports high volume and high performance across different clients. It uses the concept of light weight transport which is again based on IP rather than the queue process. Q) Explain about Web sphere MQ JMS Provider? A) Web sphere MQ and Web Sphere Business integration manager Broker are very useful in providing Java messaging services to wide range of clients (publisher - subscribe, point to point). Java classes are chiefly responsible for translating the API calls to API`s defined by web sphere. It is very useful to have knowledge of Web sphere MQ for proper configuration.

Your Advertisement Goes Here

Q) Is the naming of connection factory independent of the name specified by JMS client? A) Yes, the naming of connection factory is independent of the name specified by JMS client. This is made possible by WAS (Web sphere application server) with its resource references. It isolates the application from object names. This feature is important because it gives us the flexibility to change the administered object without changing the JMS client code. Q) What is the extra feature of WAS 6.x compared to WAS 5.x??? The difference btw the two versions of 5.x and 6.x. And in which field they differ? and why we go for 6.x rather than 5.x. and what are the similarities for both 5.x and 6.x Supports J2EE 1.2, 1.3 and 1.4 specifications A) Can upgrade runtime environment without upgrading applications - Supports mixed version nodes in a v6 ND Cell - Allow for migration in stages within a cell - Mixed v5 and v6 nodes must have v6 DMgr (can't add new v5 node) - v6 ND introduces profiles - Each profile has its own user data including WebSphere configuration - All profiles share same WebSphere binaries - Less disk space required than separate installations - stand-alone server, deployment manager or custom profile Q) What is the difference between web server and application server? A) Application Server: takes care of Security, Transaction, Multithreading, Resource pooling, load balancing, clustering, performence, highly availability, scalability, etc. Exposes business logic to client applications through various protocols,

16 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

possibly including HTTP. Supports deployment of .war and .ear files Application server = webserver + EJB container. Webserver: handles HTTP protocol. Receives HTTP request, it responds with an HTTP response. Q) What are deployment descriptors? How many types of Deployment descriptors are available? What are they? A) Deployment descriptor is an XML file that describes how to deploy a module or application by specifying configuration and container options. For example, an EJB deployment descriptor passes information to an EJB container about how to manage and control an enterprise bean. There are two types of deployment descriptor in websphere: * Web application deployment descriptor * portlet deployemnt descriptor Portlets are packaged as WAR files with a web application deployment descriptor (web.xml). This defines each portlet as a servlet within the web application, including unique identifiers for each portlet, the portlet class, and initialization parameters. Q) Is there any difference between weblogic and websphere? A) Webpshere tends to focus more on integration, connectivity and web services. it has rich implementation of J2EE, better performance, more extensive integration and transaction management. In terms of trnsaction weblogic is having default transaction attribute as 'supports', but websphere does not have any default transaction attribute. Q) Explain about asymmetric clustering? A) Asymmetric clustering applications are primarily used in electronic trading systems employed in banks. Some of the features are, partitions can be declared http://marancollects.blogspot.com 4/5 during run time and are usually run on a single cluster at a time. Work specific to a particular can be routed to that cluster. Q) Explain the various Administrator benefits using Web sphere? A) Web sphere almost reduces the work of server administrator as he can manage load on servers efficiently without any hassles. It also gives him flexibility to divide the load and applications among different server farms. He can also predict about the incoming load on servers. Email alerts, restart options, memory leak detection, etc. Q) Can I run Seam with JDK 1.4 and earlier? A) No, Seam only works on JDK 5.0 and above. It uses annotations and other JDK 5.0 features. Q) Detail about the architecture of web sphere? A) Web Sphere is built on three main components they are * Database * J2EE application server http://marancollects.blogspot.com 3/5 * A web server The databases which it supports are * DB2 * Oracle * Cloudscape Application server is IBMWAS and the supported web servers are * IBM server * Microsoft IIS * Sun web server

Your Advertisement Goes Here

Q) Explain about the network deployment feature present in WAS? A) Managing singletons will be a thing of the past and it also provides hot recovery of singletons which makes you forget about your GC collected singletons. Transaction logs can stored on a shared file system. For clustering run time operations deployment manager`s role was eliminated. J2EE failover support and cell configuration support is also present.

17 of 18

29-May-13 12:31 PM

APPLICATION SERVERS: Interview Questions

http://www.javajotter.net/appserver/interview_questions/appserverinterv...

Q) How to depoly your struts application in JBOSS A) First u have to create the war. the war consists of jar files,Action Classes and ur jsp files and all the XML file. then deploy the war to the deploy path. Q) What is JBoss Cache? A) JBoss Cache is a replicated and transactional cache. It is replicated since multiple JBoss Cache instances can be distributed (either within the same JVM or across several JVMs whether they reside on the same machine or on different machines on a network) and data is replicated across the whole group. Q) Can I run Seam outside of JBoss AS? A) Yes, you can run Seam applications in plain Tomcat 5.5+ or in the Sun GlassFish application server. To run Seam application in Tomcat, you need a number of additional library files and a few configuration files to bootstrap the JBoss EJB3 inside Tomcat. Please refer to the deploy.tomcat ANT build target for the Seam booking example (in the examples/booking directory of the Seam distribution) for more on how to build a Tomcat WAR for Seam applications. Refer to this blog post on how to run Seam in Sun's Glassfish application server. Q) Does Seam support REST style bookmarkable URLs? A) Yes, it is very easy to expose REST style bookmarkable URLs in a Seam application. In addition, the Seam application can initialize all the necessary backend business logic and persistence components when the user loads that URL. This way, the RESTful URL is not only an information endpoint but also an application interaction start point. Q) How can I configure JBoss Cache? A) You can configure the JBoss Cache through a configuration xml file. Or you can set it programmatically through its get/set methods. Q) Does the Tree Cache config ClusterName have any relation to the JBoss AS cluster PartitionName? A) Yes. They are both JGroups group names. Besides the notion of a channel in JGroups, it also can partition the channel into different group names. Q) What about using PojoCache as a Hibernate cache? A) It is not necessary to use PojoCache for second level cache inside Hibernate because Hibernate manages fine-grained fields in Java objects. So using PojoCache won't provide any advantage. Q) can I unit test Seam applications without starting the Application Server? A) Yes, Seam provides its own integration test framework based on TestNG. You can easily mock all Seam services using those facilities without ever loading an application server or a database. Refer to the testexample ANT target in the Seam booking example application for more details. Q) Can I run multiple JBoss Cache instances on the same VM? A) Yes. There are some scenarios where you may want to run multiple instances of JBoss Cache. For example, you want to run multiple local cache instances with each instance having its own configuration (e.g., different cache policy). In this case, you will need multiple xml configuration files. Q) Can I run Seam in a J2EE environment? A) Yes, as of Seam 1.1, you can use Seam in any J2EE application server, with one caveat: you will not be able to use EJB 3.0 session beans. However, you can use either Hibernate or JPA for persistence, and you can use Seam JavaBean components instead of session beans.
First Prev Page 1/8 Next Last

18 of 18

29-May-13 12:31 PM

Das könnte Ihnen auch gefallen