inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

회원 서비스 개발

오류 )java.lang.IllegalStateException: Failed to load ApplicationContext

814

작성자 없음

작성한 질문수 0

0

오류가 떠요..

import를 잘못해서 그런걸까요?

java.lang.IllegalStateException: Failed to load ApplicationContext

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)

at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)

at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)

at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)

at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)

at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)

at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)

at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)

at org.junit.runners.ParentRunner.run(ParentRunner.java:413)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)

at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)

at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [jpabook.jpashop.JpashopApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'memberRepository' for bean class [jpabook.jpashop.repository.MemberRepository] conflicts with existing, non-compatible bean definition of same name and class [jpabook.jpashop.MemberRepository]

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:336)

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:252)

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:285)

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:99)

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)

at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:122)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)

... 27 more

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'memberRepository' for bean class [jpabook.jpashop.repository.MemberRepository] conflicts with existing, non-compatible bean definition of same name and class [jpabook.jpashop.MemberRepository]

at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:349)

at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:287)

at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)

at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296)

at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)

... 40 more

 

JPA java spring spring-boot 웹앱

답변 1

0

OMG

안녕하세요. pmsuk7028님, 공식 서포터즈 OMG입니다.

아래 링크와 동일한 에러가 발생하네요 확인해주세요 :)
https://www.inflearn.com/questions/637667
감사합니다.

안녕하세요 치킨 디도스 이벤트 보고 흉내내보려 들어왔습니다..

0

26

2

OrderServiceTest 상문주문 테스트 시 update 쿼리 문의

0

42

1

sdk 설정 오류

0

84

2

오탈자 - @Transactional

0

78

1

src/test/resources 테스트 경로 문제

0

76

1

상품 등록후 H2 db 출력 순서 바꿀 수 있나요?

0

74

1

MemberRepositoryTest 실행오류

0

101

1

boot 4.x >>> trasasction rolled back log & p6spy(영한님, 수업 자료 업데이트 해주시면 감사하겠습니다!!)

1

205

2

강의 마지막 QueryDSL 사용 부분 질문있습니다

1

163

2

클라이언트에서 isbn과 author 수정 요청을 한 경우에 대해 질문드립니다.

0

61

1

도메인 모델 패턴 vs 트랜잭션 스크립트 패턴

0

90

1

기본 생성자

0

69

1

h2 DB 연결시 jdbc url 변경 이유가 궁금합니다.

0

111

1

멤버서비스테스트 부분에서 막힙니다.

0

189

4

실무에서도 EntityManager를 이용해서 많이 작업하는 편일까요?

0

134

1

초반에 h2 다운로드 과정 꼭 필요한가요?

0

135

2

자신 필드에도 get으로 접근하는 이유가 있을까요?

0

126

1

24분 27초 연관관계 편의 메서드 위치

0

122

1

단건 주문만 가능하게 한건 의도한 부분이신가요?

0

120

2

빌드 툴, Gradle

0

75

1

h2연결은 된 것 같은데 엔티티 테이블까지 작성 후 확인해보아도 테이블이 안보입니다

0

86

2

Repository에서 EntityManager 주입 방식 차이

0

100

1

롬복과 사용자 정의 setter 메서드

0

80

1

주문 목록 조회 fetch join 질문드립니다

0

94

1