Sachin Kansal

Ranch Hand
+ Follow
since Sep 18, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sachin Kansal

Hi! All,
1) To which of the components of the EJB does the SingleTon pattern aplies?
a) Remote
b) Bean
c) Home
2) U want to store the reference of a CMP EB in HttpSession. What shud u store so that the instance can be retrived in a minimum steps?
a) EJB PK
b) HomeHandle
c) Remote Handle
Cheers
Sachin
Hi! All,
Plz post answers to following questions. 287 looks easier than 158 bcoz there are less WSAD and WAS specific questions.
bye.
Sachin
Note: Questions without no. of answers have 1 answer.
1) Which of the following deployment descriptors CANNOT have EJB references defined?
A. ejb-jar.xml
B. web.xml
C. application-client.xml
D. dds.xml

2) A typical use of ejbHome and ejbSelect method would be? 2
A. use ejbSelect methods within ejbHome methods to return entities
B. use ejbSelect methods to access fields of a bean instance
C. use ejbHome methods to perform operation not specific to a entity instance
D. Use ejbHome methods to initialize entity bean instance variables

3) Which of the following MUST be provided in a tag library descriptor XML file? 2
A. The version of JSP custom tags being used.
B. The version of J2EE for the custom tag library.
C. The definition of at least one custom tag.
D. The short name of the web application in which the library is used.
E. The prefix for the custom tags defined in the library.
4) A developer wishes to write a custom class to log information about HttpSession lifecycle events, including creation and destruction of HttpSessions. Which of the following MUST the developer do? 2
A. Write a class which implements HttpSessionAttributeListener.
B. Write a class which implements HttpSessionListener.
C. Add the listener classes to the web deployment descriptor.
D. Write a class which implements HttpSessionBindingListener.
E. Configure the listeners using the Server Configuration editor.
5) While testing a method of a container-managed transaction EJB, javax.ejb.TransactionRequiredException is thrown. The method is configured with transaction attribute:
A. Never
B. Required
C. Supports
D. RequiresNew
E. Mandatory
6) A developer discovers that an exception being thrown from a business method on a bean-managed transaction session bean does not cause the transaction to rollback as expected. What would correct this problem? 2
A. Call setRollbackOnly() on the EJBContext.
B. Call rollback() on the current UserTransaction object.
C. Call rollback() on the EJBContext.
D. call setRollbackOnly() on the UserTransaction object.
7) A developer suspects memory leaks in an application. After collecting profiling information, which two views will help determine where and why the memory leak is occuring? 2
A. Method Execution.
B. Sequence Diagram.
C. Object Reference.
D. Method Invocation.
E. Heap.
8)
Session bean White: security-identity use-caller-identity
Session bean Black: security-identity run-as roleC
Entity bean Blue: nothing specified
Entity bean Yellow: nothing specified
Entity bean Green: nothing specified
Assembly-descriptor
security-role roleA
security-role roleB
security-role roleC
method-permission roleA White <method-name>*</method-name>
Blue <method-name>*</method-name>
Yellow <method-name>*</method-name>
roleB White <method-name>*</method-name>
Black <method-name>*</method-name>
Yellow <method-name>*</method-name>
roleC Blue <method-name>*</method-name>
Green <method-name>*</method-name>
Which of the following statements are TRUE regarding this deployment descriptor?

A. A client under the identity of roleA can invoke Blue and Yellow through White.
B. A client under the identity of roleA can invoke Blue and Yellow through Black.
C. A client under the identity of roleB can invoke Yellow and Green through White.
D. A client under the identity of roleB can invoke Blue and Green through Black.
E. A client under the identity of roleB can invoke Yellow and Green through Black.
Select 2 answers.
9) An enterprise application employs servlets, JSPs, HTML pages, images, EJBs and Java classes. These Java classes are common to both servlets and EJBs. What is the BEST way to package these components into J2EE modules?

A. Package the servlets and JSPs into a WAR file, the Enterprise Beans into an EJB JAR and the Java classes in a separate JAR. After which package these archives along with the JSPs, HTML pages and images into an EAR file.
B. Package the servlets, HTML pages, images and JSPs into a WAR file, the Enterprise Beans into an EJB JAR and the Java classes in a separate JAR. After which package these archives into an EAR file.
C. Package the servlets, Java Classes, HTML pages, images and JSPs into a WAR file, the Enterprise Beans and the Java classes into an EJB JAR. After which package these archives into an EAR file.
D. Package the servlets and JSPs into a WAR file, the Enterprise Beans into an EJB JAR and the Java classes in a separate JAR. Publish the JSPs, HTML pages and images to the Web Server document root and package the Java archives into an EAR file.
Select the best answer.
10) Which of the following is NOT a benefit of marking a resource reference to a DataSource in the server configuration as SHAREABLE?

A. Multiple connection handles can be mapped to the same physical database connection.
B. Applications do not tie up physical database connections when they are not accessing the database.
C. The isolation level for each connection handle can be set by an application as needed.
D. Connection handles can be cached and then reused after the application has completed it's database transaction.
Select the best answer.
11) In addition to using the server configuration editor, which of the following methods can be employed to modify the trace specifications of a server running the WebSphere test environment in WebSphere Studio?
A. Programatically, calling the setTraceSpec(String) method of the com.ibm.etools.Trace class.
B. Edit the server-cfg.xml file.
C. Through the Administration Console.
D. Edit the bootstrap.properties file.
Select 2 answers.
12) A web application needs to be able to scale to very large volume with a very diverse client profile. Application data involves only small amounts of primitive data, which are not sensitive. Which of the following is the BEST approach for managing application state?
A. Use persistent Cookies.
B. Use hidden form fields.
C. Use HttpSessions.
D. Use stateful session beans.

13) When setting up the JMS server, in a test environment which is already running message-driven beans (MDB), which of the following properties MUST be configured to correctly communicate messages to a new MDB?
A. Queue JNDI name
B. Initial state to: Started
C. Queue name
D. Connection factory JNDI name
E. Listener port name
14) A developer wants to generate access beans for session EJBs that have remote interfaces. Which type of access bean, generated by WebSphere Studio, is appropriate to meet this requirement?
A. Java bean wrapper
B. Copy helper
C. Row set
D. Data class
15) A developer has finished writing a message-driven bean to handle messages arriving from a business partner. WebSphere Application Server has been installed on a test machine and a connection factory and destination have been configured for the embedded JMS provider using the Administrative Console, but no other configuration has been performed. What other configuration task MUST be completed before the MDB can be tested on the test server?
A. Add a new message listener port
B. Enable the message listener service
C. Specify a message passivation directory
D. Specify the native library directory
16) A developer wants to migrate an enterprise application which was running on IBM WebSphere Application Server AE V4. When refactoring the code to make use of the new EJB 2.0 features the developer MUST: 2
A. be aware of pass-by-reference semantics when using Local Interfaces with entity beans
B. be aware of pass-by-value semantics when using Local Interfaces with session beans
C. make sure all CMP classes are refactored to be abstract and final classes
D. declare all CMP classes as abstract and remove persistent fields
Select 2 answers.
17) When processing a request, which of the following objects is BEST suited for sharing data between the servlet that is processing the request and the JSP the request is forwarded to?
A. request
B. session
C. context
D. application
Select the best answer.
18) While testing the create method of a CMP entity bean using the Universal Test Client of IBM WebSphere Studio Application Developer, the following exception is thrown: ... Exception: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] ... SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1" constrains table "LIBRARY.PATRON" from having duplicate rows for those columns. SQLSTATE=23505 Which of the following is the BEST place to set the breakpoint?
A. The ejbCreate method
B. The create method
C. The ejbPostCreate method
D. The ejbStore method
Select the best answer.
19) The following sequence of method calls occurred on a CMP entity bean instance when a session bean invoked the CMP's businessMethod1() and businessMethod2() methods from the same session bean method entityBean.ejbActivate() entityBean.ejbLoad() entityBean.businessMethod1() entityBean.businessMethod2() entityBean.ejbStore() entityBean.ejbPassivate() Assuming that the session bean is configured with 'Required', what MUST be TRUE about the scenario that generated these method calls?
A. The business methods are NOT configured with 'RequiresNew'
B. Any persistent state changes that occur as a result of businessMethod1() are in the same transaction scope as changes made by businessMethod2().
C. Any persistent state changes that occur as a result of businessMethod1() are in a different transaction scope than changes made by businessMethod2().
D. ejbStore() will write the resultant state of the entity bean to the persistent store.
Select 2 answers.
20) While testing a session bean configured with "Bean Managed", a developer discovers that a TransactionRolledBackException is being thrown by a call to a method on an entity bean. The session bean, prior to calling the method, explicitly started the transaction. Possible causes for the exception are that the:
A. entity bean method is throwing a checked exception and is configured with a transaction attribute of "Required".
B. entity bean method is throwing an unchecked exception and is configured with a transaction attribute of "Required".
C. entity bean does not throw an exception but is configured with a transaction attribute of "Not Supported".
D. entity bean method is throwing an exception and is configured with a transaction attribute of "Requires New".
Select 2 answers.
21) Given the design goal of having an application be as robust as possible, which techniques should the developer AVOID in the design?
A. Use persistent HttpSessions to manage application state data.
B. Use stateful session EJBs to manage application state data.
C. Make references to node-specific resources.
D. Make all resource references via java:comp/env JNDI references.
Select 2 answers.
22)
package myapp.servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
if (Authenticator.authenticateUser(req))
{
req.getRequestDispatcher("/mainmenu.jsp").forward(req, resp);
}
req.getRequestDispatcher("/login.jsp").forward(req, resp);
}
}
During testing, a user enters user ID and password information into an HTML form and this information is submitted to the LoginServlet. The browser displays the expected JSP depending on whether valid or invalid user information is provided, but an IllegalStateException is thrown when the user details are valid. Which of the following actions will correct this problem?

A. Add a return statement immediately before the closing bracket of the conditional statement in LoginServlet's doGet method.

B. Add URL mappings for the JSPs to the web deployment descriptor so that they can be preloaded by the web container.

C. Add code to the start of LoginServlet's doGet method to set the status and the content type of the HttpServletResponse object.

D. Add a page directive to the JSPs to set autoFlush to false.
Select the best answer.

23) A developer has created a Java Project in IBM WebSphere Studio, which is used by an EJB Project. When the server is started for testing, the following messages appear in the console. ... addEjbModule failed for LibraryEJBProject.jar [class com.ibm.ws.runtime.component.DeployedModuleImpl] java.lang.Error: Unresolved compilation problems: ... Which of the following should the developer suspect?

A. The developer did not run 'Generate -> Deploy and RMIC Code...'
B. The developer did not run 'Run Validation'
C. The Java Project is not added to 'Project Utility JARs' in the Application Deployment Descriptor
D. The EJB Project is not added to 'Project Utility JARs' in the Application Deployment Descriptor
E. The Java Project is not added to 'Java Build Path' in the EJB Project
Select the best answer.
24) A developer has created a Java Project in IBM WebSphere Studio, which is used by an EJB Project. When the server is started for testing, the following messages appear in the console. ... addEjbModule failed for LibraryEJBProject.jar [class com.ibm.ws.runtime.component.DeployedModuleImpl] java.lang.Error: Unresolved compilation problems: ... Which of the following should the developer suspect?

A. The developer did not run 'Generate -> Deploy and RMIC Code...'
B. The developer did not run 'Run Validation'
C. The Java Project is not added to 'Project Utility JARs' in the Application Deployment Descriptor
D. The EJB Project is not added to 'Project Utility JARs' in the Application Deployment Descriptor
E. The Java Project is not added to 'Java Build Path' in the EJB Project
Select the best answer.
25) When a developer declares an EJB local reference in WebSphere Studio and tests the J2EE 1.3 application using the WebSphere V5.0 Test environment, what element does NOT need to be specified?
A. global JNDI binding for EJB local home
B. ejb-ref-type
C. local-home
D. home
Select the best answer.
26) Upon startup, a web application reads global information from a database into an object of type com.ibm.ApplicationInfo and adds this object to the servlet context. Which of the following tags allows for accessing this information from a JSP page?

A. <jsp:useBean id="appinfo" class="com.ibm.ApplicationInfo" />
B. <jsp:useBean id="appinfo" class="com.ibm.ApplicationInfo" scope="config"/>
C. <jsp:useBean id="appinfo" class="com.ibm.ApplicationInfo" scope="context"/>
D. <jsp:useBean id="appinfo" scope="application" class="com.ibm.ApplicationInfo"/>
Select the best answer.
27) The "Universal Test Client" feature of WebSphere Studio Application Developer, V5 test environments can be used to test which of the following?
A. Servlets in the web modules of the enterprise application.
B. Enterprise beans in the EJB modules of the enterprise application.
C. Resource adapters in the enterprise application
D. Custom tag libraries in the web modules of the enterprise application
Select the best answer.
28) A web application is experiencing very large volumes of traffic and profiling has shown that the amount of session data managed by the server is becoming too large for it to handle. Which of the following is the BEST way to solve the problem?

A. Use the HttpSession to store only key values which can be used to access data in a third-tier system.
B. Configure the application server to use URL rewriting instead of Cookies to manage the session ID.
C. Disable HttpSession serialization to prevent automatic storage of HttpSession objects during periods of heavy load.
D. Use HTML hidden fields to manage client-specific application data instead of HttpSessions.
Select the best answer.
29) A developer implements a web-based business process which spans multiple steps. The developer should prefer maintaining state between the steps with stateful session beans instead of HttpSession objects IF:
A. there are also non-Web-based clients
B. a single HTTP request maps a business method call
C. transactions can span multiple business process steps
D. the client-specific state data is small
E. a single HTTP request involves several calls to entity beans
Select 3 answers.
30) A developer is designing a web application in which a user will submit a form containing information about a credit card transaction. This information will be used to validate the transaction using a network service provided by the credit card company. If the transaction is approved the transaction details are logged in a relational database and a confirmation is returned to the user. Maintainability, role separation and code reuse are all important objectives in the project. Which of the following would be the BEST way to structure the application?

A. A servlet receives the HTTP request, uses a session EJB to validate the transaction and forwards the request to a JSP to display the confirmation message.
B. A servlet receives the HTTP request, performs the transaction validation in the servlet method and writes the confirmation message to the response as HTML.
C. A JSP receives the HTTP request, uses a session EJB to validate the transaction and uses the results to generate the dynamic response to send back to the user.
D. A JSP receives the HTTP request, uses a JavaBean to validate the transaction and forwards the request to a servlet to write the confirmation message to the response as HTML.
Select the best answer.

31) An application uses BMP to manage the persistence of Customer and Address entity beans. Customers must have exactly one Address. Given this composition relationship and assuming that Customer holds the primary key for Address in a persistent field, which methods might be part of the implementation for Customer?
A. The ejbRemove() method of Customer invokes the remove() method of Address.
B. The ejbLoad() method of Customer invokes the findByPrimaryKey() method of AddressHome.
C. The ejbLoad() method of Customer invokes the ejbLoad() method of Address.
D. The ejbStore() method of Customer invokes the ejbStore() method of Address.
E. The ejbPassivate() method of Customer invokes the ejbPassivate() method of Address.
Select 2 answers.
32) An application uses BMP to manage the persistence of Customer and Address entity beans. Customers must have exactly one Address. Given this composition relationship and assuming that Customer holds the primary key for Address in a persistent field, which methods might be part of the implementation for Customer?

A. The ejbRemove() method of Customer invokes the remove() method of Address.
B. The ejbLoad() method of Customer invokes the findByPrimaryKey() method of AddressHome.
C. The ejbLoad() method of Customer invokes the ejbLoad() method of Address.
D. The ejbStore() method of Customer invokes the ejbStore() method of Address.
E. The ejbPassivate() method of Customer invokes the ejbPassivate() method of Address.
Select 2 answers.
33) In addition to using the server configuration editor, which of the following methods can be employed to modify the trace specifications of a server running the WebSphere test environment in WebSphere Studio?
A. Programatically, calling the setTraceSpec(String) method of the com.ibm.etools.Trace class.
B. Edit the server-cfg.xml file.
C. Through the Administration Console.
D. Edit the bootstrap.properties file.
Select 2 answers.
34)Which of the following statements are TRUE about the implicit objects in JSP?
A. The "in" object can be used to retrieve user input.
B. The "config" object can be used to retrieve initialization parameters.
C. The "request" object can be used to retrieve header information.
D. The "dispatcher" object is used to forward or include other servlets or JSPs.
E. The "context" object can be used to retrieve context information such as referrer URI and MIME type.
Select 2 answers.
35)1. InitialContext ic = new InitialContext();
2. QueueConnectionFactory qcf = null;
3. qcf = (QueueConnectionFactory)ic.lookup("java:comp/env/myQCF");
The code above is part of a business method in a session bean deployed to the WebSphere Application Server. The method puts a message on a queue managed by WebSphere MQ. When the code on Line 3 is executed at runtime, a javax.naming.NamingException is thrown. All of the following could cause the exception EXCEPT:
A. The JNDI name used in Line 3 for the resource reference to the QueueConnectionFactory is not in the server configuration.
B. The QueueConnectionFactory referenced by the resource reference is not in the server configuration.
C. The resource reference with the JNDI name used in Line 3 is a reference to a TopicConnectionFactory in the server configuration.
D. The WebSphere MQ JMS client classes are not in the runtime classpath of the enterprise application in which the session bean is deployed.
Select the best answer.
36) A DataSource named "MyDatasource" has been created and configured (in WebSphere Test Environment) to have an "Unused timeout" of 30 and a "Minimum connections" of 10. If a servlet acquires a connection from that DataSource, and the servlet holds the connection for 2 minutes without using it, which statement is TRUE?
A. The servlet's connection will be unaffected by the Unused timeout.
B. The pool size will be increased by 10 when some other servlet needs a connection.
C. After 30 seconds, WebSphere can return the connection to the connection pool.
D. The servlet's service() method will throw a javax.sql.PooledConnectionException if the servlet attempts to use its connection.
Select the best answer.
37) What is the best practice for implementing the business logic in a message-driven bean (MDB) that needs to interact with other EJBs in the system?

A. Implement the business logic in the onMessage() method of the MDB.
B. Factor the business logic into one or more JavaBeans to increase their reuse.
C. Use a session EJB to implement the business logic and interact with the other EJBs.
D. Use a Java bean wrapper access bean to encapsulate the business logic.
Select the best answer.
38) While testing a session bean configured with "Bean Managed", a developer discovers that a TransactionRolledBackException is being thrown by a call to a method on an entity bean. The session bean, prior to calling the method, explicitly started the transaction. Possible causes for the exception are that the:
A. entity bean method is throwing a checked exception and is configured with a transaction attribute of "Required".
B. entity bean method is throwing an unchecked exception and is configured with a transaction attribute of "Required".
C. entity bean does not throw an exception but is configured with a transaction attribute of "Not Supported".
D. entity bean method is throwing an exception and is configured with a transaction attribute of "Requires New".Select 2 answers.

39) A developer is going to use an existing class named DataContainer. This class has a lot of fine-grained attributes and the data represented will be only used as a whole. When designing an entity bean that declares a persistent field of type DataContainer with IBM WebSphere Studio V5 the developer:
A. makes use of dependent value class concept
B. can use an EJB composer to map the attributes to database columns
C. should declare the DataContainer class as serializable and abstract
D. is able to query the attributes of DataContainer class with EJB QL
Select 3 answers.
40) Which of the following may be performed when a packaged enterprise application (EAR file) is deployed or installed in WebSphere Application Server, V5.0?
A. Generate the deploy code for enterprise beans in EJB modules.
B. Define the custom tag libraries used by the JSPs in the web module deployment descriptor.
C. Specify "Context Root" for each web module.
D. Generate Access beans for any enterprise beans.
E. Map entity beans to relational database schema.
Select 2 answers.
41) In a scenario where the customer uses databases from several vendors and wishes to improve performance, scalability and maintainability with IBM WebSphere Application Server V5, which design approach fits BEST?
A. Use session beans as a facade to CMP beans providing local interfaces
B. Use stateless session beans and BMP with performance-optimized SQL
C. Develop stored procedures for performance-critical queries
D. Call CMP entity bean methods directly via their remote interface to reduce network traffic
Select the best answer.
42) A self-service airline application needs to define a JDBC resource reference for a DB2 travel database in the deployment descriptor. Assuming that the name of the resource reference is "travel", what is the appropriate declaration?
A. java:comp/env/jdbc/travel
B. java:comp/env/travel
C. java:jdbc/env/db2/travel
D. java:comp/env/jdbc/db2/travel
Select the best answer.
43) What items MUST be specified when defining a custom web service XML-to-Java mapping during the creation of a web service SOAP client?
A. a Java class to map to
B. a deserializer class
C. a marshaller method
D. an unmarshaller method
Select 2 answers.
44) A travel service application includes EJBs representing Customers and Itineraries. The Customer Home defines the usual finder methods e.g., findCustomersByName() and findCustomersByPhoneNumber(). The Itinerary Home defines a finder supporting the association, namely findItinerariesByCustomer().
For security, three roles are defined:
o Client
o Agent
o TravelService
Consider adding the Customer EJB to a TravelApplication Enterprise Application. What is the BEST method permission to provide access by the Agent role to the findCustomersByPhoneNumber method? Map the Agent role to:
A. all the methods in the Customer EJB.
B. all the finder methods in the Customer EJB home.
C. the findCustomersByPhoneNumber method in the Customer EJB home.
D. the findCustomersByPhoneNumber method in the Customer EJB Access Bean.
Select the best answer.
45) A JSP is displaying data from a JavaBean accessed through a <jsp:useBean> tag. It is an error condition if the JavaBean is not found in the request scope at runtime. What should the JSP developer do to ensure correct behavior?
A. Specify the real JavaBean's Java type as the value for only the class attribute of the jsp:useBean tag.
B. Specify the JavaBean's Java type as the value for only the type attribute of the jsp:useBean tag.
C. Add an isErrorPage specification in a JSP page directive.
D. Add an errorPage specification in a JSP page directive.
Select 2 answers.
46) A developer implements a web-based business process which spans multiple steps. The developer should prefer maintaining state between the steps with stateful session beans instead of HttpSession objects IF:
A. there are also non-Web-based clients
B. a single HTTP request maps a business method call
C. transactions can span multiple business process steps
D. the client-specific state data is small
E. a single HTTP request involves several calls to entity beans
Select 3 answers.
47) A class is created which implements the HttpSessionBindingListener interface and an instance is created in a web application. Which of the following would be the MOST common use of the features of such an object?
A. The relationship between the object's internal state and the persistent representation can be synchronized when the object is stored in or removed from the HttpSession.
B. The object can be used to monitor the usage of the HttpSession to provide information to detect performance problems caused by HttpSession usage.
C. When the HttpSession is invalidated the object can manually ensure all objects stored in the HttpSession are correctly removed to prevent memory leakage.
D. Multiple HttpSession objects relating to the same client can be combined to avoid application data loss in situations where a client is required to reauthenticate.
Select the best answer.
48) A Java client application has to display data in multiple views where each view has its own data requirements. The BEST strategy for retrieving the data from the server is to:
A. Use session beans to gather the required data from multiple entity beans.
B. Use entity beans to provide the required data.
C. Move entity beans to the thick client.
D. Use message-driven beans to gather the required data from multiple entity beans.
Select the best answer.
49) The following are all true about Message Listener ports configured in the application server to support message-driven beans EXCEPT:
A. The same listener port can be used for more than one message-driven bean.
B. The listener port is bound to a specific JMS provider and a specific queue or topic managed by that JMS provider.
C. Listener ports can be configured to be started explicitly or automatically started when the Application Server starts.
D. Listener ports will ignore any messages posted to the queue or topic for which they are configured prior to being started.
Select the best answer.
50) A servlet program requests a database connection from a DataSource with JNDI name "jdbc/MyDatasource" connection pool. Based on the connection, the program executes an SQL statement, then the program releases the connection to the connection pool. The code in the servlet that handles the connection pool is as follows: 1: Context context = new InitialContext(); 2: DataSource ds = (DataSource)PortableRemoteObject.narrow(context.lookup("jdbc/DB2Sample"), DataSource.class); 3: Connection conn = ds.getConnection("userid", "PASSWORD"); 4: // Use the connection to perform database access 5: if(conn!=null) conn.close() For best performance and highest reuse of the connection pool, which steps should be put into servlet init method?
A. 1,2,3
B. 1,2,3,4
C. 1,2
D. No steps are performed in the init method
Select the best answer.
51) The "Universal Test Client" feature of WebSphere Studio Application Developer, V5 test environments can be used to test which of the following?
A. Servlets in the web modules of the enterprise application.
B. Enterprise beans in the EJB modules of the enterprise application.
C. Resource adapters in the enterprise application
D. Custom tag libraries in the web modules of the enterprise application
Select the best answer.
52) An "account" CMP bean has a container-managed relationship to a "customer" CMP bean. The account table reflects the relationship with a foreign key relating to the customer table. The foreign key is declared with a "NOT NULL" constraint. When creating a new account for a customer the developer MUST:
A. set the customer in the ejbCreate method of the account bean
B. set the customer in the ejbPostCreate method of the account bean
C. set the account in the ejbPostCreate method of the customer bean
D. provide a local interface for the customer CMP entity bean
Select 2 answers.
53) A developer wishes to hide the name of a servlet class from users of a web application for security reasons. Which of the following are the BEST ways to accomplish this?
A. Modify the mapping in the New Servlet Wizard when creating the servlet.
B. Modify the mapping in the Web Deployment Descriptor editor.
C. Use a proxy translator to map the external URL to the servlet class.
D. Configure the mapping in the configuration editor for the WebSphere V5.0 Test Environment.
E. Modify the mapping in the properties dialog for the servlet.
Select 2 answers.
54) How can a developer set the port number for the web container while running an enterprise application using WebSphere V5 test environments in WebSphere Studio Application Developer, V5?
A. By defining the port number in the deployment descriptor of the web modules in the enterprise application.
B. By defining the port number in the deployment descriptor of the enterprise application.
C. By defining the port number in the deployment descriptor of the ejb modules in the enterprise application.
D. By defining the port number in the test environment Server Configuration.
Select the best answer.
55) Which of the following statements are TRUE about tuning Data Source connection pools?
A. For better performance, set the Maximum Connections value for the connection pool lower than the value for the Max Connections in the Web container.
B. For better performance, set the Reap Time interval to a very small value.
C. Set the Reap time interval to a value less than that of Unused Timeout and Aged Timeout settings.
D. Maximum connections defines the total number of connections that are created by all servers in a cluster.
Select 2 answers.
56) Which of the following is NOT a benefit of marking a resource reference to a DataSource in the server configuration as SHAREABLE?
A. Multiple connection handles can be mapped to the same physical database connection.
B. Applications do not tie up physical database connections when they are not accessing the database.
C. The isolation level for each connection handle can be set by an application as needed.
D. Connection handles can be cached and then reused after the application has completed it's database transaction.
Select the best answer.
57) Two enterprise applications use a third party software (like Apache Xerces). While the actual versions of the third party software used are different between the two applications, the name of the JAR files across different versions is the same. To ensure proper running of these enterprise applications, which of the following should be used in WebSphere Application Server, V5.0 for application classloading policy ?
A. SERVLET ENGINE
B. SERVER
C. APPLICATION
D. MULTIPLE
E. SINGLE
Select the best answer.
Congrats Aaron!!
Did u get questions on EJB design patterns?
bye.
Sachin
Hi! Mohit,
Is J2EE design patterns available in the book prescribed by u (Enterprise Java Bean by Richard Monsoon Haefel)?
regards,
Sachin
Hi! Andrei,
Congrats!
I appeared for IBM 158 and failed by 1 question. I have a few doubts.
I am not very confident on WAS and WSAD topics. From where shud I read them?
Also Section - 3, Develop clients that access the enterprise components is a major concern. Plz suggest.
I would be grateful if u post ur score breakup.
bye.
Sachin
Hi! Mohit,
Congrats!! This is a very good score. But I think the exam also consists of JSP and Servlets apart from EJB. Is this book(Enterprise Java Bean by Richard Monsoon Haefel) available in India?
bye.
Sachin
Thanks All!!
I invite more information on this exam.
bye.
Sachin
Hi! All,
Can anyone send the correct answers?
1) In deployment descriptors, security roles and method permissions: (1)
A. can be shared across EJBs.
B. can utilize wildcard characters to authorize multiple methods at one time.
C. can be defined during deployment.
D. are mapped to actual user groups during deployment.
2) A developer buys a set of third party EJBs. Which of the following are included in the EJB .jar file? (3)
A. Bean classes.
B. Remote interfaces.
C. Home interfaces.
D. Source code.
3) A JMS session: (2)
A. can implement the QueueSession interface to support the publish-subscribe model.
B. can implement the TopicSession interface to support the publish-subscribe model.
C. can implement the QueueSession interface to support the point-to-point model.
D. can implement the TopicSession interface to support the point-to-point model.
4) An EJB business method performs an operation that throws a checked exception. The bean cannot recover from this checked exception and should rollback. The bean will be deployed using container-managed transaction demarcation. Which implementation is the BEST? (1)
A. public void businessMethod()
{
try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ throw new EJBException(ae); }
}
B. public void businessMethod()
{
try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ context.setRollbackOnly(); throw new EJBException(ae); } }
C. public void businessMethod() throws EJBException
{ try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ throw new EJBException(ae); } }
D. public void businessMethod() throws EJBException
{ try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ context.setRollbackOnly(); throw new EJBException(ae); } } }}
5) Implementing the SingleThreadModel interface(2)
A. requires all servlet methods be declared as synchronized.
B. guarantees that synchronization problems will never occur.
C. may have a negative impact on performance.
D. prevents multiple HTTP request threads from accessing a single servlet instance concurrently.
6) When comparing servlets and JSPs, which of the following are TRUE? (3)
A. JSPs provide better performance than servlets. (not true)
B. JSPs may call servlets and servlets may also call JSPs.
C. A JSP must be compiled into a servlet before it can be used.
D. Initialization and destruction behavior is supported in both servlets and JSPs.
7) Which of the following is TRUE concerning CMP Entity bean activation and passivation? (ans a)
a) Storage of persistent state to the database is handled automatically by the EJB container during passivation.
b) A client must explicitly activate a bean that has been passivated.
c) Clients do not directly communicate with a bean and are unaware of activation and passivation.
8) Most web applications require logic for validating form input and determining the next page to display. Given long term maintenance and reuse objectives, what is the BEST design to implement this logic? (1)
A. A JSP that both validates form input and determines the next page.
B. Validate form input in a JSP and determine the next page in a servlet.
C. Validate form input in a servlet and determine the next page in a JSP.
D. A servlet both validates form input and determines the next page.
9) An EJB client has no current transaction. It invokes the business method of an EJB using
container-managed transaction demarcation. The business method executes within the scope of a
transaction. Which of the following are possible values for the bean method's transaction attribute? (2)
A. NotSupported
B. Supports
C. Required
D. RequiresNew
E. Mandatory
10) When designing a distributed system, remote access to fine-grained objects should be avoided. Why? (2)
A. Thinner clients are possible with coarse-grained objects.
B. Fine-grained objects result in increased network traffic.
C. Fine-grained objects are hard to develop and maintain.
11) Which of the following statements accurately describe the J2EE architecture? (3)
A. Web components provide presentation logic that works well with anonymous clients over the Internet.
B. EJBs provide business logic within the context of transactions and persistence.
C. Web components access EJBs through the same APIs as application clients.
D. Application servers provide the infrastructure for the J2EE architecture.
12) What steps does a J2EE developer need to use to get a reference to an existing EJB's home? (3)
A. Get a remote reference to the EJB home by using the JNDI Context lookup() method, passing the name of the EJB's home.
B. Use the RMIRegistry lookup() method to get a remote reference to the EJB home.
C. Cast the EJB home remote reference to the right type by using the PortableRemoteObject.narrow() static method, passing the remote reference and the class of the EJB home.
D. Cast the remote object reference to the right type within Java.
13) An stateful Session bean is to be created. Which of the following objects are necessary? (2)
A. A primary key.
B. A home interface. *
C. A bean class.
D. A passivation class.
14) A stateful Session bean is being passivated by its container. Assuming all fields are non-transient, which of the following values will still exist following passivation? (4)
A. null.
B. A JDBC Connection.
C. An Entity bean.
D. A SessionContext.
E. A UserTransaction.
15) Which of the following is true concerning the use of UserTransaction? (2)
A. Stateless Session beans must start and end a UserTransaction within one method, since they service multiple clients.
B. Stateful Session beans must start and end a UserTransaction within one method, since they service multiple clients.
C. A UserTransaction for stateless Session beans can span methods, since they service only one client.
D. A UserTransaction for stateful Session beans can span methods, since they service only one client.
16) JMS Message is composed of which of the following parts? (3)
A. Header
B. Properties
C. Body
D. Footer
17) Servlet counts the number of times it has been called using an incrementCount() method. During testing, the developer verifies that the servlet accurately counts the requests from a number of clients. Which of the following BEST explains this fact?
A. The web or application server supports activation and passivation of the servlet.
B. The HttpServlet class is designed to share state data across all its instances.
C. The same servlet instance services all the requests.
D. The servlet doGet( ) method has been marked as synchronized.
18) A Proxy design pattern is one where a surrogate or placeholder for an object is used to communicate with an object that is not locally available. Which of the following J2EE technologies use proxies that are visible to a developer? (2)
A. JNDI
B. RMI
C. JSP
D. EJB
19) Which one of the following statements describes the design that BEST leverages the J2EE architecture? (1)
A. Clients install Swing components on their system which interact via RMI with EJBs on the server, EJBs interact with backend services such as databases.
B. Clients view applets in web browsers, servlets service the client requests on the server and interact with backend services such as databases.
C. Clients view HTML in web browsers, JSP pages service the client requests and interact with EJBs on the server, EJBs interact with backend services such as databases.
D. Clients view HTML in web browsers, CGI scripts service the client requests on the server and interact with EJBs on the server, EJBs interact with backend services such as databases.
20) In what manner is a reference to an Entity Bean obtained by a client? (1)
A. Invoking the zero-argument public constructor of the bean.
B. Invoking the appropriate create() method of the home interface.
C. Invoking the newInstance() method of the home interface.
D. Invoking the newInstance() method of the bean class.
21) Deployment-specific information for an EJB is located in: (1)
A. the bean class's BeanInfo class.
B. the properties variable of the home interface.
C. an XML deployment descriptor.
D. the server's ejb.properties file.
22) Which of the following are TRUE regarding BMP Entity beans? (2)
A. Persistent fields can be declared private. B. The ejbFindByPrimaryKey() method returns void.
C. Finder methods are implemented at deployment time.
D. A record should be inserted into the database during ejbCreate().
23) Transaction isolation levels in EJBs are: (3)
A. set by the bean developer for bean-managed transactions.
B. set by the deployer for container-managed transactions.
C. specified to the method level.
D. specified to the class level only.
24) Which of the following implicit page objects are available for a JSP error page, that is, one with an "isErrorPage=true" page directive? (3)
A. application
B. throwable
C. exception
D. config
25) Which of the following MUST be declared for a CMP Entity Bean in its deployment descriptor? (3)
A. Bean class.
B. Database connection factory reference.
C. Home and remote interfaces.
D. Primary key class.
26) Whose responsibility is it for providing an implementation for the home interface of an EJB? (1)
A. The application assembler.
B. The bean developer.
C. The container and its tools
D. The bean deployer
27) Which of the following are TRUE with respect to state management in a web application? (2)
A. It is impossible to determine whether cookies have been enabled on a client browser.
B. URL Rewriting is an alternative to using cookies.
C. URL Rewriting does not require any client side configuration.
D. HttpSession information is available to JavaScript code in a web page.
Thanks in advance.
Sachin
Hi! All,
Can anyone send the correct answers?
1) In deployment descriptors, security roles and method permissions: (1)
A. can be shared across EJBs.
B. can utilize wildcard characters to authorize multiple methods at one time.
C. can be defined during deployment.
D. are mapped to actual user groups during deployment.

2) A developer buys a set of third party EJBs. Which of the following are included in the EJB .jar file? (3)
A. Bean classes.
B. Remote interfaces.
C. Home interfaces.
D. Source code.

3) A JMS session: (2)
A. can implement the QueueSession interface to support the publish-subscribe model.
B. can implement the TopicSession interface to support the publish-subscribe model.
C. can implement the QueueSession interface to support the point-to-point model.
D. can implement the TopicSession interface to support the point-to-point model.
4) An EJB business method performs an operation that throws a checked exception. The bean cannot recover from this checked exception and should rollback. The bean will be deployed using container-managed transaction demarcation. Which implementation is the BEST? (1)
A. public void businessMethod()
{
try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ throw new EJBException(ae); }
}
B. public void businessMethod()
{
try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ context.setRollbackOnly(); throw new EJBException(ae); } }

C. public void businessMethod() throws EJBException
{ try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ throw new EJBException(ae); } }

D. public void businessMethod() throws EJBException
{ try
{ // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae)
{ context.setRollbackOnly(); throw new EJBException(ae); } } }}

5) Implementing the SingleThreadModel interface(2)
A. requires all servlet methods be declared as synchronized.
B. guarantees that synchronization problems will never occur.
C. may have a negative impact on performance.
D. prevents multiple HTTP request threads from accessing a single servlet instance concurrently.

6) When comparing servlets and JSPs, which of the following are TRUE? (3)
A. JSPs provide better performance than servlets. (not true)
B. JSPs may call servlets and servlets may also call JSPs.
C. A JSP must be compiled into a servlet before it can be used.
D. Initialization and destruction behavior is supported in both servlets and JSPs.

7) Which of the following is TRUE concerning CMP Entity bean activation and passivation? (ans a)
a) Storage of persistent state to the database is handled automatically by the EJB container during passivation.
b) A client must explicitly activate a bean that has been passivated.
c) Clients do not directly communicate with a bean and are unaware of activation and passivation.

8) Most web applications require logic for validating form input and determining the next page to display. Given long term maintenance and reuse objectives, what is the BEST design to implement this logic? (1)
A. A JSP that both validates form input and determines the next page.
B. Validate form input in a JSP and determine the next page in a servlet.
C. Validate form input in a servlet and determine the next page in a JSP.
D. A servlet both validates form input and determines the next page.

9) An EJB client has no current transaction. It invokes the business method of an EJB using
container-managed transaction demarcation. The business method executes within the scope of a
transaction. Which of the following are possible values for the bean method's transaction attribute? (2)
A. NotSupported
B. Supports
C. Required
D. RequiresNew
E. Mandatory

10) When designing a distributed system, remote access to fine-grained objects should be avoided. Why? (2)
A. Thinner clients are possible with coarse-grained objects.
B. Fine-grained objects result in increased network traffic.
C. Fine-grained objects are hard to develop and maintain.

11) Which of the following statements accurately describe the J2EE architecture? (3)
A. Web components provide presentation logic that works well with anonymous clients over the Internet.
B. EJBs provide business logic within the context of transactions and persistence.
C. Web components access EJBs through the same APIs as application clients.
D. Application servers provide the infrastructure for the J2EE architecture.

12) What steps does a J2EE developer need to use to get a reference to an existing EJB's home? (3)
A. Get a remote reference to the EJB home by using the JNDI Context lookup() method, passing the name of the EJB's home.
B. Use the RMIRegistry lookup() method to get a remote reference to the EJB home.
C. Cast the EJB home remote reference to the right type by using the PortableRemoteObject.narrow() static method, passing the remote reference and the class of the EJB home.
D. Cast the remote object reference to the right type within Java.

13) An stateful Session bean is to be created. Which of the following objects are necessary? (2)
A. A primary key.
B. A home interface.*
C. A bean class.
D. A passivation class.

14) A stateful Session bean is being passivated by its container. Assuming all fields are non-transient, which of the following values will still exist following passivation? (4)
A. null.
B. A JDBC Connection.
C. An Entity bean.
D. A SessionContext.
E. A UserTransaction.

15) Which of the following is true concerning the use of UserTransaction? (2)
A. Stateless Session beans must start and end a UserTransaction within one method, since they service multiple clients.
B. Stateful Session beans must start and end a UserTransaction within one method, since they service multiple clients.
C. A UserTransaction for stateless Session beans can span methods, since they service only one client.
D. A UserTransaction for stateful Session beans can span methods, since they service only one client.
16) JMS Message is composed of which of the following parts? (3)
A. Header
B. Properties
C. Body
D. Footer

17) Servlet counts the number of times it has been called using an incrementCount() method. During testing, the developer verifies that the servlet accurately counts the requests from a number of clients. Which of the following BEST explains this fact?
A. The web or application server supports activation and passivation of the servlet.
B. The HttpServlet class is designed to share state data across all its instances.
C. The same servlet instance services all the requests.
D. The servlet doGet( ) method has been marked as synchronized.

18) A Proxy design pattern is one where a surrogate or placeholder for an object is used to communicate with an object that is not locally available. Which of the following J2EE technologies use proxies that are visible to a developer? (2)
A. JNDI
B. RMI
C. JSP
D. EJB

19) Which one of the following statements describes the design that BEST leverages the J2EE architecture? (1)
A. Clients install Swing components on their system which interact via RMI with EJBs on the server, EJBs interact with backend services such as databases.
B. Clients view applets in web browsers, servlets service the client requests on the server and interact with backend services such as databases.
C. Clients view HTML in web browsers, JSP pages service the client requests and interact with EJBs on the server, EJBs interact with backend services such as databases.
D. Clients view HTML in web browsers, CGI scripts service the client requests on the server and interact with EJBs on the server, EJBs interact with backend services such as databases.

20) In what manner is a reference to an Entity Bean obtained by a client? (1)
A. Invoking the zero-argument public constructor of the bean.
B. Invoking the appropriate create() method of the home interface.
C. Invoking the newInstance() method of the home interface.
D. Invoking the newInstance() method of the bean class.

21) Deployment-specific information for an EJB is located in: (1)
A. the bean class's BeanInfo class.
B. the properties variable of the home interface.
C. an XML deployment descriptor.
D. the server's ejb.properties file.

22) Which of the following are TRUE regarding BMP Entity beans? (2)
A. Persistent fields can be declared private. B. The ejbFindByPrimaryKey() method returns void.
C. Finder methods are implemented at deployment time.
D. A record should be inserted into the database during ejbCreate().

23) Transaction isolation levels in EJBs are: (3)
A. set by the bean developer for bean-managed transactions.
B. set by the deployer for container-managed transactions.
C. specified to the method level.
D. specified to the class level only.

24) Which of the following implicit page objects are available for a JSP error page, that is, one with an "isErrorPage=true" page directive? (3)
A. application
B. throwable
C. exception
D. config

25) Which of the following MUST be declared for a CMP Entity Bean in its deployment descriptor? (3)
A. Bean class.
B. Database connection factory reference.
C. Home and remote interfaces.
D. Primary key class.
26) Whose responsibility is it for providing an implementation for the home interface of an EJB? (1)
A. The application assembler.
B. The bean developer.
C. The container and its tools
D. The bean deployer

27) Which of the following are TRUE with respect to state management in a web application? (2)
A. It is impossible to determine whether cookies have been enabled on a client browser.
B. URL Rewriting is an alternative to using cookies.
C. URL Rewriting does not require any client side configuration.
D. HttpSession information is available to JavaScript code in a web page.

Thanks in advance.
Sachin
Hi! Acton,
I am finding it pretty hard to prepare for WAS and WSAD topics. Plz advice on these topics. Other concern is 'Develop Clients that access the enterprise components'. Could u post ur score breakup?
bye.
Sachin
Hi! Daniel,
Would u advice me how and from where I shud study for WAS and WSAD specific topics? One topic which is a major concern is 'Develop clients that access the enterprise components'. Seek Some advice on this.
thanx in advance.
Sachin
Hi! All,
What are the sources for preparation of Weblogic 7.0 certification?
thanx in advance.
Sachin
Hi! All,
Where is this Book for SCEA available? I am in India. Any links.
bye
Sachin
Congrats!! Daniel,
You have passed the test with a very good score. Most people pass in sixties. I plan to take this test very soon.
2 topics which I am very much concerned abt are
a) Design and Build reusable enterprise components.
b) Develop the clients which that access the enterprise components.
I have read EJB specs 2.0 but the kind of questions they ask look pretty confusing.
Suggestions.
bye.
Sachin