Olete.in
Articles
Mock Tests
🧪 EJB MCQ Quiz Hub
EJB MCQ - Java Technologies
Choose a topic to test your knowledge and improve your EJB skills
1. Which of the following statements is not correct for an Enterprise Java Bean?
Entity beans model business data
Session beans model business processes
Message beans send synchronous messages
None of the above <br>
2. Where are the EJB classes utilized by applications retained?
Within the javax.ejb package.
Within the javax.ejb package.
Within the Javascript package.
Within the rava.xml package.
3. The _______ is the most common exception class.
EJBException
BeanException
NullPointerException
RuntimeException
4. The _______ is the most common exception class.
EJBException
BeanException
NullPointerException
RuntimeException
5. The _______ file is an XML file used to describe the properties of a bean.
Application archive
Bean JAR✖
Deployment Descriptor
XML Property
6. ______ is not a tag used in an XML bean archive to define a primitive type.
<byte>
<int>
<double>
<object>
7. How many types of enterprise bean in java?
2
3
4
None of the above
8. ________ encapsulates business logic.
Message Driven Bean
Entity Bean
Object Bean
Session Bean
9. How many types of session bean?
1
2
3
4
10. A Stateless session bean is a business object that doesn't maintain the conversational state with the client.
TRUE
FALSE
Can be true or false
Can not say
11. ______ is a messaging service to create, send and receive messages asynchronously.
RMS
JMS
GDS
KAD
12. What are the advantages of JMS?
Asynchronous
Reliable
Both A and B
None of the above
13. In ___________, one message is delivered to one receiver only.
CTP Model
ATP Model
ZTP Model
PTP Model
14. In which model, one message is delivered to all subscribers?
Publisher model
Subscriber model
Both A and B
None of the above
15. Message Driven Bean (MDB) encapsulates business logic. It is invoked by passing the message. It is like JMS receiver.
RUE
FALSE
Can be true or false
Can not say
16. Which of the following annotation is used to specify or inject a dependency as ejb instance into another ejb?
javax.ejb.Stateless
javax.ejb.Stateful
javax.ejb.MessageDrivenBean
javax.ejb.EJB
17. The EJB specification architecture does NOT define
transactional components
client side security and encryption
distributed object components
server-side components
18. Which of the following is true?
Preserving of any state across method calls does not performed by Stateless session beans
Multiple users can access Stateful session beans at the same time
Both are correct
None
19. . Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?
Transaction support
Persistence support
Naming support
All mentioned above
20. Which statement about session beans is true?
In both stateless and statefull session classes, the bean provider must write the method public void remove()
The method << remove >> in the component interface can be accessed only by the remote clients
The bean's handle must be provided by the client, in order to ask the EJBHome for removing a session bean
None of the above
21. Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?
Bean-managed transactions
Container-managed transactions
Both A & B
None of the above
22. The Spring support classes facilitate building session beans
stateful session beans (SFSBs)
stateless session beans (SLSBs)
message-driven beans (MDBs)
All of the mentioned
23. . What happens when you pass a serialized object as an argument or return value that doesn't exist either in the Client or the Server?
Nothing will happpen
An error will occur
A run time exception is produced
None of these
24. An different programming language like C ,C++ etc.
1,2
1
2
None of the above
25. Abbreviate the term JMS?
Java Message Service
Java Monitor Service
Java Message Session
Java Monitor Session
26. Session beans don't have
ejbCreate() method
ejbStore() method
ejbRemove() method
None
27. An entity bean's local interface MUST extend the ________ interface.
javax.ejb.EJBLocalObject
javax.ejb.EJBObject
javax.ejb.RemoteObject
None of the above
28. Which component does the Entity bean represent the persistent data stored in the database?
Server-side component
Client-side component
Server and client side component
None of the above
29. Which server-side component is required to be deployed on the server?
EJB
RMI
Both A & B
None of the above
30. To expose a service through RMI, you have to create the service interface that extends
java.rmi.Remote
. java.rmi.RemoteException
All of the mentioned
None of the above
31. OpenEJB 3.1.1 supports
EJB 2.x components
EJB 3.0 and EJB 3.1 components
All of the mentioned
None of the mentioned
32. From the following APIs, which API does NOT guarantees to be supported by EJB 2.0 containers?
JAXP
JNDI
JXTA
JDBC
33. What is returned by the method ejbCreate() CMP bean?
Null
Primary Key class
Home Object
Remote Object
34. What executes EJB components?
A web server
An application server
An EJB container
A database server
35. How can a EJB pass it's reference to another EJB ? Which of the following is correct syntax for an Abstract class?
abstract double area() { }
abstract double area()
abstract double area();
abstract double area(); { }
36. Choose different kinds of enterprise beans in EJB from following
Session beans
Entity beans
Message-driven beans
All of the above
37. At what point, precisely, in the life-cycle is a container-managed entity bean considered created?
Immediately prior to the execution of its ejbCreate() method
Immediately after the execution of its ejbCreate() method
After the CMP bean's data has been committed to the underlying persistent datastore
During the execution of its ejbPostCreate() method
38. Which middleware services are provided by EJB?
Security
Transaction Management
Both A & B
None of the above
39. For remote objects Java passes objects:
By reference
By object copy
By producing a serialized copy
B and C are correct
40. remove() method of the Entity bean?
Remove the row of table from the database
Remove the instance from pool
Delete the TABLE from the database
None of the above
41. The _______ file is an XML file used to describe the properties of a bean.
Application archive
Bean JAR
Deployment Descriptor
XML Property
42. EJB applications are deployed on a ____ compliant Application Server.
IEEE
J2EE
OSHA
SERI
43. What is RMI-IIOP?
The Java Remote Operation Schedule.
Java Remote Method Invocation interface.
The Java Open Access Module.
The Java Express Services Daemon.
44. What format is the deployment descriptor document in?
XML
doc
html
PDF
45. What file format are all of the descriptor files in?
txt
HTML
PDF
XML
46. EJB is a framework for _____
Java
C++
sap
windows
47. If you wanted to control the WebLogic Server EJB’s configuration, what is one of the files you would use?
ejk.xml
erb-jub.xml
erp.txt
ejb-jar.xml
48. What is another name for a deployment descriptor?
Caching between transactions.
Processing dual beans.
Processing dual-state beans.
Caching entire programs.
49. What is concurrency control?
The control of a single operation in two different ways.
The control of single operations in different ways.
The control of a single operation in many different ways.
The ensuring that two operations within EJB are generated correctly.
50. What is concurrency control?
The control of a single operation in two different ways.
The control of single operations in different ways.
The control of a single operation in many different ways.
The ensuring that two operations within EJB are generated correctly.
51. What is CMC?
Container-managed concurrency.
Currently Managed Content
Counter-managed contingency.
Concurrent-managed content.
52. In passivation, the opposite method from ejbPassivate() is _______.
ejbLoad()
ejbNew()
ejbActivate()
ejbCreate()
53. In passivation, the opposite method from ejbPassivate() is _______.
ejbLoad()
ejbNew()
ejbActivate()
ejbCreate()
54. Which of the following contains the EJB container that provides the services for the EJB component?
Component client.
EJB client.
EJB Server
Java client.
55. What are ACID transactions responsible for?
Reliable database transactions.
Mobile-to-website interfacing.
Customer relations.
Data to processor interfacing.
56. When injection is not available, what is the alternative?
Nothing is available
Bean interface.
Java interface.
Java Naming and Directory Interface
57. What does it mean when business objects have a state?
They have many clients.
They have no clients.
They have only two clients.
They are limited to a single client at a time
58. What bean represents real-world objects?
Entity bean.
Sessionless Bean.
Stateful Bean.
Singleton Session Bean.
59. A class is serializable if a class's inheritance hierarchy implements _________.
Serializable and Externalizable
Serializable or Externalizable
Event and Listener
Persistence
60. Do clients of EJB instantiate beans directly?
Yes.
No. They need a reference from the EJB container.
No. They need a reference from the Java container.
Yes, and they act immediately.
Submit