보뇨 다이어리

Spring Boot 처음 실행시 오류 본문

컴퓨터 관련/Java 정보

Spring Boot 처음 실행시 오류

보뇨 2019. 2. 2. 22:51
반응형
기존 Spring 만 만져보다가 boot 로 개발하니 신세계 :)
초기 환경설정관련해서 문제가 발생해서 포스팅함
빌드를 하니 아래 오류를 뱉음

1
2
3
4
5
6
7
8
** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
2019-02-02 22:38:38.630  WARN 2792 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [Application]; nested excep
tion is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.class] cannot be opened because it does not exist
2019-02-02 22:38:38.647  INFO 2792 --- [           main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-02-02 22:38:38.665 ERROR 2792 --- [           main] o.s.boot.SpringApplication               : Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.class] cannot be opened beca
use it does not exist
cs


패키지구조는 다음과 같다

└─src

    ├─main

    │  ├─java

    │  │  └─Application.class

    │  └─resources

    └─test

        ├─java

        └─resources



인터넷에 쳐보니 기본 패키지 구조에서 하면 문제가 발생한다는 것을 발생
그래서 Application.class 파일을 새로운 패키지 위에 이동하니 됨 



출처
https://stackoverflow.com/questions/41729712/spring-application-does-not-start-outside-of-a-package


반응형