SSブログ

実行時例外 (org.springframework.beans.factory.BeanCreationException) [開発]

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\workspace\MyBatis\src\main\webapp\WEB-INF\applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
・・・
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
・・・

MyBatis のサンプルアプリ (MyBatis のサンプルを作ってみる) を作成していたら上記のようなエラーに遭遇しました。このエラーの主な原因としては、クラスパスに spring-jdbc-xxx.jar が無かったためのようです。Maven で下記依存を追加することで解決しました。備忘録として残します。
groupId:org.springframework
artifactId:spring-jdbc
version:4.0.6.RELEASE

nice!(0)  コメント(0) 
共通テーマ:blog

nice! 0

コメント 0

コメントを書く

お名前:[必須]
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。