목록에러 및 이슈 (14)
Code in Life
javax.validation validation-api 유효성 검증을 하기위해 javax.validation:validation-api 를 사용했으나 작동을 하지 않았다. 스택오버플로우에서 찾아본 결과 Springboot 2.2이상의 버전부터는 아래 dependency로 변경되었다. org.springframework.boot spring-boot-starter-validation
환경 : Windows10 Pro 에러 : io.jsonwebtoken.MalformedJwtException: Unable to read JSON value: Ș[Ȏ��̍M�� ...생략 원인 : 토큰에 들어온 토큰값이 올바르지 않을 때 발생한다. Bearer JWT토큰을 사용하고 있다면 Bearer을 지우고 실제 토큰값만 들어오게끔 해야한다.

환경 : Windows10 Pro 에러 : Command line is long. Shorten command line for xxxApplication or also for Spring Boot default configuration. 원인 : Widows에서 cmd 명령의 최대 길이는 2047 또는 8191인데, 의존하는 라이브러리가 많아 길이가 초과된 것. workspace.xml의 설정에서 아래를 추가한다. (이 설정은 classpath 특정 파일에 기록해두고 클래스 로더가 동적으로 읽어들이게하는 옵션이다.)

환경 : Windows10 Pro 에러 : The dependencies of some of the beans in the application context from a cycle: 원인 : bean 순환 참조 문제가 발생한것. (=A가 B를 참조중인데 B도 A를 참조중이고 그럼 어떤걸 먼저 생성해야해? 라는 상황) 임시방편으로 @RequiredArgsConstructor를 주석처리하고 직접 생성자를 만들어서 순환 참조가 일어나는 bean에 @Lazy 어노테이션을 통한 지연로딩으로 해결할 수 있었다. 참고 precioustar.tistory.com/66

환경 : Windows10 Pro 에러 : org.springframework.jdbc.BadSqlGrammerException : PreparedStatementCallback; bad SQL grammer [DELETE FROM SPRING_SESSION WHERE EXPIRY_TIME < ?] org.springframework.session spring-session-jdbc build.gradle에 spring-session-jdbc 의존성을 제거하니 해결되었다. (위는 pom.xml 형식으로 써놨음)

환경 : Windows10 Pro 에러 : **Status: 403: Forbidden** Server: Apache-Coyote/1.1 X-Content-Type-Options: nosniff X-Xss-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Frame-Options: DENY 원인 : Spring Security 사용시 권한이 필요한 페이지에 권한이 없는 유저가 접근할 경우 Forbidden error를 발생 WebSecurityConfigurerAdapter를 상속받는 Config클래스에서 configure(HttpSecurity..

환경 : Windows10 Pro 에러 : localhost:8080/swagger-ui.html 접속시 Whitelabel Error Page가 나타나는 문제 원인 : 1. swagger-ui.html에 대한 컨트롤러가 등록되지 않음 2. swagger-ui 3.0.0을 사용시 안되는 Issue가 있음 해결법 1의 경우 컨트롤러를 추가한다. (아래 사진 참고) 2의 경우 swagger-ui와 swagger2 버전을 2.9.2 버전으로 다운그레이드 시킨다.

분명 내 코드와 원격저장소가 다른데 Already up to date가 뜰 때가 있다. 해결법 : git fetch --all git reset --hard origin/main

오늘 pull request를 날리려다가 다음과 같은 오류를 목격했다. 원인은 다른 팀원이 코드를 올린것을 내가 확인못하고 pull을 안한채 내 코드를 커밋했기 때문에 발생하는 것이였다. (정확하게는 다른 브랜치에서 이미 conflict가 발생했었다) stackoverflow.com/questions/31973318/github-cant-automatically-merge랑 gollumnima.github.io/posts/wecode9_7TIL_git_error를 참고 했는데, 해결하는 방법은 다음과 같다. 1. git reset HEAD~N (N은 삭제할 커밋의 개수) 을 통해 최근 커밋을 취소한다. 2. git checkout main 3. git pull upstream [가져올 브랜치] 4. gi..

환경 : Windows10 Pro 에러 : Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8) 더보기 이전에 Git에 올려놨었던 프로젝트를 clone해와서 실행하니 위와 같은 에러가 발생했다. 해당 프로젝트는 OpenJDK12로 개발했었고 이를 clone한 데스크탑은 OpenJDK13이여서 호환성이 충돌한거라 예상했다. 그러나 Settings에서 Gradle JVM을 버전에 맞게 수정하거나 Project Structure에서 Java버전을 바꿔봐도 해결되지 않았다. 알고보니 Git에 올릴 때 gitignore설정해놨었기 때문에 application.yml이 빠져있어서 이를 추가했다! -_- 이후 실행이 잘된다.