Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 주식 양도세 신고방법
- java.sql.SQLSyntaxErrorException
- 테스트 자동화
- 피보나치함수
- 재귀 예제
- 한국투자증권 해외주식 양도세
- Katalon Recorder 사용법
- katalon 자동화
- oracle group by
- 최대공약수 예제
- 피보나치함수 예제
- katalon xpath
- katalon
- git 연동
- katalon 사용법
- bfs 미로탐색 java
- 홈택스 해외주식 양도세
- 한국투자증권 양도세 신고
- 톰캣 실시간 로그
- 해외주식 양도세 신고
- 국세청 해외주식 양도세 신고방식
- katalon 비교
- 재귀함수 예제
- recursion example
- 피보나치 예제
- CSTS 폭포수 모델
- js 자동완성
- javascript 자동완성
- 해외증권 양도세 한국투자증권
- tomcat log
Archives
- Today
- Total
엄지월드
SpringBoot Bean 주입 에러(@ComponentScan) 본문
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed ExcelService in ExcelService required a bean of type 'com.skeleton.excel.service.ExcelService' that could not be found.
Action:
Consider defining a bean of type 'com.skeleton.excel.service.ExcelService' in your configuration
springboot에서 bean 생성이 com.skeleton.board 부분만 되고, com.skeleton.excel 부분은 되지 않는 이슈가 있었다.
spring에서는 application.xml에서 bean을 주입해주지만, springboot에서는 그렇지 않기 때문에 다른 방법을 찾아야 했다.
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="demoService" class="com.skeleton.board.boardService">
<property name="repository" ref="boardRepository"/>
<property name="count" value="21"/>
</bean>
<bean id="boardRepository" class="com.skeleton.board.boardRepository"/>
</beans>
그래서 찾아본 결과, @ComponentScan을 활용해서 bean 주입을 해줄 package를 설정해줄 수 있었고, 정상 작동하게 되었다.
package com.skeleton.board;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"com.skeleton"})
public class BoardApplication {
public static void main(String[] args) {
SpringApplication.run(BoardApplication.class, args);
}
}
'java > Spring' 카테고리의 다른 글
[intellij] hop swap 수동 적용 (community) (2) | 2023.12.02 |
---|---|
java.sql.SQLSyntaxErrorException: ORA-00900: SQL 문이 부적합합니다 (0) | 2023.07.29 |
arr stream return 값 만들기 (0) | 2023.07.17 |
lombok error: cannot find symbol, @RestController return {} (0) | 2023.07.16 |
Spring security AWT (0) | 2023.02.03 |
Comments