2016-07-13 6 views
0

私はspring-data-couchbase 2.1.2を使用しています。メソッドを1つのリポジトリに追加します。実装クラスで :spring-dataリポジトリのメソッドを再定義する

public class MyRepositoryImpl implements MyRepositoryCustom { 

    @Autowired 
    RepositoryOperationsMapping templateProvider; 
.... 
} 

Iを添加RepositoryOperationsMappingが、オブジェクトが注入されていない、私は下にエラー:私はXMLファイルに追加する方法、spring.xmlファイルを使用するSpring構成について

[org.springframework.data.couchbase.repository.config.RepositoryOperationsMapping]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException 

RepositoryOperationsMappingのリファレンス?

ありがとうございました。さようなら。

+0

はあなたが使用している春データのCouchbaseのバージョンを追加してくださいもらえますか?スニペットの下に、問題を解決しましたか –

+0

バージョンは2.1.2です –

答えて

0

私は私のspring.xmlファイル

<couchbase:clusterInfo login="${cluster.username}" password="${cluster.password}" id="clusterInfo" /> 

    <couchbase:bucket bucketName="${bucket.name}" bucketPassword="${bucket.password}" id="bucket"/> 

    <!-- template is just using default parameters and references as well --> 
    <couchbase:template translation-service-ref="myCustomTranslationService" /> 
    <bean id="myCustomTranslationService" 
    class="org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService"/> 



    <bean id="couchbaseTemplate" class="org.springframework.data.couchbase.core.CouchbaseTemplate"> 
     <constructor-arg ref="clusterInfo"/> 
     <constructor-arg ref="bucket" /> 
     <constructor-arg ref="myCustomTranslationService" /> 
    </bean> 

    <bean id="repositoryOperationsMapping" class="org.springframework.data.couchbase.repository.config.RepositoryOperationsMapping"> 
    <constructor-arg ref="couchbaseTemplate"/> 
    </bean> 
関連する問題