私は問題があります。私はSpring4を使用しています.SpringデータのCouchbaseを使用できるように構成を追加したいのですが、エラーがあります:
org.springframework.beans.factory.BeanDefinitionStoreException: 候補コンポーネント クラスの読み取りに失敗しました: ファイル [/home/charlie/Desktop/Ultimate Projects/novare_dashboard/novare-project-dashboard/target/classes/hk/com/novare/dashboard/configuration /CouchbaseConfig.class]; ネストされた例外は java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories.repositoryBaseClass() at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents です(ClassPathScanningCandidateComponentProvider.java:303)
これが私のコードです:
CouchbaseConfig.java
@Configuration
@EnableCouchbaseRepositories
public class CouchbaseConfig extends AbstractCouchbaseConfiguration{
@Override
protected List<String> bootstrapHosts() {
return Collections.singletonList("localhost");
}
@Override
protected String getBucketName() {
return "crud";
}
@Override
protected String getBucketPassword() {
return "password";
}}
WebMvcConfig.java
@Configuration
@EnableWebMvc
@ComponentScan(basePackageClasses = Application.class)
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
@Bean
public InternalResourceViewResolver jspViewResolver() {
InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setPrefix("/WEB-INF/views/");
bean.setSuffix(".jsp");
return bean;
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("/WEB-INF/static/");
}}
POM.XML
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--H2-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!--couchbase-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-couchbase</artifactId>
<version>1.4.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.couchbase.client</groupId>
<artifactId>couchbase-client</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.0</version>
</dependency>
<!--JSON-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>