fee-fi-fo-fum
JWT weekKey error
Error Logs๐Ÿพ 2023. 12. 26. 17:00

JWT Secret Key์˜ ๋ณด์•ˆ์ด ์•ฝํ•˜๋‹ค๋Š” ์—๋Ÿฌ์ด๋‹ค. ํ‚ค์˜ ๊ธธ์ด๋ฅผ ๋Š˜๋ ค์ฃผ๋‹ˆ๊นŒ ์ •์ƒ๋™์ž‘ํ•˜์˜€๋‹ค. ์‹œํฌ๋ฆฟํ‚ค์˜ ๊ฒฝ์šฐ์—๋Š” ์ตœ์†Œ 512bits ์ด์ƒ์œผ๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค. [์ฐธ๊ณ  ์ž๋ฃŒ1] [์ฐธ๊ณ  ์ž๋ฃŒ2]

๋„์ปค + Redis ์—ฐ๋™ ์—๋Ÿฌ
Error Logs๐Ÿพ 2023. 12. 26. 16:51

๋„์ปค์™€ ๋ ˆ๋””์Šค๋ฅผ ์—ฐ๋™ํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ๋‚ด๊ฐ€ ์ž‘์„ฑํ•˜๋ ค๊ณ  ํ–ˆ๋˜ ๊ตฌ์กฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค. Docker ๋‚ด๋ถ€์—์„œ Spring์ด ์‹คํ–‰๋˜๊ณ ์žˆ๊ณ , AWS EC2 Host ์„œ๋ฒ„์—์„œ Redis๋ฅผ ๋Œ๋ฆฌ๋Š” ์ƒํƒœ์ด๋‹ค. ๋ฌธ์ œ๋Š” Spring ๋‚ด๋ถ€์˜ ์ฝ”๋“œ์—์„œ ๋ฐœ์ƒํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. ๋ฌธ์ œ V1 ์ผ๋‹จ ๊ธฐ์กด ์ฝ”๋“œ์—์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด application.yml์„ 3๊ฐ€์ง€ ๋ฒ„์ „์œผ๋กœ ๋‚˜๋ˆ ์„œ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. dev๋Š” ๋กœ์ปฌ์—์„œ ๋™์ž‘ํ•˜๋Š” H2, Redis๋Š” localhost์—์„œ ๋™์ž‘ํ•˜๋„๋ก ์ž‘์„ฑ์ด ๋˜์–ด์žˆ์—ˆ๋‹ค. ์ด๊ฒƒ์ €๊ฒƒ ๋ฌธ์ œ์ ์„ ์ฐพ๋‹ค๋ณด๋‹ˆ application-prod ์— ์ ์šฉ๋˜์–ด์žˆ๋Š” ํ•ด๋‹น ๋ถ€๋ถ„์ด ์ •์ƒ์ ์œผ๋กœ ์ฝํžˆ๊ณ  ์žˆ์ง€์•Š์•˜๋‹ค. ๊ทธ๋ž˜์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”๊ฒƒ. REDIS_HOST์— host์˜ IP๋ฅผ ์ž…๋ ฅํ•ด๋„ ๋™์ž‘์„ ์‹œ์ผœ๋†“์œผ๋ฉด localhost:6379๋กœ ์‹คํ–‰๋˜..

InvalidDataAccessApi UsageException ์—๋Ÿฌ ๋ฐœ์ƒ
Error Logs๐Ÿพ 2023. 12. 17. 19:23

2023-12-17 18:10:33.956 ERROR 11520 --- [nio-8080-exec-1] t.s.g.e.e.RestControllerAdvice : Unknown error org.springframework.dao.InvalidDataAccessApiUsageException happened: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction avai..

article thumbnail
[Spring] ํŠน์ • ์˜ค๋ฅ˜ ๋ฉ”์„ธ์ง€ ํ‘œ์‹œ ? (๋ฌผ์Œํ‘œ)๋กœ ๊นจ์ ธ์„œ ํ‘œ์‹œ๋˜๋Š” ์—๋Ÿฌ
Error Logs๐Ÿพ 2023. 12. 11. 18:49

๋ฌธ์ œ์  ์Šคํ”„๋ง ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ํŠน์ • ์˜ค๋ฅ˜๋ฅผ ์‹คํ–‰ํ• ๋•Œ ์˜ค๋ฅ˜๋ฉ”์„ธ์ง€๊ฐ€ ๋ฌผ์Œํ‘œ๋กœ ํ‘œ์ถœ๋œ๋‹ค. ๋‹ค๋ฅธ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ๋Š” ์ •์ƒ์ ์œผ๋กœ ํ‘œ์‹œ๋˜๋Š”๋ฐ ์—ฌ๊ธฐ์„œ๋งŒ ์ด๋ ‡๊ฒŒ ํ‘œ์‹œ๋œ๋‹ค. ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ์—๋Ÿฌ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ org.springframework.security.authentication.InternalAuthenticationServiceException: ์—†๊ฑฐ๋‚˜, ์ฐพ์„ ์ˆ˜ ์—†๋Š” ํšŒ์› ์ž…๋‹ˆ๋‹ค. ์œ„์™€ ๊ฐ™์€ ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋Š”๋ฐ, ์ด๋Ÿฌํ•œ ์˜ˆ์™ธ๋Š” ์‚ฌ์šฉ์ž ์ธ์ฆ๊ณผ์ •์—์„œ ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ• ๋•Œ ํ‘œ์ถœ๋œ๋‹ค. @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{ Member member = memberRepository.findByEm..

์ž‘์—…์ค‘ ์—๋Ÿฌ ์ •๋ฆฌ
Error Logs๐Ÿพ 2023. 12. 7. 17:59

2023-10-08 05:21:35.706 ERROR 6064 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarExce..

JPA Auditing ํ…Œ์ด๋ธ” ๋ณ€๊ฒฝ ์‚ฌํ•ญ ํŠน์ • ํ•„๋“œ์—์„œ ์ž‘๋™ ๋ฐฉ์ง€
Error Logs๐Ÿพ 2023. 10. 6. 17:06

JPA Auditing? ์Šคํ”„๋ง JPA๋ฅผ ์‚ฌ์šฉํ•ด DB์— ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑ, ์ˆ˜์ • ์‹œ๊ฐ„์„ ๋„ฃ์„๋•Œ ์‚ฌ์šฉํ•˜๋ฉด ํŽธ๋ฆฌํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค. ์ด ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ด€๋ฆฌ๋ฅผ ํ•˜๋˜ ์ค‘ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. @entity @EntityListeners(AuditingEntityListener.class) public class Post { @id private Long id; private String title; private String content; private String viewCount; private String createdAt; @CreatedDate @Column(updatable = false) private LocalDateTime createdAt; @LastModifiedDate private LocalDat..

mapper ์—๋Ÿฌ
Error Logs๐Ÿพ 2023. 9. 21. 19:26

์—๋Ÿฌ Parameter 1 of constructor in com.codestates.server.domain.license.controller.LicenseController required a bean of type 'com.codestates.server.domain.license.mapper.LicenseMapper' that could not be found. ์ด์—๋Ÿฌ๋Š” Controller ํด๋ž˜์Šค์˜ ์ƒ์„ฑ์ž์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ Mapperํƒ€์ž…์˜ ๋นˆ์ด ํ•„์š”ํ•˜์ง€๋งŒ ํ•ด๋‹น ๋นˆ์„ ์ฐพ์„์ˆ˜์—†๋‹ค๋Š” ๋‚ด์šฉ์ด๋‹ค. ๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ LicenseMapper๋ฅผ ๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™๋‹ค. @Mapper public interface LicenseMapper { // ... } ์ด๋Ÿฌํ•œ ํ˜•์‹์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ๋‹ค. ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. ํ•ด๊ฒฐ๋ฐฉ๋ฒ• @M..

JPA casecade ์—๋Ÿฌ
Error Logs๐Ÿพ 2023. 9. 17. 02:37

error log org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.codestates.server.domain.license.licensedate.entity.License.licenseInfo -> com.codestates.server.domain.license.licenseinfo.entity.LicenseInfo; nested exception is java.lang.Illegal..

@RequestBody ์‚ฌ์šฉ Json๋ฐ์ดํ„ฐ, DTO์—†์ด ๋ฐ›๋Š”๋ฐฉ๋ฒ•
Error Logs๐Ÿพ 2023. 8. 20. 17:55

๋ฌธ์ œ @PostMapping ๊ณผ @PatchMapping์—์„œ๋Š” DTO๋ฅผ ๋งŒ๋“ค์–ด @RequestBody๋ฅผ ์ด์šฉํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์•˜๋‹ค. ํ•˜์ง€๋งŒ @DeleteMapping์—์„œ๋Š” DTO๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋ฐ›์„์ •๋„๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์ด ํ•„์š”ํ•˜์ง€์•Š์•˜๋‹ค. ํ•„์š”ํ•œ๋ฐ์ดํ„ฐ๋Š” userId ๋‹จํ•˜๋‚˜์ด๊ธฐ๋•Œ๋ฌธ์— ์•„๋ž˜ ์ฝ”๋“œ์™€ ๊ฐ™์ด ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์œผ๋ ค๊ณ  ์‹œ๋„ํ•˜์˜€๋‹ค. @DeleteMapping("/delete/{question-id}") public ResponseEntity deleteQuestion(@PathVariable("question-id") Long questionId, @RequestBody Long userId){ //userId๋ฅผ Long์œผ๋กœ ๋ฐ›์Œ questionService.deleteQuestion(questionId, userId)..

Tomcat server [] error
Error Logs๐Ÿพ 2023. 7. 31. 22:34

error A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to [] tomcat ์„œ๋ฒ„๋ฅผ ๊ตฌ๋™์‹œ์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ warning ๋ฉ”์„ธ์ง€๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. ํ•ด๊ฒฐ tomcat ๋ฒ„์ „์— ๋”ฐ๋ฅธ context path์— ์ œ์•ฝ์‚ฌํ•ญ์ด ์ƒ๊ฒจ์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค. ์—๋Ÿฌ๋ฉ”์„ธ์ง€์˜ ๋‚ด์šฉ์€ "context path์— ๋นˆ ๋ฌธ์ž์—ด์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜, "/"๋กœ ์‹œ์ž‘์€ ํ•˜์ง€๋งŒ "/"๋กœ ๋๋‚˜์ง€ ์•Š์€ ๊ฒฝ๋กœ๋ฅผ ์จ์•ผํ•œ๋‹ค." ๋Š” ๋‚ด์šฉ์œผ๋กœ, ์ด ๊ฒฝ์šฐ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•ด๊ฒฐํ•˜์˜€๋‹ค. tomcatํด๋” > conf > server.xml..

profile on loading

Loading...