현재 Spring과 Mongo DB를 사용하여 작은 웹 어플리케이션을 작성 중입니다. 내 문제는 REST에 ID를 표시하는 것입니다. 시작 응용 프로그램 예외가 나타납니다Spring 데이터 Mongo DB 틀린 REST 설정
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
import pl.rakoczy.taskmanager.model.Task;
@Configuration
public class RepositoryConfig extends
RepositoryRestMvcConfiguration {
@Override
protected void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config) {
config.exposeIdsFor(Task.class);
}
}
후 : 나는이 솔루션을 발견 나는 Gradle을 구성에서 약간의 종속성을 업데이트 할 해결책을 발견
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryExporterHandlerAdapter' defined in class path resource [pl/rakoczy/taskmanager/repository/RepositoryConfig.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.data.util.ClassTypeInformation.from(Ljava/lang/Class;)Lorg/springframework/data/util/TypeInformation;
을,하지만 난 최신 버전이 어떻게 생각 :
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
compile group: 'org.springframework', name: 'spring-context', version: '4.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-core', version: '4.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '4.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-web', version: '4.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-expression', version: '4.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-asm', version: '3.1.4.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '1.4.0.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.4.0.RELEASE'
compile group: 'org.springframework.data', name: 'spring-data-mongodb', version: '1.9.2.RELEASE'
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.10.2.RELEASE'
compile group: 'org.springframework.data', name: 'spring-data-rest-webmvc', version: '2.0.0.RELEASE'
compile group: 'org.springframework.hateoas', name: 'spring-hateoas', version: '0.16.0.RELEASE'
compile group: 'org.tinylog', name: 'tinylog', version: '1.1'
compile group: 'javax.inject', name: 'javax.inject', version: '1'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.3.0'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.9'
compile group: 'cglib', name: 'cglib-nodep', version: '3.2.4'
testCompile 'junit:junit:4.12'
testCompile 'com.jayway.jsonpath:json-path'
testCompile 'org.springframework.boot:spring-boot-starter-test'
을
}
저는 봄에 새로운데, 어떤 문제가 생길 수 있습니까?