The condition can't be put in places where the JVM may have loaded the class and look at method definitions.

A typical use case is a @Bean method that returns something and that something may not be on the classpath. Using the condition on the method will be useless as the JVM will load the class before the condition kicks in.

It would be nice to update both the ref guide and the javadoc.

Comment From: bondolo

The documentation update wasn't nearly specific enough to be useful. This is still a painful problem to discover and diagnose. Can a clarification of "Extra care" be provided similar to the solution described in the doc?

Comment From: philwebb

@bondolo I've opened #32166 and pushed this update. Feel free to comment on #32166 if you think further updates are needed.