Red Hat Certified Specialist in Enterprise Application Development (RHCEAD) Exam Prep
Free practice questions

Free RHCEAD Practice Questions

10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.

Start the free practice test → ★★★★★4.9/5 from 2,400+ candidates · No signup

These 10 free RHCEAD questions are organized by exam domain, so you can see how each part of the Red Hat Certified Specialist in Enterprise Application Development (RHCEAD) blueprint is tested. Reveal the answer and explanation under each question.

Domain 1: Bean validation

Question 1

A shipping form requires an address and a postal code. Its Bean Validation 1.1 model is: class ShippingRequest { @NotNull Address address; } class Address { @NotNull String postalCode; } A test sets request.address to a new Address whose postalCode is null. The configured Validator returns an empty violation set from validator.validate(request). No custom validation groups or XML overrides are used. The form must still reject a null address as well as an address with a null postal code. The missing declaration is:

Show answer & explanation

Correct answer: B - Add @Valid to ShippingRequest.address, retaining its existing @NotNull annotation.

Domain 2: JPA mapping

Question 2

A ticket is being transferred between two existing projects. The relevant JPA 2.1 mappings use field access: Project.tickets: @OneToMany(mappedBy = "project") private List<Ticket> tickets; Ticket.project: @ManyToOne @JoinColumn(name = "project_id") private Project project; The ticket and both projects are managed in the same active transaction, and both collections are initialized. A helper has already removed the ticket from the old project's collection and added it to the target project's collection. What still needs to happen so the foreign key and the Java object graph agree?

Show answer & explanation

Correct answer: C - Call ticket.setProject(target) to update the owning side of the relationship.

Question 3

A performance trace covers a JPQL query returning 16 Parcel entities, each associated with a different Depot through @ManyToOne(fetch = FetchType.EAGER). The trace shows one SELECT for the parcels, followed by one SELECT for each depot. Every depot is fully loaded before the service returns. There is no batching, cache hit, or other database work. A reviewer says this trace proves that the provider ignored EAGER. Which assessment correctly combines the statement count with the JPA fetching contract?

Show answer & explanation

Correct answer: B - Seventeen statements can satisfy EAGER because eager loading does not require one SQL join.

Question 4

Inside an active JTA transaction, a service receives a detached Parcel representing an existing database row. Its status is READY and its note is standard. Both are persistent basic attributes. The service executes: Parcel managed = em.merge(detached); detached.setStatus("CANCELLED"); managed.setNote("fragile"); There are no callbacks, concurrent writers, further merges, or other changes. The transaction commits successfully. What values are stored in that row?

Show answer & explanation

Correct answer: C - Status READY; note fragile.

Domain 4: Messaging

Question 5

Each order-dispatched event must reach both the billing application and the audit application. Either application may disconnect for maintenance and must receive its missed events after reconnecting. The producer will send each event once to one JMS destination. Both applications establish their subscriptions before publication, keep stable subscription identities, and reconnect before any message expires. Choose the arrangement that provides both independent delivery and retention during disconnection.

Show answer & explanation

Correct answer: D - One topic with a separate durable subscription for each application.

Question 6

A JMS message-driven bean uses container-managed transactions with REQUIRED. It calls an injected stateless InventoryService, also REQUIRED, to reserve stock. Message consumption and database work participate in the same JTA transaction. When stock data is temporarily unavailable, the service throws a checked InventoryUnavailableException annotated @ApplicationException(rollback = false). The MDB catches it, logs it, and returns normally. Nothing marks the transaction rollback-only. The message is acknowledged even though no reservation was made. The broker permits redelivery after rollback. What correction keeps a failed reservation from being acknowledged as successful work?

Show answer & explanation

Correct answer: D - Call setRollbackOnly() on the MDB's MessageDrivenContext in the exception handler.

Domain 5: REST services with JAX-RS

Question 7

An integration test submits valid JSON to a JAX-RS 2.0 resource: @Path("/quotes") public class QuoteResource { @POST @Consumes("application/json") @Produces("application/json") public Quote create(Quote input) { return input; } } The request reaches /quotes with Content-Type: application/json and Accept: application/xml. A JSON reader and writer for Quote are installed. There are no other resource methods, filters, or exception mappers. The create method is never entered. Identify the response and the mismatch responsible.

Show answer & explanation

Correct answer: A - 406 Not Acceptable: the client requests a response representation the method does not produce.

Question 8

An API deletes an existing document with DELETE /documents/73 and returns 204. The connection drops before the client receives that response, so the client sends the identical DELETE again. No one has recreated the document. The documented API policy returns 404 when the target is absent, and the second call does so. A defect report labels the endpoint non-idempotent because the response codes differ. How should that report be resolved?

Show answer & explanation

Correct answer: A - Close that finding: both requests leave the document absent, so the differing responses do not break idempotency.

Domain 6: Security

Question 9

A stateless EJB has these security annotations: @Stateless @RolesAllowed("catalog-reader") public class CatalogService { public void view() { } @RolesAllowed("catalog-editor") public void revise() { } } EJB role enforcement is enabled. JAAS authentication succeeds for a user whose only effective application role is catalog-editor. Calls enter through the container-managed EJB reference; no deployment descriptor overrides the annotations. For this caller, which invocation result is correct?

Show answer & explanation

Correct answer: D - revise is allowed but view is denied; the method annotation replaces the class rule for revise.

Domain 7: CDI

Question 10

During a CDI code review, an engineer proposes rejecting this injection because ReportFormatter lives longer than RequestDetails: @ApplicationScoped public class ReportFormatter { @Inject private RequestDetails details; public String label() { return details.getRequestId(); } } RequestDetails is a proxyable @RequestScoped bean. Its request ID is initialized for each HTTP request. label() is called only while that request context is active, and ReportFormatter does not cache the returned value. Is the proposed rejection justified?

Show answer & explanation

Correct answer: A - No. The client proxy selects RequestDetails for the current request, not for its owner's lifetime.

The rest of the RHCEAD blueprint

The RHCEAD exam also covers these domains. Drill them in the full free practice test:

That's 10 of 1,030

The full bank has 1,020 more RHCEAD questions with explanations.

Continue in the free practice test →

View plans