2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spring Data JPA 環境構築時のエラー

Last updated at Posted at 2014-06-01

Springプロジェクトでデータアクセス用にSpring Data JPAを使おうとしてつまづきました。

リポジトリのbase-packageを以下のように設定するとエラーが発生してしまいました。
以下、xmlファイルとエラーメッセージ。

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

--- 省略 ---

    <jpa:repositories base-package="jp.co.xxx" />

--- 省略 ---

エラーメッセージ
AnnotationConfigUtils.processCommonDefinitionAnnotations(…) is not public! Make sure you're using Spring 3.2.5 or better. The class was loaded from file:/Applications/
 eclipse/plugins/org.springframework.context_4.0.0.20130829-M3.jar.: 
 org.springframework.context.annotation.AnnotationConfigUtils.processCommonDefinitionAnnotations(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition)

Springのバージョンは4以上なんですけど。うーん...

どうやらSTS(Spring Tool Suite)のバージョンが古いのが問題なようで、アップデートしてみると無事解決しました!

以下に似たようなエラーが出ている人がいたので参考にさせていただきました
http://stackoverflow.com/questions/22111780/problems-compiling-spring-data-mongodb-repository-definition

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?