Invalid property 'packagesToScan' of bean class [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]
configuration, package, spring, spring-data-jpa, spring-orm
Solution
`'packagesToScan'` property was added in Spring 3.1 (compare 3.0 and 3.1).
Make sure you are including the newest 3.1 Spring JARs in your CLASSPATH.
Problem
I have tried to find the solution, but still no luck. I am following the book "Pro Spring 3" (Appress) [page 351] I have generated the project as jpa project. As far as I understand I can either use `persistence.xml` or can manage it internally in the bean, which is what I want. For the latest we need to define `packagesToScan` property. ``` Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaPersonService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emf' defined in class path resource [META-INF/app-context.xml]: Error setting property values; nested exception is **org.springframework.beans.NotWritablePropertyException: Invalid property 'packagesToScan' of bean class [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Bean property 'packagesToScan' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? ``` When I try to ask for suggestions (ctrl+space) , it does not have packagesToScan property. What am I missing?