Uploaded image for project: 'Spring Data Couchbase'
  1. Spring Data Couchbase
  2. DATACOUCH-126

@EnableCouchbaseRespositories does not implement the `repositoryBaseClass` attribute

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.4 M1 (Gosling)
    • Fix Version/s: 1.4 M1 (Gosling)
    • Component/s: Repositories
    • Labels:
      None

      Description

      When using `spring-data-couchbase` 1.4.0.BUILD-SNAPSHOT with `spring-data-commons` 1.11.0.BUILD-SNAPSHOT, an assertion failure occurs when trying to access the repositoryBaseClass.

      -------------

      pom.xml
              ..
              <!-- Spring Data, Couchbase -->
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-couchbase</artifactId>
                  <version>1.4.0.BUILD-SNAPSHOT</version>
                  <exclusions>
                      <exclusion>
                          <groupId>org.springframework.data</groupId>
                          <artifactId>spring-data-commons</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-commons</artifactId>
                  <version>1.11.0.BUILD-SNAPSHOT</version>
              </dependency>
      
      ...
      
      CouchbaseConfiguration.groovy
      @Configuration
      @EnableConfigurationProperties
      @ConfigurationProperties(prefix = "couchbase")
      @EnableCouchbaseRepositories
      class CouchbaseConfiguration extends AbstractCouchbaseConfiguration {
      
          List<String> hosts
      
          String bucketName
          String bucketPassword
      
          @Override
          protected List<String> bootstrapHosts() {
              return hosts
          }
      }
      

      ----------------

      On bootstrapping the application, The following exception occurs:

      [WARNING] 
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalArgumentException: Attribute 'repositoryBaseClass' not found
      	at org.springframework.util.Assert.notNull(Assert.java:112)
      	at org.springframework.core.annotation.AnnotationAttributes.doGet(AnnotationAttributes.java:108)
      	at org.springframework.core.annotation.AnnotationAttributes.getClass(AnnotationAttributes.java:89)
      	at org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.getRepositoryBaseClassName(AnnotationRepositoryConfigurationSource.java:224)
      	at org.springframework.data.repository.config.DefaultRepositoryConfiguration.getRepositoryBaseClassName(DefaultRepositoryConfiguration.java:159)
      	at org.springframework.data.repository.config.RepositoryBeanDefinitionBuilder.build(RepositoryBeanDefinitionBuilder.java:94)
      	at org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn(RepositoryConfigurationDelegate.java:128)
      	at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:83)
      	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:353)
      	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:151)
      	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:124)
      	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:318)
      	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
      	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
      	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
      	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
      
      ...
      

        Attachments

          Activity

            People

            Assignee:
            daschl Michael Nitschinger
            Reporter:
            ajbrown A.J. Brown
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: