본문 바로가기

오류해결/spring

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.github.yoonho.studytime.service.users.UsersServiceImpl' available 1. 증상spring에서 Rest api 유닛테스트 하려는데 계속 서비스 클래스를 불러오지 못한다는 오류가 발생했다. 2. 원인@SpringBootTest의 class인자로 어플리케이션의 메인 클래스를 넣어주어야 한다.저기에 UserApi.class를 넣었으니 당연히 그 안에 있는 서비스 빈이 autowired 될 수 없었다.생각해보면 당연한건데 이유를 못찾아서 한참 헤맸다; 3.에러 코드@RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = UsersApi.class) @WebAppConfiguration4.수정된 코드@RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Stu..
An illegal reflective access operation has occurred 1. 증상Groovy에 의존성을 지닌 모듈을 사용했더니 해당 메세지가 떴다. 2. 원인 jdk 11이 내는 경고였다. 스택오버플로우를 보니 다음과 같은 글이 있었다. Groovy is having to undergo significant changes to accommodate the Java 9 module system; this is why the version is labeled alpha-1. If you're new to Groovy and Java, start with Groovy 2.4 (and probably Java 8) to get acquainted before dealing with modules. -chrylis Dec 22 '17 at 5:46(https://stackoverfl..
No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call 1. 원인db에서 delete를 수행하는 부분에서 발생한 에러다.검색 결과 다음과 같은 내용을 찾아볼 수 있었다The @PersistenceContext annotation has an optional attribute type, which defaults to PersistenceContextType.TRANSACTION. This default is what you need to receive a shared EntityManager proxy. The alternative, PersistenceContextType.EXTENDED, is a completely different affair: This results in a so-called extended EntityManager, which is..
The server time zone value '´ëÇѹα¹ Ç¥ÁؽÃ' is unrecognized or represents more than one time zone. 1. 증상spring boot와 MySql 연동 중 발생한 에러 2. 원인검색 결과 KST Time zone을 인식하지 못하는 것 같다.mysql에 시간이 SYSTIME으로 설정되어 있는데, SYSTIME이 UTC time이 아니라서 그런 것으로 보인다. 3. 해결책 spring.datasource.url=dburl?serverTimezone=UTCjdbc 설정에서 server time zone을 UTC로 설정해 주면 된다.
[해결] intellij spring 설정 중 NoClassDefFoundError 1. 오류내용NoClassDefFoundError: org/apache/commons/dbcp2/BasicDataSource 2. 문제DBconfig 파일에서 BaiscDataSource()를 실행하지 못했다.검색 결과 주된 이유가 pom.xml에 common-dbcp2를 명시하지 않는 것이었는데,pom.xml 디펜던시에 dbcp가 추가되어 있었음에도 클래스를 찾을 수 없다는 오류가 발생했다. 3. 해결방법 모듈은 다운받아져 있는데, output으로 추가하지 않아서 발생한 문제였다.project setting -> artifacts 창의 오른쪽 부분에 available element가 있는데(붉은 색으로 표시된 부분), 거기서 모듈을 더블클릭해서 추가해 주면 된다.이 작업을 해주지 않으면 out 으로 컴..