Spring数据jpa是否与spring-core版本3完全兼容?我使用JPA存储库时遇到问题。
我使用spring-data-jpa版本1.6.0和spring-core 3.1.0版本。
当我在配置类中使用@EnableJpaRepositories时出现以下错误。
Exception in thread "main" java.lang.IllegalArgumentException: ResourceLoader must not be null!
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:65)
at org.springframework.context.annotation.ConfigurationClassParser.processImport(ConfigurationClassParser.java:295)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:208)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:138)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:126)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:233)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:178)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73)
答案 0 :(得分:3)
Spring Data JPA 1.6.0由于api的变化至少需要spring 3.2。