Apress/pro-spring-5

Error in Chapter 3 - AnnotatedBeanNaming

daniel-rocha opened this issue · 2 comments

Without annotating Award with

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)

The AnnotatedBeanNaming class will fail with:

An exception occured while executing the Java class. Unexpected exception parsing XML document from class path resource [spring/app-context-annotated.xml]; nested exception is org.springframework.core.annotation.AnnotationConfigurationException: @AliasFor declaration on attribute 'name' in annotation [com.apress.prospring5.ch3.annotated.Trophy] declares an alias for attribute 'value' in meta-annotation [com.apress.prospring5.ch3.annotated.Award] which is not meta-present. -> [Help 1]

EXL commented

I also encountered this problem.

$ java -version
java version "1.8.0_202"

Spring version: 5.0.14.RELEASE

Can anyone explain why an exception is thrown without the proposed fixes by @daniel-rocha?

Hello,
Commit a859ee8 fixes the issue.

Sorry I did not have the time to look at this earlier.

Cheers,
Iuliana