Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@EnableCouchbaseRespositories does not implement the repositoryBaseClass attribute [DATACOUCH-126] #439

Closed
spring-projects-issues opened this issue May 15, 2015 · 5 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 15, 2015

A.J. Brown opened DATACOUCH-126 and commented

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.


        ..
        <!-- 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>

...
@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)

...

Affects: 1.4 M1 (Gosling)

Referenced from: pull request #39, and commits 572e48b

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 15, 2015

A.J. Brown commented

Just as an asside, we're using the snapshot version of spring-data-couchbase because we're using spring-data-keyvalue for our integration tests (instead of couchbase). spring-data-keyvalue requires spring-data-commons 1.11.0. couchbase 1.4 has spring-data-commons 1.11 as a dependency

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 15, 2015

A.J. Brown commented

Pull request submitted: #39

I have not yet confirmed that this fixes all configuration issues with commons 1.11.0, but this at least addresses everything in this ticket

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 16, 2015

Michael Nitschinger commented

merged, thank you very much for the contribution!

I had to fix another small thing to make the tests pass and amended your commit

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 27, 2015

Nikolay Gorylenko commented

hi,

i'm afraid the same applies to org.springframework.data.jpa.repository.config.EnableJpaRepositories

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 27, 2015

Nikolay Gorylenko commented

@daschl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants