JWT Secret Key์ ๋ณด์์ด ์ฝํ๋ค๋ ์๋ฌ์ด๋ค. ํค์ ๊ธธ์ด๋ฅผ ๋๋ ค์ฃผ๋๊น ์ ์๋์ํ์๋ค. ์ํฌ๋ฆฟํค์ ๊ฒฝ์ฐ์๋ ์ต์ 512bits ์ด์์ผ๋ก ์ค์ ํ๋ ๊ฒ์ ๊ถ์ฅํ๋ค. [์ฐธ๊ณ ์๋ฃ1] [์ฐธ๊ณ ์๋ฃ2]
๋์ปค์ ๋ ๋์ค๋ฅผ ์ฐ๋ํ๋๋ฐ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค. ๋ด๊ฐ ์์ฑํ๋ ค๊ณ ํ๋ ๊ตฌ์กฐ๋ ์๋์ ๊ฐ๋ค. Docker ๋ด๋ถ์์ Spring์ด ์คํ๋๊ณ ์๊ณ , AWS EC2 Host ์๋ฒ์์ Redis๋ฅผ ๋๋ฆฌ๋ ์ํ์ด๋ค. ๋ฌธ์ ๋ Spring ๋ด๋ถ์ ์ฝ๋์์ ๋ฐ์ํ๊ณ ์์๋ค. ๋ฌธ์ V1 ์ผ๋จ ๊ธฐ์กด ์ฝ๋์์๋ ์๋์ ๊ฐ์ด application.yml์ 3๊ฐ์ง ๋ฒ์ ์ผ๋ก ๋๋ ์ ์ฌ์ฉํ๊ณ ์์๋ค. dev๋ ๋ก์ปฌ์์ ๋์ํ๋ H2, Redis๋ localhost์์ ๋์ํ๋๋ก ์์ฑ์ด ๋์ด์์๋ค. ์ด๊ฒ์ ๊ฒ ๋ฌธ์ ์ ์ ์ฐพ๋ค๋ณด๋ application-prod ์ ์ ์ฉ๋์ด์๋ ํด๋น ๋ถ๋ถ์ด ์ ์์ ์ผ๋ก ์ฝํ๊ณ ์์ง์์๋ค. ๊ทธ๋์ ์๋ฌ๊ฐ ๋ฐ์ํ๋๊ฒ. REDIS_HOST์ host์ IP๋ฅผ ์ ๋ ฅํด๋ ๋์์ ์์ผ๋์ผ๋ฉด localhost:6379๋ก ์คํ๋..
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..

๋ฌธ์ ์ ์คํ๋ง ์ปจํธ๋กค๋ฌ์์ ํน์ ์ค๋ฅ๋ฅผ ์คํํ ๋ ์ค๋ฅ๋ฉ์ธ์ง๊ฐ ๋ฌผ์ํ๋ก ํ์ถ๋๋ค. ๋ค๋ฅธ ์ปจํธ๋กค๋ฌ์์๋ ์ ์์ ์ผ๋ก ํ์๋๋๋ฐ ์ฌ๊ธฐ์๋ง ์ด๋ ๊ฒ ํ์๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ ์๋ฌ๋ก๊ทธ๋ฅผ ํ์ธํด๋ณด๋ org.springframework.security.authentication.InternalAuthenticationServiceException: ์๊ฑฐ๋, ์ฐพ์ ์ ์๋ ํ์ ์ ๋๋ค. ์์ ๊ฐ์ ์์ธ๊ฐ ๋ฐ์ํ์๋๋ฐ, ์ด๋ฌํ ์์ธ๋ ์ฌ์ฉ์ ์ธ์ฆ๊ณผ์ ์์ ์์ธ๊ฐ ๋ฐ์ํ ๋ ํ์ถ๋๋ค. @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{ Member member = memberRepository.findByEm..
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? ์คํ๋ง 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..
์๋ฌ 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..
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..
๋ฌธ์ @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)..
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..