묻고 답해요
160만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 강의 후 개인적으로 학습 시 나타나는 NPE관련 질문드립니다.
안녕하세요! 강의를 완강 후 혼자 프로젝트를 진행하다 도서 대출 코드를 보고 비슷하게 구현한 사용자가 채용공고를 지원하는 메소드를 호출시 테스트 코드에서 NPE가 발생하는데 혹시 이유를 알 수 있을까요? 여러가지 서칭해봐도 해결이 안되서 질문드립니다... ㅠㅠ회원entity@Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "users") @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "user_id") private Long id; private String name; @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true) private List<ApplyHistory> applyHistory = new ArrayList<>(); public void applyCompany(JobPosting jobPosting) { this.applyHistory.add(new ApplyHistory(this, jobPosting)); } @Builder private User(Long id, String name, List<ApplyHistory> applyHistory) { this.id = id; this.name = name; this.applyHistory = applyHistory; } }ApplyHistory entity(JobPosting과 user객체가 N:M 매핑해주는 entity)@Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "apply_history") @Entity public class ApplyHistory { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "apply_history_id") private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private User user; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "job_posting_id") private JobPosting jobPosting; public ApplyHistory(User user, JobPosting jobPosting) { this.user = user; this.jobPosting = jobPosting; } } JobPosting Entity@Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "job_posting") @Entity public class JobPosting { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "job_posting_id") private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "company_id") private Company company; @Column(name = "posting_position") private String position; private int compensation; //채용보상금 @Column(name = "posting_details") private String postingDetails; @Column(name = "technology_used") private String technologyUsed; @Builder private JobPosting(Company company, String position, int compensation, String postingDetails, String technologyUsed) { this.company = company; this.position = position; this.compensation = compensation; this.postingDetails = postingDetails; this.technologyUsed = technologyUsed; } public void updateJobPosting(String position, int compensation, String postingDetails, String technologyUsed) { this.position = position; this.compensation = compensation; this.postingDetails = postingDetails; this.technologyUsed = technologyUsed; } } applyService@RequiredArgsConstructor @Service public class ApplyService { private final JobPostingRepository jobPostingRepository; private final UserRepository userRepository; private final ApplyHistoryRepository userJobPostingRepository; @Transactional public void applyCompany(ApplyCompanyRequest request) { // 1. 채용공고 정보 찾기 JobPosting jobPosting = jobPostingRepository.findById(request.getJobPostingId()) .orElseThrow(() -> new ResourceNotFoundException("jobPosting", request.getJobPostingId())); // 2. 유저 정보 가져오기 User user = userRepository.findById(request.getUserId()) .orElseThrow(() -> new ResourceNotFoundException("user", request.getUserId())); // 3. 지원 유무 확인 // 3-1. 지원 중이면 예외 발생 if (userJobPostingRepository.existsByJobPostingAndUser(jobPosting, user)) { throw new IllegalArgumentException("이미 지원하신 회사입니다."); } user.applyCompany(jobPosting); } } 리퀘스트@Getter @Setter public class ApplyCompanyRequest { private Long jobPostingId; private Long userId; } 서비스 테스트 코드@SpringBootTest class ApplyServiceTest { @Autowired JobPostingService jobPostingService; @Autowired ApplyService applyService; @Autowired JobPostingRepository jobPostingRepository; @Autowired UserRepository userRepository; @Autowired ApplyHistoryRepository applyHistoryRepository; @Autowired CompanyRepository companyRepository; @AfterEach void tearDown() { applyHistoryRepository.deleteAllInBatch(); jobPostingRepository.deleteAllInBatch(); userRepository.deleteAllInBatch(); companyRepository.deleteAllInBatch(); } @DisplayName("사용자는 채용 공고를 지원 할 수 있다.") @Test @Transactional void applyCompany() { //given User user = User.builder() .id(1L) .name("jw") .build(); User savedUser = userRepository.save(user); Company company = Company.builder() .name("company1") .country(Country.KOREA) .city(City.SEOUL) .build(); Company savedCompany = companyRepository.save(company); JobPosting jobPosting = JobPosting.builder() .company(savedCompany) .position("백엔드") .postingDetails("백엔드 개발자 채용합니다.") .compensation(500000) .technologyUsed("Java") .build(); JobPosting savedJobPosting = jobPostingRepository.save(jobPosting); ApplyCompanyRequest request = new ApplyCompanyRequest(); request.setUserId(savedUser.getId()); request.setJobPostingId(savedJobPosting.getId()); //when applyService.applyCompany(request); //then } } -> 이부분에서 applyCompany(request) 호출 시 NPE가 발생합니다.java.lang.NullPointerException at com.wanted.findjob.domain.user.User.applyCompany(User.java:36) at com.wanted.findjob.api.service.ApplyService.applyCompany(ApplyService.java:39) at com.wanted.findjob.api.service.ApplyService$$FastClassBySpringCGLIB$$2f4064b0.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707) at com.wanted.findjob.api.service.ApplyService$$EnhancerBySpringCGLIB$$81701d47.applyCompany(<generated>) at com.wanted.findjob.api.service.ApplyServiceTest.applyCompany(ApplyServiceTest.java:83) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) 테스트코드가 아닌 직접 서버를 작동해서 api를 호출 시 정상적으로 db에 들어가는 걸 볼 수 있는데 어디가 문제 인지를 모르겠습니다.. ㅠ
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
스토리지 게이트웨이를 사설망으로 구성할 수 있나요?
안녕하세요. 수업 잘 듣고 있습니다. 다이렉트 커넥트로 연결된 폐쇄망에서 스토리지 게이트웨이를 사용할 수 있을지 궁금합니다. https://docs.aws.amazon.com/filegateway/latest/files3/gateway-private-link.html#create-vpc-endpoint 사설망으로 구성된 VPC에 VPC 엔드포인트를 만들어서 연결할 수 있는 것처럼 보이는데 공용ip 설정하지 않고 온프렘과 S3를 스토리지 게이트웨이를 거쳐서 다이렉트 커넥트로 연결할 수 있는 건지 궁금합니다.
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
안녕하세요!
혹시 시즌3 자료는 받을수 없을까요?!
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
SecurityFilterChain 서블릿 매핑 오류 관련...
@Beanpublic SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception{return http.authorizeHttpRequests().requestMatchers("/auth/login").permitAll() .anyRequest().authenticated() .and().csrf(AbstractHttpConfigurer::disable) .build(); }기존의 강의에 나온 위 코드를 실행하게 되면, This is because there is more than one mappable servlet in your servlet context: {org.springframework.web.servlet.DispatcherServlet=[/], org.h2.server.web.JakartaWebServlet=[/h2-console/*]}.위와 같은 DispatcherServlet과 h2-console의 서블릿이 하나 이상 매핑되어 나는 오류라고 나옵니다.@Bean public SecurityFilterChain securityFilterChain(HttpSecurity http, HandlerMappingIntrospector introspector) throws Exception{ http.authorizeHttpRequests((authz) -> { try { authz .requestMatchers(new MvcRequestMatcher(introspector,"/auth/login")).permitAll() //애는 권한 없이도 허용 .anyRequest().authenticated() //나머지는 인증해 .and() //csrf쪽으로는 builder가 이어지지 않기 때문에 and로 이어준다. .csrf(AbstractHttpConfigurer::disable); } catch (Exception e) { throw new RuntimeException(e); } }); return http.build(); }그래서 검색 결과 위와 같이 작성하게 되면 정상적으로 실행되게 됩니다.- 질문제가 코드를 기존에 SecurityFilterChain 외 잘못 작성한 부분이 존재해서 위와 같이 코드를 작성해야 하는 것인지, 아니면 그 사이에 이렇게 작성되도록 변경된 것인지 앞으로도 지속적으로 검색해보겠지만... 현재까진 답을 찾지 못해 질문드립니다.2. h2-console의 경우 데이터베이스 관련 서블릿이고, DispatcherServlet은 웹 애플리케이션의 컨트롤러 역할을 하는 서블릿인걸로 알고 있는데 용도가 다른 두 서블릿의 매핑 혼동이 일어나는 이유가 궁금합니다...*무지한 한 생명체의 질문은 천천히 쾌차하시고 삶의 여유를 되찾으신 다음 답변해주시면 감사하겠습니다!
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
실전문제풀이6 8번
기본 db 인스턴스가 대충 뭔지는 알겠어요. 복제본들의 원본인거 같아요. 근데 단일 db 인스턴스는 무슨 차이가 있나요?단일 db 인스턴스로 생성하면 db 인스턴스 클러스터는 생성되지만 복제본이 만들어지지 않나요?단일 db 인스턴스와 기본 db 인스턴스는 복제본 및 오프로드 차이 뿐인가요?
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
안녕하세요. 수강 기간 연장 가능할까요?
10월 말에 시험을 잡아놓고 준비하고 있었는데 회사 업무로 바빠져서 부득이하게 연장을 요청드리고 싶습니다.확인 후 조치해주시면 감사드리겠습니다 ㅠㅠ
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
VPC NACL 관련 질문이 있습니다.
EC2 웹서버 운영시 외부에서 Client가 접속 후 리턴 트래픽을 받을 때 NAT를 사용하므로 임시포트 1024-65535를 사용-> 이라고 설명해주셨는데 publicIP 를 privateIP 로 전환해주는 1:1 NAT 말고 다른것을 이야기하는건가요? 잘 이해가 안됩니다. 리턴 트래픽을 받을때는 목적지 포트가 클라이언트가 요청을 보낸 프로세스의 포트일테고, 해당 포트를 허용해주면 되는거아닌가요? NAT 가 왜 나오는지 잘 이해가 안됩니다.
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
수강기간 연장 부탁드립니다.
올해 안에 합격하기에 남은 수강기간이 빠듯하여 수강기간 연장 부탁드립니다.
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
lombok 관련 오류입니다
BookService에서 @RequiredArgsConstructor을 설정하면책 대출, 책 반납 등 BookRepository를 사용하는 코드에서 에러가 발생합니다. 오류 메시지는 "this.bookRepository" is null입니다. BookService에서 bookRepository가 받아오지 못하는 것 같습니다.또한, 해당 어노테이션을 지운 후 생성자로 변경하면, 코드는 정상적으로 돌아가게 됩니다. Lombok의 문제인 건지, 코드의 특정 부분을 설정하면 되는 것인지 궁금합니다.
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
Instance has not sent any data since launch.
Instance has not sent any data since launch. -> 이 에러만 뜨고있어요 ㅠㅠ 왜 EC2를 못킬까요..?
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
38강 Cannot load driver class: org.h2.driver
안녕하십니까. 다름이 아니라 profile을 local로 실행 시 오류가 나서 질문을 드립니다. 인텔리제이 Community 버전이라서VM option 추가 후, -Dspring.profiles.active=local를 입력헀습니다. 실행을 할때 local 프로필이 활성화가 되었다고 하지만 오류가 발생합니다. VM option이 잘못된건가 싶어서-Dspring.profiles.active=dev로 설정 시 MySQL이 정상적으로 작동합니다.즉 h2관련 코드를 제가 잘못작성했거나 아니면 다른이유로 오류가 발생한다는건데 문제점을 제대로 파악을 하기가 힘들어서 질문을 드립니다. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: org.h2.driverCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: org.h2.driverCaused by: java.lang.IllegalStateException: Cannot load driver class: org.h2.driverExecution failed for task ':LibraryAppApplication.main()'.> Process 'command 'C:/Program Files/Java/jdk-17/bin/java.exe'' finished with non-zero exit value 1* 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.
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
Elastic Beanstalk에 No Data로 나옵니다..
traivs에서는 아래와 같이 빌드에 성공했어요. 하지만 No Data라고 뜨는데 어떻게 해야할까요..
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
Elastic Beanstalk 환경생성 중 오류) 상태 Unkwon으로 변화가 없습니다
역할도 아래와 같이 변경했어요.업데이트가 되어야 하는데 변화가 없습니다.. 방법이 있을까요ㅠㅜ
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
@ConfigurationProperties 사용 시 질문 드립니다.
제가 아직 초보 개발자라 막연히 setter 사용은 지양하는게 좋다고 배워서 실무에서는 다른지 궁금합니다.setter 를 열어두면 빈으로 등록된 AppConfig 의 불변성을 보장할 수 없게 되는게 아닌가 해서 질문드립니다.https://mangkyu.tistory.com/189위 블로그를 보면 @ConfigurationProperties 를 setter 없이 생성자로 할 수도 있는것 같아서요.혹시 제가 너무 setter 사용을 지양하라는 말에 매몰돼있는건 아닐까 고민도 되네요.
-
해결됨AWS(Amazon Web Service) 입문자를 위한 강의
[4-5] RDS 실습 - 1부 수업자료
안녕하세요RDS 실습하니깐 안돼서 질문 쪽으로 와봤는데 버전이 바뀌면서 함수이름이 바뀐거같네요. 질문도 같은거 여러개라 그런데 수업자료도 같이 고쳐주실수있을까요?#!/bin/bashyum install httpd php php-mysql -yyum update -ychkconfig httpd onservice httpd startecho "<?php phpinfo();?>" > /var/www/html/index.phpcd /var/www/htmlwget https://aws-learner-storage.s3.ap-northeast-2.amazonaws.com/connect.php connect. php<?php$username = "awslearner";$password = "awslearner";$hostname = "yourhostnameaddress";$dbname = "awslearner";// connection to the database$dbhandle = new mysqli($hostname, $username, $password, $dbname);if ($dbhandle->connect_error) {die("MySQL에 연결할 수 없습니다: " . $dbhandle->connect_error);}echo "MySQL 접속 성공!<br>";// Later, when done with the database connection$dbhandle->close();?> yum install httpd php php-mysql -ywget https://aws-learner-storage.s3.ap-northeast-2.amazonaws.com/connect.php이부분 고쳐야하는건 알겠는데 마지막 줄은 어떻게 바꿔야할지 모르겠어요
-
해결됨AWS Certified Cloud Practitioner 자격증 준비하기
Elastic Beanstalk 오류나요
세부 항목도 달라졌고 무시하고 만드니까 이렇게 오류나네요.IAM에서 역할 삭제하고 만들어도 똑같아요
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
도메인 이름
강의에서 이세계의 집 주소 별칭을 현실 세계의 도메인으로 빗대어 설명해 주신 부분에 대한 질문입니다.1. 강의를 들을 때 '서울에 있는 컴퓨터' == 강의를 듣고 있는 내 노트북, '대전에 있는 컴퓨터' == 인프런 사이트의 서버 쯤으로 이해하는 게 맞을까요?처음에는 간단하게 친구 컴퓨터와 내 컴퓨터 사이의 카카오톡으로 데이터를 주고 받는 상황 으로 이해 헀는데, '대전에 있는 컴퓨터'의 주소에 도메인 이름이 붙는 걸 보니 이해가 안 가더라구요. 내 컴퓨터에 spring.com 이라는 주소 이름이 붙을리가 없으니까요.친구 컴퓨터와 내 컴퓨터 사이의 카카오톡 통신은 '친구 노트북와 카카오 서버와의 통신' + '카카오 서버와 내 노트북의 통신' 으로 나뉜다고 이해하는 게 맞을까요? 만약 위에서 카카오톡을 예시로 든 내용이 맞는 내용이라면 추가로 더 궁금한 게 있습니다.채팅 어플에선 어떤 HTTP Method를 사용하나요? 내가 친구에게 카톡을 보낸다면 POST 같은 메소드를 쓸 수 있을 것 같긴한데, 그건 내가 '보내기' 버튼을 이용해서 카카오 서버에 요청하는 것으로 생각해봤습니다. 그런데 친구에게서 오는 카톡은 어떻게 나에게 오는 건지는 도무지 생각이 나질 않습니다. 내 컴퓨터에서 카톡 서버에 실시간으로 계속해서 GET과 같은 메소드로 요청을 하는 것은 아닌 것 같아서요. 카카오와 같은 서버가 내 컴퓨터로 요청하는 경우가 있다면, 내 컴퓨터는 따로 도메인 주소를 갖고 있지 않으니 그냥 내 컴퓨터 IP를 사용하나요?
-
해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
workspace.xml 파일에 대한 질문 (.gitignore)
강의를 따라 하면서 단계마다 깃에도 커밋을 하고 있는데요코드가 변경될 때마다workspace.xml라는 파일은 건들지 않았는데도 계속 변경이 되어서 깃에 감지가 되더라구요.ChatGPT 한테 물어보니까 "이 파일에는 개발 환경 설정과 관련된 정보가 포함되어 있으며, 이 정보는 다른 개발자나 다른 컴퓨터에서는 필요하지 않을 수 있습니다."라고 하고 깃에 안 올려도 된다고 하길래 .gitignore 에 .idea/workspace.xml이렇게 추가를 해줬는데도 자꾸 깃에 감지가 됩니다.혹시 .gitignore에 추가했다고 바로 적용이 안되는 건지, 적용하는 방법이 따로 있는지 궁금합니다.
-
해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
예외 처리에 대한 질문입니다.
안녕하세요 강사님. 15강. 유저 업데이트 API, 삭제 API 예외 처리 하기유저 업데이트 API, 삭제 API 에 예외 처리해 주는 부분을 수강 중인데요 궁금한 점이 있어서 질문 남깁니다. 존재하지 않는 사용자에 대해서 수정하거나 삭제하려는 상황에 대해서 예외 처리를 해주고 있는데,'존재하지 않는 사용자에 대해서 수정하거나 삭제하려는 경우'가 포스트맨을 이용하여 요청할 때는 일어날 수도 있는 경우겠지만,사용자는 웹 UI를 이용해서 수정, 삭제하기 때문에 저런 경우가 아예 생기지가 않을 것 같은데,(화면에 보이는 유저 리스트에서 선택하여 수정하거나 삭제하기 때문에)그런데도 예외 처리를 해줘야 하는 이유가 있는지 궁금합니다.
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
34강 address_id 관련 질문 있습니다.
안녕하세요!Person 테이블 생성 시 adress_id bigint로 설정하였고, Person 클래스에는 private Address adress;를 사용하였습니다.DB에 Person을 저장할 때, 제 코드의 Unknown column 'address_id'라는 오류는 위의 차이에서 발생한 것 같습니다. 제가 놓치고 있는 부분이 궁금해서 문의드립니다!