inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

ExperienceRepositoryTest 실행 오류

해결됨

입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기

++++ 테스트파일에서 오타가 난 줄 알았는데 레포지토리 파일 모두 오타가 나있었네요!! 감사합니다!

  • kotlin
  • mysql
  • docker
  • spring-boot
  • jpa
ailen22 댓글 2 좋아요 0 조회수 160

2024년 2회 C언어 문자열 문의드립니다.

해결됨

(2026 최신!) 일주일만에 합격하는 정보처리기사 실기

#include <stdio.h> void strcopy(char d[], const char s[]) { int i = 0; while (s[i] != '\0') { d[i] = s[i]; i++; } d[i] = '\0'; } int main() { char str1[] = "first"; char str2[50] = "teststring"; int result = 0; strcopy(str2, str1); for (int i = 0; str2[i] != '\0'; i++) { result += i; } printf("%d\n", result); for (int i = 0; i < 10; i++) { printf("%c", str2[i]); } } 출력값: 10 first ring printf("%c", str2[i]); // first ring 이렇게 출력되었는데 while (s[i] != '\0') { d[i] = s[i]; i++; } d[i] = '\0'; 여기서 while타고 s[i]에 first 마지막인 t 가 들어가면 다음 배열이 들어가지않으니 d[i] = '\0'; 들어가고 firist\0 담기는게 아닌가해서 질문드립니다. 그래서 출력값이 first ring 이렇게 나오는게 맞을까요?

  • python
  • java
  • c
  • 정보처리기사
chcpower 댓글 2 좋아요 0 조회수 120

java -jar 버전 문제

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 위와 같은 에러가 뜹니다. 프로그램에서 java 11이나 jdk 11 버전은 모두 삭제되어 있습니다. (choco uninstall openjdk11 명령어 실행 시 openjdk11이 uninstall 되어있다는 fail이 뜸) 환경변수도 모두 17버전으로 맞춰놓은 상태입니다. ./gradlew build까지는 됐는데 java -jar 했을 때 오류가 납니다.

  • java
  • spring
  • mvc
  • spring-boot
정수진 댓글 3 좋아요 0 조회수 425

nav('/', { replace: true }); 뒤로가기 방지

해결됨

한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지

import Header from '../components/Header'; import Button from '../components/Button'; import Editor from '../components/Editor'; import { useNavigate } from 'react-router-dom'; import { useContext } from 'react'; import { DiaryDispatchContext } from '../App'; const New = () => { const nav = useNavigate(); const { onCreate } = useContext(DiaryDispatchContext); const onSubmit = (input) => { onCreate(input.createdDate.getTime(), input.emotionId, input.content); nav('/', { replace: true }); }; return ( <div> <Header title={'새 일기 쓰기'} leftChild={ <Button text={'< 뒤로 가기'} onClick={() => { nav(-1); }} /> } /> <Editor onSubmit={onSubmit} /> </div> ); }; export default New; 여기서 nav('/', {replace:true});로 뒤로가기(New 페이지로 가는 것)를 방지했는데, 뒤로가기를 한 번 눌렀을 때는 잘 동작하는데 두 번 눌렀을 때부터 뒤로 가집니다. 혹시 원래 이런건가요? 아니면 제가 뭔가 잘못한건가요?

  • javascript
  • react
  • node.js
양성준 댓글 2 좋아요 0 조회수 251

QUIZ8 질문입니다.

미해결

나도코딩의 자바 기본편 - 풀코스 (20시간)

package chap_08.camera; import chap_08.detector.AccidentDetector; import chap_08.detector.Detectable; import chap_08.reporter.Reportable; import chap_08.reporter.VideoReporter; public class SpeedCam extends Camera{ private Detectable detector; private Reportable reporter; public void setDetector(Detectable detector) { this.detector = detector; } public void setReporter(Reportable reporter) { this.reporter = reporter; } @Override public void showMainFearture() { System.out.println("속도 측정, 번호 인식"); } public void detect(){ this.detector.detect(); } public void report(){ this.reporter.report(); } public void setDetector(AccidentDetector accidentDetector) { } public void setReporter(VideoReporter videoReporter) { } } package chap_08; import chap_08.camera.SpeedCam; import chap_08.detector.AccidentDetector; import chap_08.reporter.VideoReporter; public class _Quiz_08 { public static void main(String[] args) { SpeedCam speedCam = new SpeedCam(); speedCam.setDetector(new AccidentDetector()); speedCam.setReporter(new VideoReporter()); speedCam.detect(); speedCam.report(); } } 전부 다 강의 보면서 쳤는데 저렇게 에러가 떠서요. 뭐가 문제일까요?

  • java
  • 객체지향
이승언 댓글 2 좋아요 0 조회수 105

graphql 에 이렇게 뜨는 버그 어떻게 해결할 수 있나요?

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

원래는 그렇지 않았는데 전부터 graphql 에서 api 테스트 해보려고 하면 아래에 항상 이런방식으로 글자 나타나고 사라지지 않더라고요.. 맥을 사용하고 있는데 이거 어떤 방식으로 해결할 수 있나요?

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
dasd 댓글 1 좋아요 0 조회수 199

projectRepository assertion 오류 질문입니다.

해결됨

입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기

projectRepositoryTest.kt 파일을 아래와 같이 작성했는데 assertion 오류가 나서 원인을 모르겠어서 해당 파일 코드 첨부합니다. 94줄과 111줄 오류인 걸로 보아 skills를 assert할 때 뭐가 잘못된 것 같은데 어떻게 고쳐야 하는지 잘 모르겠습니다..! package com.yewon.portfolio.domain.repository import com.yewon.portfolio.domain.constant.SkillType import com.yewon.portfolio.domain.entity.Project import com.yewon.portfolio.domain.entity.ProjectDetail import com.yewon.portfolio.domain.entity.ProjectSkill import com.yewon.portfolio.domain.entity.Skill import org.assertj.core.api.Assertions import org.assertj.core.api.Assertions.* //import com.yewon.portfolio.domain.entity.* //import org.assertj.core.api.Assertions.* import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInstance import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest @DataJpaTest @TestInstance(TestInstance.Lifecycle.PER_CLASS) class ProjectRepositoryTest( @Autowired val projectRepository: ProjectRepository, @Autowired val skillRepository: SkillRepository ) { val DATA_SIZE = 10 private fun createProject(n: Int): Project { val project = Project( name = "${n}", description = "테스트 설명 {n}", startYear = 2023, startMonth = 9, endYear = 2023, endMonth = 9, isActive = true ) val details = mutableListOf<ProjectDetail>() for (i in 1..n) { val projectDetail = ProjectDetail(content = "테스트 ${i}", url = null, isActive = true) details.add(projectDetail) } project.addDetails(details) val skills = skillRepository.findAll() val skillsUsedInProject = skills.subList(0, n) for (skill in skillsUsedInProject) { val projectSkill = ProjectSkill(project = project, skill = skill) project.skills.add(projectSkill) } return project } @BeforeAll fun beforeAll() { println("----- 스킬 데이터 초기화 시작 -----") val skills = mutableListOf<Skill>() for (i in 1..DATA_SIZE) { val skillTypes = SkillType.values() val skill = Skill(name = "테스트 ${i}", type = skillTypes[i%skillTypes.size].name, isActive = true) skills.add(skill) } skillRepository.saveAll(skills) println("----- 스킬 데이터 초기화 종료 -----") // println("----- 데이터 초기화 이전 조회 시작 -----") // val beforeInsert = projectRepository.findAll() // assertThat(beforeInsert).hasSize(0) // println("----- 데이터 초기화 이전 조회 종료 -----") println("----- 테스트 데이터 초기화 시작 -----") val projects = mutableListOf<Project>() for (i in 1..DATA_SIZE) { val project = createProject(i) projects.add(project) } projectRepository.saveAll(projects) println("----- 테스트 데이터 초기화 종료 -----") } @Test fun testFindAll() { println("----- findAll 테스트 시작 -----") val projects = projectRepository.findAll() assertThat(projects).hasSize(DATA_SIZE) println("projects.size: ${projects.size}") for (project in projects) { assertThat(project.details).hasSize(project.name.toInt()) println("project.details.size: ${project.details.size}") assertThat(project.skills).hasSize(project.name.toInt()) println("project.skills.size: ${project.skills.size}") } println("----- findAll 테스트 종료 -----") } @Test fun testFindAllByIsActive() { println("----- findAllByIsActive 테스트 시작 -----") val projects = projectRepository.findAllByIsActive(true) assertThat(projects).hasSize(DATA_SIZE) println("projects.size: ${projects.size}") for (project in projects) { assertThat(project.details).hasSize(project.name.toInt()) println("project.details.size: ${project.details.size}") assertThat(project.skills).hasSize(project.name.toInt()) println("project.skills.size: ${project.skills.size}") } println("----- findAllByIsActive 테스트 종료 -----") } }

  • kotlin
  • mysql
  • docker
  • spring-boot
  • jpa
w3w 댓글 1 좋아요 0 조회수 204

수업자료 오류

미해결

코로나맵 개발자가 알려주는 React + Express로 지도서비스 만들기 (Typescript)

보일러플레이트 코드 소개에 있는 수업자료를 다운받았는데 압축해제하려고 보니까 해제도 안되고 압축폴더에는 파일이 아무것도 없네요

  • react
  • node.js
  • mongodb
  • express
  • typescript
3400jkh 댓글 1 좋아요 0 조회수 183

함수 추출하기 부분에서 의도와 구현에 대해 질문 있습니다.

해결됨

코딩으로 학습하는 리팩토링

의도와 구현이 잘 이해가 가지 않아 예전에 작성 했던 코드를 가져와 아래와 같이 이해를 해볼려고 했는데 맞게 이해를 한건지 궁금합니다. save라는 네이밍으로 저장한다는 의미를 뜻함 -> 의도 코드 내부에는 DTO를 받아와 엔티티 객체로 변환하고 DB에 저장 로직 -> 구현 save 메서드 @Override public ServerMessageDto save(ServerMessageCreateRequest createRequest) { ServerMessage serverMessage = ServerMessage.builder() .serverId(createRequest.getServerId()) .channelId(createRequest.getChannelId()) .userId(createRequest.getUserId()) .parentId(createRequest.getParentId()) .profileImage(createRequest.getProfileImage()) .content(createRequest.getContent()) .writer(createRequest.getWriter()) .chatType(ChatType.SERVER) .actionType(ActionType.SEND) .files(createRequest.getFiles()) .build(); serverMessage.generateSequence(sequenceGenerator.generateSequence(ServerMessage.SEQUENCE_NAME)); return ServerMessageDto.from(messageRepository.save(serverMessage)); } postSend 라는 네이밍으로 ~ 후의 전송이라는 의미 -> 의도 코드 내부에는 특정 조건에 따라 함수 호출 로직 -> 구현 postSend 메서드 @Override public void postSend(Message<?> message, MessageChannel channel, boolean sent) { StompHeaderAccessor headerAccessor = StompHeaderAccessor.wrap(message); if (StompCommand.CONNECT.equals(headerAccessor.getCommand())) { Long userId = sendConnectionStateInfo(headerAccessor); sendConnectionStateEvent(userId); } if (StompCommand.DISCONNECT.equals(headerAccessor.getCommand())) { Long userId = saveDisconnectionState(headerAccessor); if (userId != null) { sendDisConnectionStateEvent(userId); } } }

  • java
  • intellij-idea
  • 리팩토링
감바스 댓글 1 좋아요 0 조회수 229

postgreSQL에 register server 할때마다 zcom db가 같이 생성됩니다

해결됨

Next + React Query로 SNS 서비스 만들기

전공자따라잡기 데이터베이스 공부중에 mysql 대신 이 강의 할때 깔았던 postgreSQL로 연습해보려고 하다가 질문드립니다 서버그룹 우클릭 -> register -> server 하면 사용자 이름으로 된 기본db와 함께 zcom이 항상 같이 생성되는데 이 zcom db 생성안되게 하려면 어떻게 해야하나요?

  • react
  • next.js
  • react-query
  • next-auth
  • msw
andante 댓글 1 좋아요 0 조회수 160

API 구축시 인텔리제이

미해결

코드로 배우는 React 19 with 스프링부트 API서버

안녕하세요 이제 시작해보려구하는데 ㅎㅎ API 구축시 인텔리제이 사용해도 문제없나요??

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
김우철 댓글 2 좋아요 0 조회수 124

Could not find or load main class –jar 에러 발생 건

해결됨

개발자를 위한 쉬운 도커

안녕하세요. 현재 아래 빨간색 부분 강의 실습을 진행중에 있습니다. root@873e7cd9bbae:/app# ls build/libs 이렇게 했을 때 아래 처럼 정상적으로 파일이 생성되었습니다. Leafy-0.0.1-SNAPSHOT.jar Leafy-0.0.1-SNAPSHOT-plain.jar 그 다음 아래와 같이 실행 했을 때 Error 가 발생했습니다. 주신 실습 파일 그대로 빌드했습니다. root@873e7cd9bbae:/app# java –jar build/libs/Leafy-0.0.1-SNAPSHOT.jar Error: Could not find or load main class –jar Caused by: java.lang.ClassNotFoundException: –jar 이경우 어디를 체크해 봐야 하는 건지요? 감사합니다.

  • docker
  • 가상화
  • ci/cd
  • docker-compose
  • github-actions
  • docker-volume
  • docker-image
  • container
사랑2 댓글 1 좋아요 0 조회수 225

JdbcMemberRepository implements와 findAll() @Override 오류

해결됨

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

[질문 내용] JdbcMemberRepository클래스를 만들고 코드를 복붙했으며, 대부분 오류나는 부분은 모두 import해서 없어졌지만, 해결되지 않은 부분이 2군데 있었습니다. java: hello.hello_spring.repository.JdbcMemberRepository is not abstract and does not override abstract method findAlL() in hello.hello_spring.repository.MemberRepository java: method does not override or implement a method from a supertype 12줄에 public class JdbcMemberRepository implements MemberRepository { 이 부분에서 빨간줄이 계속 표시되고, 71줄에 findAll()메소드에서 바로 상단에 @Override에 빨간줄이 뜹니다. 어떤 방식을 적용하든 계속 오류가 해결되지 않은데 어떻게 해야 좋을지 궁금합니다.

  • java
  • spring
  • mvc
  • spring-boot
댓글 1 좋아요 0 조회수 249

테스트코드 실행중 오류와 경고에 관한 질문 입니다.

해결됨

입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기

현재 강의는 ExperienceRepository코드를 테스트하는 코드인데 interface HttpInterfaceRepository : JpaRepository<HttpInterface, Long>{ fun countAllByCreatedDateTimeBetween(start: LocalDateTime, end: LocalDateTime): Long } 제가 이런식으로 HttpInterfaceRepoistory에 사용자 정의 메서드이름을 잘못 설정했어서 테스트 코드 실행중에 오류가 발생하여 이런식으로 실행이 안되었습니다. HttpInterfaceRepository와 관려 없는 코드 같은데 왜 오류가 발생하는 건가요? 그리고 저 오류를 발견해서 HttpInterfaceRepository 를 수정하고 실행을 하니 정상적으로 실행은 되었는데 이 경고가 뜹니다 이건 어떤건가요? 프로젝트 리포지토리 테스트가 계속 실패하는데 왜 그런건가요? https://drive.google.com/file/d/1s2JngsdGhN_iOUf6llkkcUwwISIuCTUp/view?usp=sharing 구글 드라이브에 소스코드 압축해서 업로드 했습니다

  • kotlin
  • mysql
  • docker
  • spring-boot
  • jpa
양치잘하기 댓글 2 좋아요 0 조회수 263

복습 질문하고 싶어요

미해결

김영한의 실전 자바 - 중급 1편

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예 [질문 내용] 현재 수강을 계속하면서 공부하고 있는데요 예를 들어 날짜와 시간 챕터를 다 보고 이제 복습을 하려고 하는데 PDF보면서 코드를 따라치면서 복습을 하고있는중입니다. 이렇게 복습하는게 효율적인가 궁금하고요. 한번보고 복습주기를 어느정도로 해야하는지도 알고 싶습니다.

  • java
  • 객체지향
코딩이 댓글 1 좋아요 0 조회수 195

상태관리 도구 추천 부탁드려도 될까요?

미해결

한 입 크기로 잘라먹는 Next.js

강의 너무 잘 듣고 있습니다. 현업에서 next.js 15 기반으로 큰규모의 프로젝트인 wms (창고관리 시스템)을 구현 예정중에 있습니다. mssql react18 / next14 typescript material UI 사용예정중에 있습니다. 혹시 위와 같은 프로젝트에서 추천해주실만한 상태관리 도구 가 있으실까요? redux, zustand, recoil 등 선택지가 많은데 선뜻 선택하기가 쉽지 않네요 ㅠ

  • react
  • typescript
  • next.js
suhyoun 댓글 3 좋아요 0 조회수 417

코드 오류시 참고하시면 될듯합니다.

미해결

처음 만난 리액트(React)

영상에 제시한 코드를 사용하면 아래와같은 오류가뜹니다 React 18에서는 ReactDOM.render 를 지원하지 않는다고 하네요.. 아래 코드로 수정하니 잘 됩니다 참고 하세요~

  • HTML/CSS
  • javascript
  • react
박태용 댓글 2 좋아요 0 조회수 508

sql distinct 질문

해결됨

자바 ORM 표준 JPA 프로그래밍 - 기본편

sql distinct는 완전히 같은 것의 중복을 제거해준다고 배웠습니다. id를 사용한다는 가정에서 완전히 같을 경우가 존재할 수 있나요? jpql distinct 키워드는 sql distinct에 더불어 엔티티 중복을 피하게 해주는데 sql distinct는 필요없는 과정이 아닌가 싶었습니다.

  • java
  • jpa
영한노게임 댓글 2 좋아요 0 조회수 320

Querydsl 버전 별 build.gradle 설정 파일에 대해 궁금한 점이 있습니다.

미해결

실전! Querydsl

자주 하는 질문 + 강의 자료를 종합해봤을 때 Querydsl 설정이 크게 다음 3가지로 나뉘는 것 같더라고요. 2.x 버전 / dependencies 바깥에 설정 plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.RELEASE' //querydsl 추가 id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" id 'java' } //querydsl 추가 시작 def querydslDir = "$buildDir/generated/querydsl" querydsl { jpa = true querydslSourcesDir = querydslDir } sourceSets { main.java.srcDir querydslDir } configurations { querydsl.extendsFrom compileClasspath } compileQuerydsl { options.annotationProcessorPath = configurations.querydsl } 2.x 버전 / dependencies 안에 설정 dependencies { //Querydsl 추가 implementation 'com.querydsl:querydsl-jpa' annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" } clean { delete file('src/main/generated') } 3.x 버전 / dependencies 안에 설정 dependencies { //Querydsl 추가 implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" } clean { delete file('src/main/generated') } 2.x 의 경우 선택지가 2가지가 되는 데 왜 강의에선 1번 케이스를 선택했던 건지 궁금합니다! 2번 선택지가 더 깔끔한 거 아닌가요 ?

  • java
  • jpa
수하 댓글 1 좋아요 0 조회수 167

인기 태그

인프런 TOP Writers

주간 인기글