我正在尝试使用Spring Data Rest构建Rest Api,之后多次更改我的pom.xml以找到与我的项目兼容的依赖项,我现在遇到了这个问题:
java.lang.AbstractMethodError: org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepository(Lorg/springframework/data/repository/core/RepositoryInformation;)Ljava/lang/Object;
Run Code Online (Sandbox Code Playgroud)
很久以前 ...
我有一个Java Config Web App,我的JPAConfig有这些注释
@Configuration
//@EnableJpaRepositories("com.protect.inf.jpa.repositories")
@EnableJpaRepositories
@EnableTransactionManagement
public class JPAConfig { ... }
Run Code Online (Sandbox Code Playgroud)
请参阅@EnableJpaRepositories注释,如果我没有将包名设置为我的Repositories类,则应用程序启动正常,但是当我向api发出请求时,响应如下所示:
{
_links: {
profile: {
href: "http://localhost:8080/protect-inf-01/api/profile"
}-
}-
}
Run Code Online (Sandbox Code Playgroud)
它没有暴露我的Repos网址.我的Repos类看起来像这样
@RestResource(path = "users", rel = "users")
public interface UsuariosRepository extends PagingAndSortingRepository<Usuarios, Integer>{
Usuarios findByEmail(String email);
}
Run Code Online (Sandbox Code Playgroud)
然后 ...
当我将包名称设置为@EnableRepositories注释时@EnableJpaRepositories("com.protect.inf.jpa.repositories"),应用程序启动失败,并显示以下错误:
Error creating bean with name 'cuentasRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepository(Lorg/springframework/data/repository/core/RepositoryInformation;)Ljava/lang/Object;
Run Code Online (Sandbox Code Playgroud)
我认为这是我Maven中的依赖问题,我不太确定.这是我的pom.xm
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 …Run Code Online (Sandbox Code Playgroud)