Revision 3 came out at 49/63 (78%). You got 14/14 on the true-or-false block, but several of those same facts went wrong when they were options in a list. This page closes off #21: what's fixed, every rule on one screen, the last weak spots, and a final paper in new wording that covers the whole of #21.
| Round | Overall | New questions | Exact retries | True or false |
|---|---|---|---|---|
| Exam #21 | 41/60 (68%) | — | — | — |
| Review page drills | 41/66 (62%) | — | — | — |
| Revision 1 | 34/59 (58%) | 15/34 (44%) | 19/25 (76%) | — |
| Revision 2 | 43/62 (69%) | 23/37 (62%) | 20/25 (80%) | — |
| Revision 3 | 49/63 (78%) | 18/30 (60%) | 17/19 (89%) | 14/14 |
The pass mark is 76%, and revision 3 overall was 78%. But the column that predicts the real exam is "new questions", and it has stayed around 60%. So the knowledge is there, but it isn't yet reliable when the wording is new and there's a list of options.
@PostConstruct / @PreDestroy visibility. Missed on three exam papers, right on every question since revision 2.Environment. 0/4 on revision 2, then 4/4 and both retries right on revision 3.@MockBean. All three true facts ticked, three times on revision 3, after four rounds of stopping at two.@ImportAutoConfiguration. Right on both questions.On the same page, on the same day:
| Fact | As a true/false statement | As one option in a list |
|---|---|---|
| The circular-references property doesn't rescue a constructor cycle | ✓ "False" | ✗ ticked it as a fix, twice |
@ComponentScan filters don't remove auto-config | ✓ "False" | ✗ ticked it, for the 4th time |
exclude and excludeName take different types | ✓ "False, different types" | ✗ "None — they're aliases" |
| The before-init hook gets an object, not definitions | ✓ "False" | ✗ picked it as "the hook that gets definitions" |
@ContextConfiguration doesn't bring in auto-config | ✓ (retry) | ✗ ticked in a five-option list |
You don't need more facts for these. You need the 14/14 way of answering. On every "select all", read each option as a sentence on its own, "X is true", and give it a yes or no before you look at the next one. You've already shown that this works.
@PostConstruct runs here) → afterPropertiesSet() → initMethod → BPP after-init (proxies made here). Destroy: @PreDestroy → destroy() → destroyMethod.postProcessBeanFactory, gets the factory, edits definitions before beans exist (the …Configurer classes). BPP = two methods, each gets (Object bean, String name) (the …BeanPostProcessor classes).-javaagent + aop.xml.TransactionInterceptor. Programmatic = TransactionTemplate.@Autowired: one attribute (required). By type → @Qualifier → @Primary → field name → fail.@Component (@Configuration included). @Bean = name, initMethod, destroyMethod.@Lazy at an injection point fixes any cycle. The property is Boot-only and setter/field-only.@Lazy: class or @Bean = lazy bean; field or parameter = lazy proxy.Environment: every app = system properties + env vars + profiles. Web = the same + three (servlet config, servlet context, JNDI).SpringBootServletInitializer. Settings go under server.; timeouts are server.<server>.….exclude (class), excludeName (string), spring.autoconfigure.exclude (property). Class missing → strings only. Scan filters never.@EnableAutoConfiguration, @SpringBootApplication, @ImportAutoConfiguration.@MockBean: field or class; replace or add; separate cached contexts. @Mock = no context.@RequestParam, @PathVariable, @RequestBody, @RequestHeader, @CookieValue, @ModelAttribute. @RequestMapping / @ResponseBody aren't.Order: weak spots → split-it → retry → final paper last. Aim for 22/24 or better on the final paper; that's about the level the exam needs, with some margin. On every "select all", give each option a yes or no first.
| Drill block | Qs | Last | Best | Runs | Last done |
|---|---|---|---|---|---|
| Loading… | |||||
| You picked | What's true |
|---|---|
excludeName "fails to compile" when the jar is missing | The .class literal fails. A string is just text, and the compiler never resolves it |
| "they're aliases" | Class<?>[] vs String[]. Same effect only when the class is present |
| Scan filters can't remove auto-config because "auto-config runs before scanning" | It's the other way round: auto-config is processed after your own configuration. The scan filter fails because auto-config classes are imported from a list, never scanned |
@ComponentScan filter ticked (4th time); exclude and then the property left out | All three switches work when the class is present |
left out server.servlet.context-path | It's real — anything under server. that you've seen in the docs is |
Q1 Is it a scan filter? → never removes auto-config. Cross it out.
Q2 Does the question say the class/jar is MISSING?
no → exclude, excludeName and spring.autoconfigure.exclude all work
yes → only the strings: excludeName and the property (exclude = Foo.class won't compile)
Why "after" matters: Boot imports auto-config with a deferred import
selector, so it's processed after all your own @Configuration. That's what lets
@ConditionalOnMissingBean back off when you've defined your own bean. If auto-config ran first, it
couldn't see yours.
@Lazy on a class out againRead the property's name: allow-circular-references. The
references are the early references, the half-built objects that resolve setter/field cycles. The property
switches that mechanism back on. A constructor cycle can't use an early reference, because no object exists yet,
so switching it on changes nothing. You also left out "the property exists only in Boot", and it does: plain
Spring has no spring.main.* properties.
@Lazy @Service class Mailer is the original use of
@Lazy: the bean is created on first use, not at startup. You've now got the injection-point form
right, so don't lose the class form. All placements are valid.
@Lazy is valid everywhere."Block 4 left out the self-call. The retry left out the private method. Learn the three as a set: F-P-S, final method, private method, self-call. All three have a proxy, and the call slips past it. When you see a "silent" question, check all three letters.
afterPropertiesSet()You picked postProcessBeforeInitialization as "the hook that gets definitions". The
word "Before" probably made it sound early, as if it ran before the bean existed. But it's before
initialisation, not before creation. The only hook that sees definitions has BeanFactory in its
name. And afterPropertiesSet() is one of the initialisation steps, so it runs after the
before-hook.
postProcessBeanFactory."@ContextConfiguration · 1 missIf you pass it your @SpringBootApplication class, auto-config loads, because that
class's annotation brings it in. Pass it a plain config class and there's no auto-config. On "which bring in
auto-config", ask: would it do that on its own, given a plain class?
These are the options from your revision-3 misses, one at a time. This is the 14/14 way of answering, used on exactly the options that went wrong in a list. When an option appears in a list, give it the answer you give here.
The 14 you missed on revision 3, reshuffled.
24 questions covering every topic from the #21 paper and its revisions, none of them in a wording you've seen. Do it last, in one sitting, without the rules screen open. 22/24 or better means #21 is closed, and the next step is a fresh practice exam.