I was trying to change over from using a Hibernate mappings file to annotations, but my test kept blowing up while instantiating the Spring beans.
Then I realized that in my Spring bean file, my sessionFactory bean was declared as an
org.springframework.orm.hibernate3.LocalSessionFactoryBean instead of an
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean. The annotatedClasses property I was trying to set didn’t exist in the LocalSessionFactoryBean!
I had been focusing on how to specify the list of annotated classes (see this example in the Spring Javadoc) and hadn’t paid attention to what kind of SessionFactory bean I was working with.