
EC-CouncilCertified Application Security Engineer (Java)
Domain 7Objective 1
Secure Exception/Error Handling CASEJAVA Practice Questions (Page 4)
Part of the Secure Coding: Error Handling and Logging domain, which makes up ~11% of our current practice bank. EC-Council does not publish an official question count, but from its 120-minute exam (~50–80 total, ~6–9 in this domain), expect 3–5 from this objective — we provide 45 practice questions to prepare you well beyond it. (estimate)
45questions here
9free pages
6concepts
Questions 16–20
- 16
When an exception occurs in a Java web application, what should the user see?
Select an answer first - 17
A Java application logs exceptions using a logging library that writes to a file with permissions 644 (world-readable). The log file contains user IDs and exception messages that may include sensitive data. Which action is most important to secure the logs?
Select an answer first - 18
A Java method reads a file, processes it, and then deletes the file in a finally block. If an exception occurs during processing, the finally block deletes the file, but the exception is not logged. The developer wants to ensure the file is always deleted and the exception is logged. Which pattern is correct?
Select an answer first - 19
A Java application's exception handling code includes the following line: logger.error("Error processing request", e); where e is an exception that contains the user's session ID in its message. What is the best practice?
Select an answer first - 20
A Java method acquires a database connection and a file lock. If an exception occurs while processing, the method must release both resources. The developer writes a finally block that releases the file lock, but the database connection is not closed if the file lock release throws an exception. What is the most robust way to ensure both resources are released?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by EC-Council. “CASEJAVA” is a trademark of its owner, used for identification only.