안녕하세요. 강의를 들으면 실습하던중 강의와 다른 내용이 있어서 질문 드립니다. Spring REST Docs를 만들어내는 과정에서 gradle의 build나 asciidoctor 태스크를 실행했는데, build 폴더에 변환된 index.html이 생성이 되지 않습니다. 강의에서 사용하는 환경과 다른점은 스프링부트 3이상 버전을 사용한다는 점밖에 없고, 운영체제, 나머지 build.gradle이나 테스트 코드는 모두 동일한데, 변환된 html이 생성되지 않는 이유가 있을까요? + 추가로 build 시에 생성되는 bootJar 파일을 압축을 해제해서 보았더니 내부의 BOOT-INF/classes/static 에도 index.html 파일이 들어가있지 않았습니다.
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 이번 빅데이터분석기사 7회 응시생입니다! 다름아닌 RMSE 값이 900만대가 나왔는데 오답처리될까요? 다른분들은 440만이라 불안해서 질문드립니다..
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] @Override public Page<MemberTeamDto> searchPageSimple(MemberSearchCondition condition, Pageable pageable) { List<MemberTeamDto> content = queryFactory .select(new QMemberTeamDto( member.id, member.username, member.age, team.id, team.name )) .from(member) .leftJoin(member.team, team) // where 방식이 더 좋은 이유는 무엇일까? 재사용성이 좋아진다. 이게 가장 큰 객체지향의 특징인데 이걸 이용할 수 있음! .where(usernameEq(condition.getUsername()), teamNameEq(condition.getTeamName()), ageGoe(condition.getAgeGoe()), ageLoe(condition.getAgeLoe())) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch(); int totalSize = content.size(); log.info("total size = " + totalSize); return new PageImpl<>(content, pageable, totalSize); } serachSimple을 아래와 같이 작성하였습니다. fetchResults가 deprecated 되어서 이렇게 작성하였는데 postman에서 실행결과 total 페이지가 들어간 수로만 나옵니다. 이유를 알 수 있을까요??
@SpringBootTest class ApplyServiceTest { @Autowired private ApplyService applyService; @Autowired private CouponRepository couponRepository; @Test public void 한번만응모() { applyService.apply(1L); long count = couponRepository.count(); assertThat(count).isEqualTo(1); } @Test public void 여러번응모() throws InterruptedException { int threadCount = 1000; //ExecutorService : 병렬 작업을 간단하게 할 수 있게 도와주는 Java API ExecutorService executorService = Executors.newFixedThreadPool(32); // CountDownLatch : 다른 Thread에서 수행하는 작업을 기다리도록 도와주는 클래스 CountDownLatch latch = new CountDownLatch(threadCount); for (int i=0; i<threadCount; i++) { long userId = i; executorService.submit(() -> { try { applyService.apply(userId); } finally { latch.countDown(); } }); } latch.await(); long count = couponRepository.count(); assertThat(count).isEqualTo(100); } } @Service public class ApplyService { private final CouponRepository couponRepository; private final CouponCountRepository couponCountRepository; public ApplyService(CouponRepository couponRepository, CouponCountRepository couponCountRepository) { this.couponRepository = couponRepository; this.couponCountRepository = couponCountRepository; } public void apply(Long userId) { Long count = couponCountRepository.increment(); System.out.println("count : "+count); // long count = couponRepository.count(); if (count > 100) { return; } Coupon save = couponRepository.save(new Coupon(userId)); System.out.println("save! : "+save.getId()); } } @Repository public class CouponCountRepository { private final RedisTemplate<String, String> redisTemplate; public CouponCountRepository(RedisTemplate<String, String> redisTemplate) { this.redisTemplate = redisTemplate; } public Long increment() { try { return redisTemplate .opsForValue() .increment("coupon_count"); } catch (Exception e) { e.printStackTrace(); throw e; } } } 여러번응모 테스트 케이스 실행 CouponCountRepository.java의 increment 메서드에서 다음과 같은 에러가 발생하고 있습니다. 제일 처음에 나는 에러메시지는 다음과 같습니다. Caused by: io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error. 쿠폰도 정상적으로 등록되지 않아 아에 0개로 출력되고 있습니다. 구글링을 해봤지만 도저히 원인을 찾을 수가 없어요 .. ++ 추가로, 도커에서 레디스 컨테이너와 이미지를 삭제한 후 실행해도 동일한 결과가 나타나는 것을 확인됩니다. 강의에서 나온 그대로 도커 명령어를 사용해서 레디스를 pull 하였는데 왜 컨테이너와 이미지를 삭제해도 동일한 오류가 발생하는 걸까요? 도커에서 레디스 컨테이너와 이미지를 삭제하고 ApiApplication을 실행하면 정상적으로 실행됩니다... ++ 정리 드리자면, 1. 강의를 그대로 따라했는데 RedisCommandExecutionException가 발생하면서 테스트 케이스를 실행할 수 없는 이유 2. 강의에서 나온 그대로 도커 명령어를 사용해서 레디스를 pull 하였는데 왜 컨테이너와 이미지를 삭제해도 동일한 오류가 발생하는 이유 3. 도커에서 레디스 컨테이너와 이미지를 모두 삭제하고 ApiApplication를 실행했을 때 정상적으로 실행되는 이유 답변 부탁드립니다.
선생님! 안녕하세요 ㅎㅎ 선생님 덕에 작업형 3-1 소문제 두개빼고는 다 제대로 풀 수 있었어요 넘 감사합니다 💜 두개는 그냥.. 느낌대로 우선 제출은 하고왔습니다 🤣 🤣 작업형3 아예 모르는부분으로만 나올까봐 진짜 너무너무 걱정했는데.. 너무너무 감사합니다ㅠㅠ 곧 후기 제대로 남기겠습니다!!!! 근데 제가 여쭙고싶은게 있는데요! 1.작업형2 제출파일 pred가 모두 소수점 밑으로 끝에 e가 붙는데 그래도 괜찮은것 맞을까요? 2.강한 상관관계 = 양과 음의 상관관계 모두 생각해서 절댓값으로 확인해 변수를 찾았는데 강한 양or음의 상관관계가 아니고선 이렇게 해도 되는것 맞을까요?!
LogTemp: [NonPropStudent] 유효한 하지 않은 언리얼 오브젝트 LogTemp: [NonPropStudent] null이 아닌 언리얼 오브젝트 LogTemp: [PropStudent] 유효한 언리얼 오브젝트 LogTemp: [PropStudent] null이 아닌 언리얼 오브젝트 왜 유효하지 않은 언리얼 오브젝트인데 nullptr은 아닌지 잘 와닿지 않네요..
Refresh Token의 만료기한이 Access Token보다 더 길게 설정하였고, 만약 AccessToken은 유효하나 Refresh Token이 만료된다면 Refresh Token을 재발급하는 것이 맞는지 아니면 재로그인을 하도록 에러처리를 하는 것이 맞는지 궁금합니다..
강의 잘 듣고 있습니다. ^^ 현재 13강에서 test.jsp 를 만들었는데요. 화면에 출력은 되는데 html 형태로 출력이 되지않아서 무언가 셋팅이 안된건가 문의를 드려봅니다. // 20231202114331 // http://localhost:8080/MVC01/test.jsp 55 위처럼 출력이 되어져서 좀 당황했습니다. 그리고, HelloStart.java 는 다음 처럼 화면이 출력이 됩니다. // 20231202120202 // http://localhost:8080/MVC01/h.do 100 환경셋팅 좀 알려주시면 감사하겠습니다. 저는 3.10 버전으로 공부중입니다. ^^ 좋은 주말 되세요.
기본형과 참조형에 대하여 궁금증이 생겨서 질문을 남깁니다. public class question { public static void main(String[] args) { int a = 10; doubleNumber(a); System.out.println("a = " + a); } public static void doubleNumber(int x){ int result = x*2; System.out.println("doubleResult = " + result); } } doubleNumber라는 메서드를 만나게 되면 int x에 a의 값인 10이 복사되어 들어간 다음 2배 증가된 이후 result에 대입이 된 이후 print를 한 뒤에 메서드가 종료되면 result가 사라지는 것으로 알고있습니다. public class Method2 { public static void main(String[] args) { Student student1 = createStudent("학생1", 15, 90); Student student2 = createStudent("학생2", 17, 80); printStudent(student1); printStudent(student2); } static Student createStudent(String name,int age, int grade){ Student student = new Student(); student.name = name; student.age=age; student.grade = grade; return student; } static void printStudent(Student student){ System.out.println("이름:" +student.name+"나이:"+student.age+"성적:"+student.grade); } } createStudent라는 메서드에서는 student의 참조값을 리턴을 하기 때문에 Student student1=createStudent()를 하게 되면 new Student를 실행한 그 객체의 참조값이 넘어오는 것 까지는 이해를 했습니다. createStudent메서드가 끝나면 메서드 안에 있는 student는 계속 살아있는 것인지 아니면 다른 어떤 것들이 있는지 궁금합니다.