我试图找到解决方案,但仍然没有运气。
我正在关注这本书"Pro Spring 3"(Appress)[第351页]
我已将项目生成为jpa项目。
据我所知,我可以使用persistence.xml
或者可以在bean内部管理它,这就是我想要的。
最新我们需要定义packagesToScan
属性。
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?
当我尝试寻求建议(ctrl + space)时,它没有packagesToScan属性。
我错过了什么?