4

私は解決策を見つけようとしましたが、まだ運がありません。

「Pro Spring 3」(Apppress)[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 プロパティがありません。ここに画像の説明を入力

私は何が欠けていますか?

4

1 に答える 1

11

'packagesToScan'プロパティは Spring 3.1 で追加されました ( 3.03.1を比較してください)。

CLASSPATH に最新の 3.1 Spring JAR が含まれていることを確認してください。

于 2012-06-03T18:13:21.900 に答える