简体   繁体   English

运行springboot应用程序时出现错误

[英]Getting error while running springboot application

Not able to run spring boot application 无法运行Spring Boot应用程序

Tried removing contents of /C:/Users/SaurKumar/.m2/repository/org/springframework/data/spring-data-commons/2.1.10.RELEASE/spring-data-commons-2.1.10.RELEASE.jar 尝试删除/C:/Users/SaurKumar/.m2/repository/org/springframework/data/spring-data-commons/2.1.10.RELEASE/spring-data-commons-2.1.10.RELEASE.jar内容

 :: Spring Boot ::        (v2.1.8.RELEASE)

2019-09-08 05:22:05.217  INFO 2420 --- [           main] i.j.c.CourseApiDataApplication           : Starting CourseApiDataApplication on BLRLW8166 with PID 2420 (C:\Users\SaurKumar\Downloads\course-api-data\course-api-data\target\classes started by saurkumar in C:\Users\SaurKumar\Downloads\course-api-data\course-api-data)
2019-09-08 05:22:05.222  INFO 2420 --- [           main] i.j.c.CourseApiDataApplication           : No active profile set, falling back to default profiles: default
2019-09-08 05:22:06.110  INFO 2420 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-09-08 05:22:06.215 ERROR 2420 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.postProcess(JpaRepositoryConfigExtension.java:121)

The following method did not exist:

    org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/lang/String;

The method's class, org.springframework.data.repository.config.RepositoryConfigurationSource, is available from the following locations:

    jar:file:/C:/Users/SaurKumar/.m2/repository/org/springframework/data/spring-data-commons/2.1.10.RELEASE/spring-data-commons-2.1.10.RELEASE.jar!/org/springframework/data/repository/config/RepositoryConfigurationSource.class

It was loaded from the following location:

    file:/C:/Users/SaurKumar/.m2/repository/org/springframework/data/spring-data-commons/2.1.10.RELEASE/spring-data-commons-2.1.10.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.config.RepositoryConfigurationSource


Process finished with exit code 1
-----------------------------------------

pom.xml pom.xml

<?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.1.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>io.javabrains</groupId>
    <artifactId>course-api-data</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>course-api-data</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-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.11.7.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

From the logs, it seems Spring is picking a different version for groupId org.springframework.data than the one provided with spring-data-jpa . 从日志中,似乎Spring为groupId org.springframework.data选择了与spring-data-jpa提供的版本不同的版本。 If you could match the versions of spring-boot-starter-web and spring-data-jpa , it should work. 如果您可以匹配spring-boot-starter-webspring-data-jpa ,它应该可以工作。

Quick fix being: Remove the version number for spring-data-jpa and it will by default take the latest version, which in your case is 2.1.10.RELEASE . 快速修复:删除spring-data-jpa的版本号,默认情况下,它将采用最新版本,在您的情况下为2.1.10.RELEASE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在现有 gradle 项目上启动 springboot 应用程序时出错 - Getting error while trying to start springboot application on existing gradle project 运行简单的JSF应用程序时出错 - Getting error while running a simple JSF application 在eclipse上运行android应用程序时出现此错误 - getting this error while running android application on eclipse 使用Micrometer指标运行SpringBoot 2应用程序时出错 - Error when running SpringBoot 2 application with Micrometer metrics 运行springboot应用程序时proxyBeanMthods注解错误 - proxyBeanMthods annotation error when running springboot application 我在 intellij 上运行 springboot 应用程序时出错。 有人能帮我吗? - I am getting an error running a springboot application on intellij. Can someone help me? 上传多部分文件列表时在 springboot 上出错 - getting error on springboot while upload list of multipartfile 在springboot中使用@Autowired时出错 - Getting error while using @Autowired in the springboot 尝试启动springboot应用程序时获取服务器时区值“未知”错误 - Getting server time zone value 'unknown' error while trying to start springboot application 为 Kafka 运行 Springboot 应用程序时出现 java.lang.NullPointerException - java.lang.NullPointerException while running Springboot application for Kafka
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM