๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์ „์ฒด ๊ธ€185

[Spring Boot] jakarta.servlet.ServletException: No adapter for handler [Controller@] The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler [Spring Boot] jakarta.servlet.ServletException: No adapter for handler [Controller@] The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler ServletException์€ Spring MVC์—์„œ ํ˜ธ์ถœํ•œ Controller ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ์ ์ ˆํ•œ HandlerAdapter๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์„ ๋•Œ ๋ฐœ์ƒ์ฃผ๋กœ ์ปจํŠธ๋กค๋Ÿฌ ์„ค์ •์— ์‹ค์ˆ˜๊ฐ€ ์žˆ์„ ๋•Œ ์ž์ฃผ ๋ฐœ์ƒ๋ฌธ์ œ ํ•ด๊ฒฐํ•˜๊ธฐController ์—์„œ ํ•„์š”๋กœ ํ•˜๋Š” annotation์„ ๋นผ๋จน์ง€ ์•Š์•˜๋Š”์ง€ ํ™•์ธ@RestController, @Controller, @RequestMapping, @GetMa.. 2024. 10. 29.
[Spring Boot] Controller์™€ RestController ์ฐจ์ด์™€ ResponseBody @Controller Vs. @RestControllerRestController๋Š” Spring Boot 4.0 ๋ถ€ํ„ฐ Restful ์„œ๋น„์Šค ๊ฐœ๋ฐœ์„ ์œ„ํ•ด ์ถ”๊ฐ€๋จRestController๋Š” Controller + ResponseBody ์ฆ‰, Controller์ž„์„ ์˜๋ฏธํ•˜๋ฉด์„œ ResponseBody์ธ RestApi์ž„์„ ์˜๋ฏธํ•œ๋‹ค @Controller@RestController์‚ฌ์šฉํ•˜๋Š” ๊ณณWeb Application ๊ฐœ๋ฐœ์— ์‚ฌ์šฉ๋จRestful Web Service ๊ฐœ๋ฐœ์— ์‚ฌ์šฉ๋จ๋ฐ˜ํ™˜ ํƒ€์ž…html๊ณผ ๊ฐ™์€ View๋ฅผ ๋ฐ˜ํ™˜json, XML๊ณผ ๊ฐ™์€ Response ๋ฐ˜ํ™˜ @Target({ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documented@Controller@Re.. 2024. 9. 22.
[Spring Boot] ํ•œ๊ธ€์ด ??? ๋กœ ๋‚˜์˜ฌ ๋•Œ, ํ•œ๊ธ€ ๊นจ์ง ์ด์Šˆ ๋ฌธ์ œ ์ƒํ™ฉ์Šคํ…Œ์ด์ง• ์„œ๋ฒ„์—์„œ ๋ฌธ์ œ ์—†๋Š” ๊ฒƒ ํ™•์ธํ•˜๊ณ  ์šด์˜์„œ๋ฒ„ ๋ฐฐํฌํ–ˆ๋‹ค์•ฑ์—์„œ request์‹œ ๋ณด๋‚ด์ฃผ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๋กœ๊ทธ๋กœ ํ™•์ธํ•˜๋‹ˆํ•œ๊ตญ์–ด๋งŒ ? ๋กœ ๋‚˜์˜ค๋Š” ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋‹ค. ์˜์–ด๋Š” ์ •์ƒ์ ์œผ๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ์ฐํžˆ๋Š” ๊ฑธ ํ™•์ธํ–ˆ๋‹ค. ๋ฐ”๋กœ ํŒŒ์•…ํ•˜๊ธฐ ์–ด๋ ค์› ๋˜๊ฑด request, response ๋ชจ๋‘ ์•”ํ˜ธํ™” ํ•ด์„œ ์ฃผ๊ณ  ๋ฐ›๊ณ  ์žˆ๊ณ  ๋‚ด๋ถ€์ ์œผ๋กœ ๋ชจ๋‘ Base64 utf-8 ์ธ์ฝ”๋”ฉ์„ ์‚ฌ์šฉํ–ˆ๋‹ค.์Šคํ…Œ์ด์ง• ์„œ๋ฒ„์—์„œ ๋™์ž‘ํ•˜๋˜ ๊ฒƒ์ด ์šด์˜์„œ๋ฒ„์—์„œ ๋‹ค๋ฅด๊ฒŒ ๋™์ž‘ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‘ ํ™˜๊ฒฝ์˜ ์ฐจ์ด์ ์„ ๋จผ์ € ์‚ดํŽด๋ณด๋Š” ๊ฒƒ์ด ๋งž์•˜๋‹ค ํ•ด๊ฒฐ๋ฐฉ๋ฒ•-Dfile.encoding=UTF-8 jvm ์˜ต์…˜์—์„œ file.encoding ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•œ๋‹ค "java", "-Dspring.profiles.active=prod", "-Dfile.encoding=UTF-8", "-jar" ์œ„์น˜.. 2024. 8. 23.
[Spring Boot] ์—๋Ÿฌ ํ•ด๊ฒฐํ•˜๊ธฐ - Attribute was annotated as enumerated, but its java type is not an enum Attribute [com..xxxx.xxx.xxx.domain.faceinfo.domain.Score.type] was annotated as enumerated, but its java type is not an enum [java.lang.String]  @Id @Enumerated(EnumType.STRING) private String type; varchar ๋กœ ์ง€์ •ํ•œ type์ด๋ผ๋Š” column์„ jpa๋กœ ์—”ํ‹ฐํ‹ฐ ๋งคํ•‘ํ•  ๋•Œ ์ƒ๊ธด ์˜ค๋ฅ˜์ด๋‹ค. Enummerated ์–ด๋…ธํ…Œ์ด์…˜์ด ์ž˜๋ชป๋œ ํƒ€์ž…์— ์‚ฌ์šฉ๋œ ๊ฒฝ์šฐ ๋ฐœ์ƒํ•œ๋‹คString์ด ์•„๋‹Œ Enum ํƒ€์ž…์œผ๋กœ ๋ณ€๊ฒฝํ•ด์ค˜์•ผ ํ•œ๋‹ค. 2024. 8. 22.
Spring boot ํ”„๋กœ์ ํŠธ์— SSL ์ธ์ฆ์„œ ์ ์šฉํ•˜๊ธฐ ํ•ด๋‹น ํฌ์ŠคํŒ…์€ ์‚ฌ์„ค ์ธ์ฆ SSL ์ ์šฉ์ž…๋‹ˆ๋‹ค. ์ž์ฒด ์„œ๋ช… SSL์€ ๋‹ค๋ฅธ ๊ธ€์„ ์ฐธ๊ณ ํ•˜์„ธ์š”! ๐Ÿ™‡ ์ €์˜ ๊ฒฝ์šฐ ์—ฌ๋Ÿฌ ์ฒจ๋ถ€ ํŒŒ์ผ์„ ์ œ๊ณต ๋ฐ›์•˜๋Š”๋ฐ ํŒŒ์ผ ์ด๋ฆ„์€ ๋‹ฌ๋ผ๋„ ์•„๋ž˜์™€ ๊ฐ™์€ ๊ตฌ์„ฑ์œผ๋กœ ๋˜์–ด ์žˆ์„ ๊ฑฐ์—์š”!.crt.pem์„œ๋ฒ„ ์ธ์ฆ์„œ PEM .key.pem๊ฐœ์ธํ‚ค PEM (์ด๋ฏธ .jks๋ฅผ ํŒŒ์ผ์ด ํฌํ•จ๋˜์–ด ์žˆ๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์œผ๋‹ˆ ํ™•์ธํ•ด๋ณด์„ธ์š”! ์ด๋ฏธ .jks๊ฐ€ ์žˆ๋‹ค๋ฉด jks ๋งŒ๋“œ๋Š” ๊ณผ์ •์€ ๊ฑด๋„ˆ ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค!) ์ด ๋‘๊ฐ€์ง€๋ฅผ ์‚ฌ์šฉํ•ด์„œ .p12๋ฅผ ๋งŒ๋“ค๊ณ  .p12๋ฅผ .jks๋กœ ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.  openssl pkcs12 -export -in [์„œ๋ฒ„์ธ์ฆ์„œ.pem] -inkey [๊ฐœ์ธํ‚ค.pem] -out [์ƒ์„ฑํ•  ํŒŒ์ผ์ด๋ฆ„.p12] -name [alias ์ด๋ฆ„] Enter Export Password:Verifying - Enter E.. 2024. 7. 15.
[Ubuntu] ํƒ€์ž… ์Šคํฌ๋ฆฝํŠธ ์‹œ์ž‘ํ•˜๊ธฐ ์šฐ๋ถ„ํˆฌ์—์„œ Visual Studio Code ์„ค์น˜https://code.visualstudio.com/ Visual Studio Code - Code Editing. RedefinedVisual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.code.visualstudio.com๋น„์ฅฌ์–ผ ์ŠคํŠœ๋””์˜ค ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์„œ ๋ฐ๋น„์•ˆ ํŒŒ์ผ (.deb)๋ฅผ ๋‹ค์šด๋กœ๋“œ๋ฅผ ๋ฐ›์•„ ์ค๋‹ˆ๋‹ค.cd ./๋‹ค์šด๋กœ๋“œ .. 2024. 7. 9.
React + TypeScript ํŒจํ‚ค์ง€ ์„ค์น˜ ์—๋Ÿฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ ์–ธ์€ ๋˜์—ˆ์ง€๋งŒ ํ•ด๋‹น ๊ฐ’์ด ์ฝํžˆ์ง€๋Š” ์•Š์•˜์Šต๋‹ˆ๋‹ค ํ˜น์€ React ๋นŒ๋“œ ํ›„ ์›นํŽ˜์ด์ง€์—์„œ TS2307: Cannot find module 'react-icons/go' or its corresponding type declarations. ์ด๋Ÿฐ์‹์œผ๋กœ ์—๋Ÿฌ๊ฐ€ ๋‚˜๋Š” ๊ฒฝ์šฐ ํƒ€์ž…์„ ์„ ์–ธํ•ด์ค˜์•ผ ํ•œ๋‹ค. npm install react-icons ์˜ˆ๋ฅผ๋“ค์–ด react-icons๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด ์ฃผ๊ณ  TypeScript์˜ ํƒ€์ž… ์„ ์–ธ ํŒŒ์ผ์„ ๋ช…์‹œ์ ์œผ๋กœ ์„ค์น˜ํ•ด ์ฃผ์–ด์•ผ ํ•œ๋‹ค. npm install @types/react-icons 2024. 7. 3.
React + Typescript ๋นŒ๋“œ ๋ถ€ํ„ฐ ์‹คํ–‰ ๊นŒ์ง€ ์‚ฌ์šฉ ๊ธฐ์ˆ  ์ŠคํƒReactTypescriptTailwind CSSReact-QueryLuxonReact-Router-DomZustandZod node ์„ค์น˜ํ•˜๊ธฐ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ node๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. ๋งฅ ํ™˜๊ฒฝ์—์„œ brew๋ฅผ ์ด์šฉํ•ด ์„ค์น˜ํ•ด ์ค๋‹ˆ๋‹ค. brew install node ์„ค์น˜๊ฐ€ ์ž˜ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋ ค๋ฉด node ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋ฒ„์ „์„ ํ™•์ธํ•ด ์ค๋‹ˆ๋‹ค. node -vnpm -v  typescript + react ์•ฑ ์ƒ์„ฑํ•˜๊ธฐnpx create-react-app [ํ”„๋กœ์ ํŠธ ์ด๋ฆ„] --template typescript cd (change directory) ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ•ด๋‹น ํด๋”๋กœ ์ด๋™ํ•ด ์ค๋‹ˆ๋‹ค.  cd [ํ”„๋กœ์ ํŠธ ์ด๋ฆ„] ์ด๋™ ํ›„ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ถ”๊ฐ€์ ์œผ๋กœ ํ•„์š”ํ•œ ๋””ํŽœ๋˜์‹œ๋ฅผ ์„ค.. 2024. 7. 1.
API ์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ Apache JMeter ๋ฆฌ๋ˆ…์Šค ํ™˜๊ฒฝ์—์„œ JMeter ์„ค์น˜ํ•˜๊ธฐjava --version JMeter์„ค์น˜๋ฅผ ์œ„ํ•ด ์ž๋ฐ”๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ์„ค์น˜๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด ์„ค์น˜ํ•ด ์ค€๋‹ค.  https://jmeter.apache.org/download_jmeter.cgi Apache JMeter - Download Apache JMeterDownload Apache JMeter We recommend you use a mirror to download our release builds, but you must verify the integrity of the downloaded files using signatures downloaded from our main distribution directories. Recent releases (.. 2024. 5. 21.
[H2DB] h2 ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ™˜๊ฒฝ ์„ค์ •๊ณผ ์Šคํ”„๋ง ๋ถ€ํŠธ ์„ธํŒ… H2DB๋ž€? h2 ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ์ž๋ฐ” ๊ธฐ๋ฐ˜์˜ ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๊ด€๋ฆฌ(dbms) ์ž…๋‹ˆ๋‹ค. ์šฉ๋Ÿ‰์ด ๊ฐ€๋ณ๊ณ  ์Šคํ”„๋ง ๋ถ€ํŠธ์— ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‚ด์žฅ๋˜์–ด ์žˆ์–ด ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋‚˜ ๋กœ์ปฌ ํ™˜๊ฒฝ ํ…Œ์ŠคํŠธ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜๊ฐ€ ๋”ฐ๋กœ ํ•„์š” ์—†๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉํ•˜๊ธฐ ํŽธ๋ฆฌํ•˜์ง€๋งŒ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ข…๋ฃŒ ๋˜๋ฉด์„œ ๊ฐ™์ด ๋ฐ์ดํ„ฐ๊ฐ€ ํœ˜๋ฐœ๋˜๋Š” ๋‹จ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํŒŒ์ผ๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ด€๋ฆฌํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐ˜๋ณตํ•˜์—ฌ ์‹คํ–‰ํ•˜๋”๋ผ๋„ ๋ฐ์ดํ„ฐ๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๊ณ  ์—ฌ๋Ÿฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ๋„ ์‚ฌ์šฉํ•   ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„ ๋ด…์‹œ๋‹ค. ๋˜ํ•œ ์ฝ˜์†” ๋ชจ๋“œ๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์•…ํ•˜๊ณ  ์Šคํ”„๋ง ๋ถ€ํŠธ์—์„œ ์–ด๋–ป๊ฒŒ h2๋ฅผ ์„ธํŒ…ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์•Œ์•„๋ณผ๊ฒŒ์š”!  h2 ์„ค์น˜ํ•˜๊ธฐ h2 ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ๋ณ„๋„์˜ ์„ค์น˜ ์—†์ด๋„ ์Šคํ”„๋ง์— ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‚ด์žฅ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์„ค์ •์„ ํ†ตํ•ด ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ.. 2024. 5. 14.
[Spring Boot JPA ๊ฒŒ์‹œํŒ ๋งŒ๋“ค๊ธฐ] 3. Entity ์ƒ์„ฑ ๊ฐ„๋‹จํ•œ ๊ฒŒ์‹œํŒ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ Board๋ผ๋Š” Entity ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ๊ฒ ์Šต๋‹ˆ๋‹ค. JPA๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๊ตฌ์กฐ๋ฅผ ์ž๋ฐ”์˜ ํด๋ž˜์Šค๋กœ ํ‘œํ˜„ํ•ด ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ORM์ด๋ผ๊ณ  ํ•˜๋Š”๋ฐ, ORM์€ Object Relational Mapping์˜ ์•ฝ์ž์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์˜ ๊ฐ์ฒด์™€ ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋งคํ•‘ํ•˜๋Š” ๊ธฐ์ˆ ์„ ๋งํ•ฉ๋‹ˆ๋‹ค. JPA๋Š” ORM์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.   ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” Entity ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์„ค๊ณ„๋ฅผ ํ•˜๋‹ค๋ณด๋ฉด ๊ณตํ†ต์ ์œผ๋กœ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์ปฌ๋Ÿผ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์ƒ์„ฑ์ผ๊ณผ ์ˆ˜์ •์ผ ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํด๋ž˜์Šค ์ •์˜ํ•  ๋•Œ ๋งˆ๋‹ค ๋งค๋ฒˆ ์ •์˜ ํ•˜์ง€ ์•Š๊ณ  ๊ณตํ†ต Entity ํด๋ž˜์Šค๋กœ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์–ด์š”. ๋จผ์ € BaseTime์ด๋ผ๋Š” ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•ด ๋ด…์‹œ๋‹ค! import lombok... 2024. 5. 8.
[Spring Boot JPA ๊ฒŒ์‹œํŒ ๋งŒ๋“ค๊ธฐ] 2. ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ ์„ค์ • Controller MVC์˜ Controller์„œ๋น„์Šค ๊ณ„์ธต์„ ํ˜ธ์ถœํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ๋ทฐ์— ์ „๋‹ฌํ•จ๋ฐ์ดํ„ฐ ๊ฒ€์ฆ(๋ฒจ๋ฆฌ๋ฐ์ด์…˜)์„ ์ˆ˜ํ–‰ํ•œ๋‹คํ”„๋กœ์  ํ…Œ์ด์…˜ ๋ ˆ์ด์–ด๋กœ์„œ ์›น ์š”์ฒญ๊ณผ ์‘๋‹ต์„ ์ฒ˜๋ฆฌํ•œ๋‹ค๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์ด ๊ตฌํ˜„๋˜๋Š” ๊ณณ์ด ์•„๋‹ˆ๋‹ค! Request์™€ Response๋ฅผ ๋‹ด๋‹นํ•œ๋‹คurl์— ๋”ฐ๋ผ ์ ์ ˆํ•œ View์™€ mapping์„ ์ฒ˜๋ฆฌ@Autowired, @Service๋ฅผ ์‚ฌ์šฉํ•ด service์˜ ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค@Controller@RequestMapping("/board")public class BoardController { @Autowired private BoardService boardService;}   Service๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์ด ํฌํ•จ๋˜๋ฉฐ ํŠธ๋žœ์žญ์…˜์„ ์‹œ์ž‘ ํ•˜๋Š” ๊ณณ์ด๋‹ค๋ฐ์ดํ„ฐ ์ ‘๊ทผ ๊ณ„์ธต์ธ Repository๋ฅผ ํ˜ธ์ถœํ•œ๋‹ค.. 2024. 4. 29.