묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨Java 마이크로서비스(MSA) 프로젝트 실습
첫번째 MSA 설명 문서 7페이지 model 오타요
잘못써있네용
-
미해결김영한의 실전 자바 - 기본편
접근제어자 문제풀이 관련
안녕하세요 접근제어자 문제풀이가 조금 복잡했었지만 익숙하지 않아서 이해하는데 시간이 걸렸다고 생각합니다.영한 강사님의 문제풀이를 기반으로 제가 추가적으로 다른 기능을 추가해봤는데요. 해당 부분에 대한 버그가 발생해서 질문을 드립니다.제가 추가하고 싶었던 기능은 다음과 같습니다.User id를 입력받고 "환영합니다! UserID" 구문을 출력시킨 뒤 Userid가 주문한 내역 Item의 제품명을 출력하려고 하였습니다.user에 대한 값을 user[userCount] = user이렇게 하였고 메인메소드에서 user에 대한 인스턴스를 생성하고 creatUser 메소드를 통해서 생성된 인스턴스가 배열에 담아졌으니 userOrder메소드를 실행하면인덱스에 저장된 user에 대한 정보가 출력되어야 하는 것이 아닐까? 라는 생각을 가졌는데 null이 출력이 되어서 어떤 부분에서 착오가 있었는지 알고 싶습니다. 객체지향프로그래밍에 대한 부분과 접근제어자에 대한 개념 및 이해도가 낮아서 일어나는 실수일까요..?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
Spring - Oracle 연동 시 문제입니다.
JDBC 템플릿을 사용해 글을 작성하거나 리스트를 조회하면이런오류가 발생합니다. ㅠㅠ그런데 실제로 글이 잘 저장/조회 하는데는 문제가 없습니다. 다만 작업시마다 저오류가 발생합니다;구글에서 나오는 서비스 - Listener 재시작, ora파일 수정 등의 조치는 다 해본상황입니다..어떻게하면좋을까요 ㅠ
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
강의내용대로 따라했는데 localprpfile를 읽어들이지못하고있네요 이유가뭘까요??
spring: config: activate: on-profile: local datasource: url: "jdbc:h2:mem:library;MODE=MYSQL;NON_KEYWORDS=USER" username: "root" password: "1234" driver-class-name: org.h2.Driver jpa: hibernate: ddl-auto: create properties: hibernate: show_sql: true format_sql: true dialect: org.hibernate.dialect.H2Dialect h2: console: enabled: true path: /h2-console --- spring: config: activate: on-profile: dev datasource: url: "jdbc:mysql://localhost/liberary" username: "root" password: "1234" driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: ddl-auto: none properties: hibernate: format_sql: true use_sql_comments: true disable_sql_comments: org.hibernate.dialect.MySQL8Dialect yaml파일입니다 설정부분입니다콘솔입니다오류부분입니다2023-12-28 11:29:08.692 WARN 11440 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "drop table if exists user CASCADE " via JDBC Statement
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
계속 버전을 바꿔줘야되는게 맞는건가요
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]오류가 나올때마다 구글링을 하여 해결하고 있는데,점점 버전을 제가 스스로 내려야 사용이 가능이 되네요, 이게 맞는걸까요
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
스프링부트 다운받은뒤 오류가 나와 혼자 수정해 보았습니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]인프런 질문 게시판에는 스프링부트 3.0 이상을써라 3.0 이상이면 jdk 17 이상 써야된다 하셔서 3.0 이상으로 다운도 받았고 버전도 21로 사용하고 있는데, A problem occurred configuring root project 'hello-spring'.> Could not resolve all files for configuration ':classpath'.> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.1.Required by:project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.1> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but:- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 declares a library, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 declares a component for use during runtime, and its dependencies declared externally:- Incompatible because this component declares documentation and the consumer needed a library- Other compatible attributes:- Doesn't say anything about its target Java version (required compatibility with Java 8)- Doesn't say anything about its elements (required them packaged as a jar)- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.1 declares a library, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 declares a component for use during runtime, and its dependencies declared externally:- Incompatible because this component declares documentation and the consumer needed a library- Other compatible attributes:- Doesn't say anything about its target Java version (required compatibility with Java 8)- Doesn't say anything about its elements (required them packaged as a jar)- Doesn't say anything about org.gradle.plugin.api-version (required '8.5')* Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.> Get more help at https://help.gradle.org.이런 오류가 나와서build.gradle 에서플러그인을 id 'org.springframework.boot' version '2.6.3'로 바꿨고dependencies 에implementation 'org.springframework.boot:spring-boot-starter'를 추가하였더니 오류는 안나더군요이렇게 해결하는게 맞는건가요?그럼 스프링부트 버전이 3.0 이상이 아닌 2.6.3버전을 사용하게 되는건데 괜찮은건가요?
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
JPA @Transactional
[질문 내용]JPA 기술을 사용할 때 리포지토리 계층에 @Transactional을 붙여줘야 한다고 말씀해주셨는데 MemberRepository 코드에서는 JPA를 사용하는데 왜 @Repository만 붙여주는 건가요??
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
[최대 길이 연속부분수열] 틀린 이유
import java.util.*; class Main { public int solution(int n, int m, int[] arr) { int lt = 0, sum = 0, max = 0, count = 0; for(int rt = 0; rt < n; rt++) { if(arr[rt] == 1) { sum += arr[rt]; } else if (arr[rt] == 0) { if(count++ < m) { sum += 1; } else { if (sum >= max) { max = sum; sum = 0; lt ++; rt = lt; count = 0; } } } } return max; } public static void main(String[] args) { Main T = new Main(); Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++) { arr[i] = in.nextInt(); } System.out.print(T.solution(n, m, arr)); } }논리적으로 틀린건 없는거 같고, 예시코드도 틀린게 없는데 왜 오답이 나오는지 모르겠습니다 !!
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
Hello 클래스 접근제한자
해당 부분 메세지 관련하여 알아본 내용으로는, Hello 클래스를 선언할 때 접근제한자가 생략되어 private으로 취급되는데 helloApi 메소드는 public이어서 private 클래스가 외부로 노출되어 뜨는 경고라고 합니다. 이 내용이 맞는 것인지, 맞다면 해당 방식의 작성법은 문제점이 있을 수 있는 방식인지 답변 부탁드립니다.
-
미해결김영한의 자바 입문 - 코드로 시작하는 자바 첫걸음
매서드에서 void가 쓰이는 경우
=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 메서드에서 반환타입이 없어서 void를 쓰는경우(return을 쓸 필요 없는 경우)는 메서드가 출력문 system.out.println("내용");으로만 이루어진 경우 뿐 인가요?
-
해결됨김영한의 자바 입문 - 코드로 시작하는 자바 첫걸음
[코드]섹션 4 조건문_문제와 풀이1에 3번 풀이 궁금합니다.
안녕하세요 선생님.코드 작성에 궁금한 점이 있어 질문드립니다.하기 선생님께서 작성하신 코드는 int won을 else 블록으로 구별해서 진행하셨는데 제가 코드를 작성하다보니, int dollar 밑에 int won을 새로 작성, 표기하였습니다.해당 부분은 크게 상관이 없는 부분일까요? 궁금합니다! **선생님 작성 코드 public class ExchangeRateEx { public static void main(String[] args) { int dollar = 10; if (dollar < 0) { System.out.println("잘못된 금액입니다."); } else if (dollar == 0) { System.out.println("환전할 금액이 없습니다."); } else { int won = dollar * 1300; System.out.println("환전 금액은 " + won + "원입니다."); } } } **제가 작성한 코드public static void main(String[] args) { int dollar = 10; int won = 1300 * dollar; if (dollar < 0 ) { System.out.println("잘못된 금액입니다."); } else if (dollar == 0 ) { System.out.println("환전할 금액이 없습니다."); } else { System.out.println("환전 금액은 " + won + "원 입니다."); }
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
lettuce에서 lock할 때 동시성 문제
안녕하십니까 lettuce 라이브러리를 사용해서 lock을 할 때 redisLockRepository.lock(key)로 redis에 key값을 확인 하잖아요 동시에 여러서버에서 lock을 걸 때 저 코드에서는 동시성 문제가 안생기나요?
-
미해결자바 기초부터 마스터하기 with 은종쌤 (Do it 자바 프로그래밍 입문) - Part 2(마스터편)
섹션 1 - 1 equals 재정의 하면 왜 hashcode도 재정의 해야하는지..
섹션 1 - 1 강의 내용.왜 equals 재정의 했다면 왜 hascode 도 재정의 해야하는지 이해가 되지 않습니다.
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
테스트 케이스 하나가 오답인데 어떤 부분이 문제인지 모르겠습니다ㅠ
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; class Main { public static void main(String[] args) throws IOException { Main T = new Main(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1 = br.readLine(); String str2 = br.readLine(); System.out.println(T.solution(str1, str2)); } public static String solution(String str1, String str2) { HashMap<Character, Integer> map1 = new HashMap<>(); HashMap<Character, Integer> map2 = new HashMap<>(); for (char x : str1.toCharArray()) { map1.put(x, map1.getOrDefault(x, 0) + 1); } for (char x : str2.toCharArray()) { map2.put(x, map2.getOrDefault(x, 0) + 1); } String answer = ""; for (char x : map1.keySet()) { if (map1.containsKey(x) == map2.containsKey(x)) { if (map1.get(x) == map2.get(x)) answer = "YES"; else answer = "NO"; } } return answer; } }테스트케이스 하나를 통과하지 못하는데 제가 생각하지 못한 부분이 있는지 궁금합니다!코드가 효율적이지 않을 수는 있으나 저렇게 해도 풀리지 않을까? 해서 작성해봤는데.. 뭐가 문제일까요테스트 케이스ABCDqtqtqEFqGHIJKLMNOPQRSTUVWetagdgXYabcdefghijklmnopqrstuwxyzaBcdewrqwtqFghIJklMnOpqrsTuegagaeVxyYAbCDEfGHijKLmNoPQRStUwWXz
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
앞으로의 방향
[질문 내용]안녕하세요!! 우선 좋은 강의 만들어주셔서 너무 감사합니다! 이번 강의도 정말 잘 들었습니다!! 저는 자바 입문, 실전 자바 기본편을 듣고 이번 스프링 입문 강의를 완강했습니다. 이전에는 자바에 대해 책으로 공부하고 강의를 통해 이해하는데 큰 어려움이 없었지만 스프링은 처음이라 많이 헤매는 느낌을 받습니다. 궁금한 점은 헤매는 느낌을 받는 이유는 자바에 대한 이해가 부족해서 인지 스프링에 대한 이해가 부족해서 인지 알고싶습니다. 또한 제 계획은 24년도 상반기에 나올 자바 중급,고급 강의를 듣고 스프링 완전정복 강의를 듣고 토이프로젝트를 통해 실력을 향상시키는 것이 목표입니다. 이 방향성이 괜찮은지 아니면 어떤 방향으로 나아가야하는지 조언 부탁드립니다.!! 처음 자바를 공부하고 너무나도 헷갈리고 어려운 순간들이 많았는데 김영한 선생님의 강의를 듣고 나름대로 발전한 것 같아서 항상 감사하고 있습니다. 양질의 강의를 제공해주셔서 감사합니다 !! 24년도 잘 부탁드립니다!!
-
해결됨스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
순수 jdbc 강의에서 H2 database적용 후, 회원목록 조회에서 Whitelabel 오류가 뜹니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.2023-12-27T19:46:31.932+09:00 ERROR 20716 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.IllegalStateException: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection] with root cause 강의를 따라하면서 진행하다가 페이지에서 회원목록으로 들어가면 Whitelabel 오류가 뜹니다. 혹시 위 오류가 어떤 이유에서 나는지 알 수 있을까요??
-
미해결스프링 시큐리티
csrf 문의
헤더에 토큰 값 주고 브레이크 포인트 잡았는데요..actualToken이 null 입니다ㅜㅜ 왜 그러는 걸까요?
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
em.getReference() 이후에 em.find()를 해도 둘다 프록시 객체가 나오는 이유가 궁금합니다.
예전에 영속성 컨텍스트 강의를 들을 때는 JPA는 동일성을 보장하기 위해 같은 엔티티 타입과 PK로 조회를 하면 1차 캐시에 그 값이 있으면 반환된 객체도 동일하다고 배웠습니다. 이것과 마찬가지로, em.getReference(Member.class, member1.getId()) 로 DB로부터 조회하지 않고 참조값만을 가져와도 1차 캐시에 그 값이 올라오는건가요? 그래서 이후에 em.find(Member.class, member1.getId())를 해도 프록시 객체가 반환된 이유가 1차 캐시에 있는 참조값을 그대로 조회해서 그런가요?
-
미해결더 자바, Java 8
기본 인터페이스의 기본 제공 메서드 관련 질문 (왜 이걸 사용하는지)
강의 내용에서 Function 인터페이스의 compose, andThen 등을 설명해주셨습니다.함수 간 Param 을 전달하고, 함수 실행 순서를 위한 것이라면 아래 제 코드처럼 사용해도 될 것 같은데, 왜 이 메서드를 사용하는지가 궁금합니다! (차이가 있는지도) plusTen.compose(multiplyTwo).apply(20); // 제공된 메서드를 사용한 것과plusTen.apply(multiplyTwo.apply((20))); // 순서에 맞게 다음과 같이 작성한 것의 결과의 차이는 없는것 같은데, 내부적인 차이가 있는지
-
미해결즐거운 자바
강의 교안
안녕하세요! 혹시 강의 교안은 따로 제공되지 않을까요?!