programing

ApplicationContext를 시작하는 동안 오류가 발생했습니다.자동 구성 보고서를 표시하려면 '디버깅'을 활성화하여 응용 프로그램을 다시 실행하십시오.

telecom 2023. 3. 31. 21:35
반응형

ApplicationContext를 시작하는 동안 오류가 발생했습니다.자동 구성 보고서를 표시하려면 '디버깅'을 활성화하여 응용 프로그램을 다시 실행하십시오.

자동 설정 파일이 Spring-Boot 응용 프로그램에서 작동하지 않습니다.설정 어플리케이션 파일을 아래에 첨부합니다.

@Configuration
@EnableAutoConfiguration
@ComponentScan
@SpringBootApplication
@EnableScheduling
public class Application {

  public static void main(String[] args) {
      SpringApplication springApplication=new SpringApplication(Application.class);
      System.out.println("Spring Core Version:- " + SpringVersion.getVersion());
      springApplication.run(args);

  }
}

느려진 예외는 다음과 같습니다.어떻게 하면 고칠 수 있죠?

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-01-19 14:50:06.085 ERROR 7614 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; 
nested exception is java.lang.NoClassDefFoundError: org/hibernate/boot/archive/scan/spi/ScanEnvironment
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1589) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBectBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at com.track.io.Application.main(Application.java:35) [classes/:na]

저 혼자 해결했어요.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>5.0.7.Final</version>
</dependency>

는 ㅇㅇㅇㅇㅇㅇㅇㅇ다를 넣었습니다.@Component입니다.import org.springframework.stereotype.Component문제는 해결되었다.

저에게는 유효하지 않은 Import 또는 의존관계 파일 사용 불가로 인한 것입니다.

의존관계 및 Import 스테이트먼트 확인

저도 같은 생각이 들었어요.

"ApplicationContext를 시작하는 중 오류 발생"

위의 솔루션도 전혀 효과가 없는 솔루션을 찾아봤기 때문에 오류를 1개씩 읽어보기로 하고 마지막에 또 다른 오류가 있음을 발견했습니다.

"유형에 대한 속성을 찾을 수 없습니다.

그 후 스프링 데이터 JPA - 참조 문서에 따르면 봄에 이름을 짓는 것이 중요하다는 것을 알게 되었습니다. 그래서 그것은 다음과 같습니다.

다음 중 하나:
라는 .

예를 들어 다음과 같습니다.

User Repository, Order Repository, Contact Repository

다음 중 하나:
이라는 을 붙여야 .

예를 들어 다음과 같습니다.

Contact Impl, User Service Impl, Order Service Impl

힌트 1: 모든 저장소 클래스/인터페이스는 하나의 디렉토리에 배치해야 합니다.

힌트 2: 모든 서비스 클래스/인터페이스는 1개의 디렉토리에 배치해야 합니다.

힌트 3: 저장소의 이름이 UserRepository인 경우 저장소의 구현 이름은 UserRepositoryImpl이어야 합니다.

힌트 4: 서비스 인터페이스가 UserService로 명명된 경우 서비스 인터페이스의 구현은 UserServiceImpl로 명명되어야 합니다.

상세한 것에 대하여는, 메뉴얼을 참조해 주세요.

수 것 .NoClassDefFoundError: org/hibernate/boot/archive/scan/spi/ScanEnvironment★★★★★★★★★★★★★★★★★★★★★」

Hibernate core가 의존관계로 설정되어 있는지 확인합니다.

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>5.0.11.Final</version>
  <scope>compile</scope>
</dependency>

제 경우 jdbc api 의존성을 프로젝트에 포함시켜 "Hello World"가 인쇄되지 않도록 했습니다.아래 종속성을 제거한 후, 그것은 마법처럼 작동합니다.

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

스프링부트에서 같은 때할 수 .port다른 곳에서 실행 중인 응용 프로그램을 중지했는지 확인하거나 열린 포트를 중지하십시오.

나는 같은 오류를 발견했다.

ApplicationContext를 시작하는 동안 오류가 발생했습니다.상태 보고서를 표시하려면 '디버깅'을 활성화하여 응용 프로그램을 다시 실행하십시오.2021-12-21 22:57:45.237 ERROR 4952 --- [ main ]os . s . boot .Spring Application : 응용 프로그램 실행 실패

org. springframework.콩류.빈크리에이션예외:com.sts.dao에 정의된 'userRepository' 이름의 콩을 만드는 동안 오류가 발생했습니다.JpaRepositiesRegistrar에서 선언된 @EnableJpaRepository에 정의된 UserRepository.EnableJpaRepository 구성:사용자 유형에 대한 findbyName 속성을 찾을 수 없습니다!

Spring Data JPA를 사용하는 동안 My Repository에서 Custom Methods(또는 Derived Methods)의 이름을 잘못 정의했기 때문에 Spring data Jpa reference를 검색하면 Custom methods에 엄격한 명명규칙이 있어 이를 따르지 않으면 오류가 발생합니다.

findByName(), findInAge(), findByLessThan() 등

저 같은 경우에는 이렇게 쓰고 있었어요.

**public List<User> findbyName(String name);**

에러가 발생하고 있습니다.

제안:스프링 데이터로 작업할 때 JPA는 오류를 방지하기 위해 참조 문서에 정의된 camelCase 및 모든 명명 규칙을 엄격하게 따릅니다.

사용하지 않을 경우 JPA 종속성을 제거합니다.

    <!--   dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency -->

저도 같은 실수를 했어요.수정은 클래스 선언 상단에 "@Component"를 추가하는 것이었습니다.고객님의 경우 다음과 같습니다.

@Component
public class Application {

  public static void main(String[] args) {
      SpringApplication springApplication=new SpringApplication(Application.class);
      System.out.println("Spring Core Version:- " + SpringVersion.getVersion());
      springApplication.run(args);

  }
}

언급URL : https://stackoverflow.com/questions/41738621/error-starting-applicationcontext-to-display-the-auto-configuration-report-re-r

반응형