일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- jwt메서드
- 스프링부트오류
- 복합키
- ERD 작성
- JPA주의사항
- Q 클래스
- REST란
- @IdClass
- Error creating bean with name
- spring서버
- JPA
- 1차캐시
- 스프링 부트 기능
- uncheck Exception
- Unsatisfied dependency
- 스프링 부트 공식 문서
- github
- JoinColumn
- Spring Spring boot 차이
- 최종 프로젝트
- jpa에러
- git
- REST API 규칙
- Filter
- json gson 차이
- jpa회원가입
- 빈생성안됨
- json
- queryDSL
- 인텔리제이
- Today
- Total
목록내배캠 주요 학습/TIL : Today I Learned (41)
Everyday Dev System
# 문제점 : 로그인 url에 POST를 제외한 다른 Method로 요청이 들어와서 로그인 처리가 된다는 문제점이 도출되었습니다. GET, DELETE, PUT 등의 요청이 들어오면 로그인 처리가 되지 않도록 거부해야 합니다. 현재 로그인 처리는 아래 클래스에서 수행합니다. (JwtAuthenticationFilter.java) UsernamePasswordAuthenticationFilter를 상속받았습니다. > JwtUtil 타입의 객체인 jwtUtil을 멤버 변수로 갖습니다. JwtAuthenticationFilter 클래스는 아래와 같은 생성자 메서드를 갖습니다. public JwtAuthenticationFilter(JwtUtil jwtUtil) { this.jwtUtil = jwtUtil; s..
DataBase Table Relationship Entity Relationship Diagram 1. Post와 User는 단방향 N : 1 관계이다. 2. Post는 User 테이블의 username 칼럼을 참조한다. > 1. User, java package com.sparta.myblog.entity; import jakarta.persistence.*; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.ArrayList; import java.util.List; @Entity @Getter @Setter @NoArgsConstructor @Table(name = "users")..
20230614 6:00pm - 20230615 4:00am 20230615 9:00am - 20230615 1:00pm # 문제점 : Error creating bean with name 'postController' defined in file [D:\camp\springBasic\week1\myBlog\build\classes\java\main\com\sparta\myblog\controller\PostController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'postService' defined in file [D:\camp\springBasic\we..
20230612 7:00pm #문제점 : 인텔리제이에서 commit에 change- Unversioned Files에 필요없는 파일들이 있을 경우에는 상위 폴더에 .git 이 있을 경우가 있다. # 시도 : git config 명령어를 아무리 해봐도 해결이 안됐다. cmd에서도, git bash에서도. git remote 연결을 끊었다가 다시 연동했음에도 해결이 되지 않았다.. 혹시 상위 폴더에 .git 파일이 있어서 버전관리가 필요없는 파일에 있는 .git을 삭제 했다. 그리고 git 디렉터리 경로도 깔끔하게 삭제해주었다. # 문제 해결 : 이때 Settings - Directory Mappings에서 필요없는 디렉터리 경로를 삭제해주면 좋다.
20230610 3:40pm - 5:40pm # 문제점 : https://start.spring.io/에서 스프링부트 3.1.0 버전을 다운로드 하였다. 그러나, 내 로컬에서 환경변수로 저장되어 있는 JAVA_HOME의 경로는 JDK 17 버전이여서 오류가 난 경우이다. project structure에서 JDK를 11버전으로 설정해주어야 하고, 환경변수도 11버전으로 변경하여야 한다. Error " -- 이전 생략 -- Doesn't say anything about its elements (required them packaged as a jar) -- 이후 생략 -- " # 시도 : JDK를 1.8, 11, 17 버전 모두 해보았는데 환경변수 경로를 변경해주지 않아서 계속 오류가 반복되었다. 고급 ..
# 문제점 : 컴파일하는 과정에서 ClassNoFoundException 오류가 발생했다. Could not find or load main class [main 파일명] # 시도 : .idea 과 .iml 파일 삭제 후 다시 Run.. 실패했다.. .idea에 설정되어 있는 classPath가 잘못 된 듯 하다. 다시 삭제하고 file- project structure 에서 sdk와 모듈을 다시 설정해줬다. 그리고 닫았다가 다시 프로젝트를 열었다. 성공했다.. 하지만 빌드가 되지 않는다.. 실패했다.. 이제는 run 버튼이 활성화가 되지 않는 문제가 생겼다. File- Invalidate Caches - [INVALIDATE AND RESTART] 를 하고 다시 빌드를 해보았으나, 빌드가 되지 않는다...
This branch has conflicts that must be resolved #문제점 : 타인이 나의 repo에 Pull Request를 했는데 싱크가 맞지 않아 충돌이 발생했다. Merge 버튼도, 충돌 해결 버튼도 활성화가 안 되어 있다. Resolve conflicts 버튼도 클릭이 안 되어서 merge하기 위한 과정에서 충돌 해결을 웹에서 할 수 없는 상황이다. 이는 conflict 내용이 복잡해서 github이 이를 보여줄 수 없는 상황이라고 한다. 많은 양의 코드를 변경한 경우 위와 같은 현상이 나타날 수 있다. Confict 란? 브랜치와 브랜치의 병합 과정에서, 동일한 내용을 각자 다르게 변경한 이력이 있을 때 변경 이력들끼리 발생하는 충돌 #시도 : Gighub DeskTop을 ..
# 문제점 : List 타입의 객체에서 요소를 순회하는 중에 요소를 삭제한 후에 index가 변경되어 일부 요소는 순회가 안됐다. 아래와 같은 오류가 발생했다. List saleFoods 변수 내에서 특정 조건에 맞을 경우, saleFoods 내에서 sf라는 객체의 요소를 삭제하는 코드 부분이다. for (Food sf : saleFoods) { if(resultCnt == 0){ saleFoods.remove(sf); } } # 시도 : saleFoods.remove(sf); saleFoods.add(new Food("",0.0,"",0)); 삭제를 하고, 빈 객체를 생성해보았지만, salesFoods를 순회하며 출력할 때, 아래와 같이 출력이 되어, 출력이 되지 않도록 해야 하므로 이 방법은 옳지 않..
public class Main { public static void main(String[] args) { List bookList = Arrays.asList( new Book(1L, "모두의 딥러닝", "조태호", "IT", 21600), new Book(2L, "이득우의 게임 수학", "이득우", "IT", 40500), new Book(3L, "자바 웹 개발 워크북", "구멍가게 코딩단", "IT", 31500), new Book(4L, "실전 시계열 분석", "에일린 닐슨", "IT", 34200), new Book(5L, "데이터 분석가의 숫자유감", "권정민", "IT", 14400), new Book(6L, "스프링 부트 실전 활용 마스터", "그렉 턴키스트", "IT", 25200), ..
튜터님께 오늘 질문을 하였다. 첫번째 질문으로, 가독성이 좋은 코드를 어떻게 짜면 되는지에 대해서 질문을 했는데, 정말 좋은 답변을 들어서 공유하고 싶다. 1. 검증된 코드를 많이 보기 - 자바 내부에 구현되어 있는 ArrayList와 같은 내부 구현체를 많이 보고 비교해봐라 2, naming과 최대한 간략하게 보기 수월하게 코드를 구성하는 것이 좋다. 3. 한클래스 라인 100 line 이내를 권장한다. 이 말을 듣고 ArrayList에 구현된 메서드를 바로 찾아보고 하나하나 이해하려 노력했다. 하지만, 이해가 잘 되지 않았다. 이를 보기 위해서는 Object 클래스, Collection 클래스의 내부도 봐야 하기 때문에 다 이해하기란 힘들었다. 그렇지만, 확실히 코드가 간단하다는 것이 보여서 이와 같..