【发布时间】:2019-11-13 05:28:34
【问题描述】:
@RepositoryRestResource(path = "/region", collectionResourceRel = "list", excerptProjection = CustomRegion.class)
public interface RegionRepository extends JpaRepository<Region, Integer> {
}
数据休息类
@SpringBootApplication
public class ProfUzApplication {
public static void main(String[] args) {
SpringApplication.run(ProfUzApplication.class, args);
}
}
主运行类
发生的错误
org.springframework.beans.factory.UnsatisfiedDependencyException:在 URL [jar:file:/C:/Users/saidk/.m2/repository/org/springframework/data/spring- 中定义名称为“repositorySearchController”的 bean 创建错误data-rest-webmvc/3.2.1.RELEASE/spring-data-rest-webmvc-3.2.1.RELEASE.jar!/org/springframework/data/rest/webmvc/RepositorySearchController.class]:通过构造函数参数表示的不满足的依赖关系1个;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在类路径资源 [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] 中定义名称为“entityLinks”的 bean 创建时出错:通过工厂方法进行 Bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.data.rest.webmvc.support.RepositoryEntityLinks]:工厂方法 'entityLinks' 抛出异常;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建类路径资源 [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] 中定义的名称为“resourceMappings”的 bean 时出错:通过工厂方法进行 Bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.data.rest.core.mapping.RepositoryResourceMappings]:工厂方法“resourceMappings”抛出异常;嵌套异常是 java.lang.IllegalStateException:为 uz.pdp.prof.repository.RegionRepository 配置的路径/区域必须只包含一个路径段!
【问题讨论】:
标签: java spring hibernate spring-boot spring-data-rest