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