Добрый день, я пытаюсь сгенерировать службу Rest с java весенней загрузкой, но при попытке выполнить jar я получаю следующую ошибку, которая вызывает головную боль, и я не знаю, что именно:
java .lang.NoSuchMethodError: org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource. (Lorg / springframework / core / type / AnnotationMetadata; Ljava / spring / langf; core / io / ResourceLoader; Lorg / springframework / core / env / Environment;) V at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport $ 1. (AbstractRepositoryConfigurationSourceSupport. java: 67). data.AbstractRepositoryConfigurationSourceSupport.getConfigurationSource (AbstractRepositoryConfigurationSourceSupport. java: 66) по адресу org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.registerBeanDefinu 8) в org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions (ImportBeanDefinitionRegistrar. java: 86) в org.springframework.context.annotation.Configuration * .util.LinkedHashMap.forEach (. LinkedHashMap * * тысяча пятьдесят-семь: 684) в org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars (ConfigurationClassBeanDefinitionReader java:. 384) при org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass ( ConfigurationClassBeanDefinitionReader. java: 148) по адресу org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions (ConfigurationClassBeanDefinitionReader. java: 120) по адресу org.springfraostefanConvice.Conf_Conf_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Confid_Exject_Conf { sor. java: 331) по адресу org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry (ConfigurationClassPostProcessor. java: 236) по адресу org.springframework.context.support.PostProcesseeReGateRegateReGate по адресу org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors (PostProcessorRegistrationDelegate. java: 95) по адресу org.springframework.context.support.AbstractAppory. , .refre sh (SpringApplication. java: 752) в org.springframework.boot.SpringApplication.doR un (SpringApplication. java: 347) в org.springframework.boot.SpringApplication.run (SpringApplication. java: 295) в org.springframework.boot.SpringApplication.run (SpringApplication. java: 1112) в org .springframework.boot.SpringApplication.run (SpringApplication. java: 1101) в com.example.consulta.SpringBootSoapApp.main (SpringBootSoapApp. java: 12) в sun.reflect.NativeMethodAccessor .reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl. java: 62) в sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl. java: 43) в java. : 498) в org.springframework.boot.devtools.restart.RestartLauncher.run (RestartLauncher. java: 49)
java .lang.NoSuchFieldException: findAnnotationCache в java .lang.Class. getDeclaredField (Class. java: 2070) в org.springframework.boot.devtools.restart.Restarter.clear (Restarter. java: 376) в org.springframework.boot.devtools.restart.Restarter.cleanupKnownCaches (перезапуск. java: 361) в org.springframework.boot.devtools.restart.Restarter.cleanupCaches (Restarter. java: 348) в org.springframework.boot.devtools.restart.Restarter.access $ 000 (перезагрузка. java : 81) на org.springframework.boot.devtools.restart.Restarter $ 1.call (Restarter. java: 170) на org.springframework.boot.devtools.restart.Restarter $ 1.call (Restarter. java: 165 ) в org.springframework.boot.devtools.restart.Restarter $ LeakSafeThread.run (Restarter. java: 602)
Приложение мой код
package com.example.consulta;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
main.class
@SpringBootApplication
public class SpringBootSoapApp {
public static void main(String[] args) {
SpringApplication.run(SpringBootSoapApp.class, args);
}
}
Контроллер
package com.example.consulta.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import com.example.consulta.entity.Cliente;
import com.example.consulta.service.ClienteService;
@RestController
public class ClienteController {
@Autowired
private ClienteService clienteService;
@GetMapping("/allCliente")
public List<Cliente> listarCliente(){
return clienteService.findAll();
}
@GetMapping("/cliente/{cedula}")
public Cliente detalleCliente(@PathVariable int cedula) {
return clienteService.findById(cedula);
}
}
DAO
package com.example.consulta.DAO;
import org.springframework.data.repository.CrudRepository;
import com.example.consulta.entity.Cliente;
public interface ClienteDAO extends CrudRepository<Cliente, Integer>{
}
Сущность
package com.example.consulta.entity;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="Cliente")
public class Cliente {
@Id
private int cedula;
private String nombre;
private String apellido;
private String tipo_cliente;
public int getCedula() {
return cedula;
}
public void setCedula(int cedula) {
this.cedula = cedula;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellido() {
return apellido;
}
public void setApellido(String apellido) {
this.apellido = apellido;
}
public String getTipo_cliente() {
return tipo_cliente;
}
public void setTipo_cliente(String tipo_cliente) {
this.tipo_cliente = tipo_cliente;
}
}
Сервис
package com.example.consulta.service;
import java.util.List;
import com.example.consulta.entity.Cliente;
public interface ClienteService {
public List<Cliente> findAll();
public Cliente findById(int cedula);
}
ServiceImpl
package com.example.consulta.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.example.consulta.DAO.ClienteDAO;
import com.example.consulta.entity.Cliente;
@Service
public class ClienteServiceImpl implements ClienteService{
@Autowired
private ClienteDAO clienteDao;
@Transactional
public List<Cliente> findAll() {
return (List<Cliente>) clienteDao.findAll();
}
public Cliente findById(int cedula) {
return clienteDao.findById(cedula).get();
}
}
pom. xml
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.consulta</groupId>
<artifactId>ServiceConsultaCliente</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ServiceConsultaCliente</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>
</project>
application.properties
# Oracle settings
spring.application.name=prueba-microservicio-cliente
server.port=8001
spring.datasource.url=jdbc:oracle:thin:@//10.164.7.203:1521/ORCLPDB1.localdomain
spring.datasource.username=cesar
spring.datasource.password=xxxxx123
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.jpa.hibernate.ddl-auto=update

ОБНОВЛЕНИЕ После выполнения действий, указанных в мама rcos Barrero Я получаю следующую ошибку: ошибка, которую я получаю:
pom. xml (final)
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
</parent>
<groupId>com.example.consulta</groupId>
<artifactId>ServiceConsultaCliente</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ServiceConsultaCliente</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<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>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
