2017-03-13 27 views
-2

I次のエラーを持っている:例外は、コンテキストの初期化中に発生した - キャンセルリフレッシュしよう:org.springframework.beans.factoryを

にHomeController:

UnsatisfiedDependencyException: Error creating bean with name 'homeController': Unsatisfied dependency expressed through field 'productDao'

のSessionFactory:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Failed to introspect bean

エラーのスクリーンショット:http://prntscr.com/ejjtp5

+0

エラーメッセージとコード –

+0

の注釈を使用している場合は、ProductDaoクラスに@Componentというアノテーションが付いていることを確認してください。もしそうでなければ、Springはそのクラスについて知りませんし、依存関係を解決できませんProductDao productDao – jmw5598

+0

@Componentアノテーションを試してみました。 最初の部分のapplicationContext.xmlクラスのスクリーンショットです:http://prntscr.com/ejk4v3 –

答えて

0

アプリケーションコンテキストファイル内に、そのdaoクラスを使用してBeanオブジェクトを登録する必要があります。 ここで 'p'はHomeControllerのProductDAOのオブジェクトです

+0

関連する問題