월 26,400원
5개월 할부 시다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
30장 코드수정하니 run오류가 납니다..
오류를 해석하려햇는데 book쪽에서 뭔가 오류인것같은데 수정하고 강사님 코드를 붙여넣어봐도 같은 오류가 나오네요.. 혹시 어떤오류인지 알 수 있을까요?Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2024-03-19 16:21:44.681 ERROR 42249 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.group.libraryapp.domain.book.Book at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6] at com.group.libraryapp.LibraryAppApplication.main(LibraryAppApplication.java:11) ~[classes/:na] Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.group.libraryapp.domain.book.Book at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:266) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:211) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:772) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:225) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:239) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:282) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1460) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1494) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.24.jar:5.3.24] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.24.jar:5.3.24] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.24.jar:5.3.24] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.24.jar:5.3.24] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24] ... 16 common frames omitted 종료 코드 1(으)로 완료된 프로세스
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
26강 오류 질문
26강까지 내용을 모두 따라하고 실행하니 다음과 같은 오류가 뜹니다j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]o.s.boot.SpringApplication : Application run failed yml 설정도 잘 하고 mySql 버전도 맞는데 왜 오류가 날까요? ㅜㅜ
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
에러가 해결이 안돼요ㅜ
에러 : Parameter 0 of constructor in com.group.libraryapp.service.user.UserServiceV1 required a bean of type 'com.group.repository.user.UserJdbcRepository' that could not be found. 구글링해보니까 service, repository 등의 annotation이 빠져서 그렇다고 하는데 다 들어가있습니다ㅜ계속 문제가 해결안돼서 참고하라고 주신 코드로도 변경해봤는데 계속 동일한 문제가 뜨네요.. package com.group.libraryapp.service.user; import com.group.libraryapp.dto.user.request.UserCreateRequest; import com.group.libraryapp.dto.user.response.UserResponse; import com.group.libraryapp.dto.user.request.UserUpdatRequest; import com.group.repository.user.UserJdbcRepository; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserServiceV1 { private final UserJdbcRepository userJdbcRepository; public UserServiceV1(UserJdbcRepository userJdbcRepository) { this.userJdbcRepository = userJdbcRepository; } public void saveUser(UserCreateRequest request) { userJdbcRepository.saveUser(request.getName(), request.getAge()); } public List<UserResponse> getUsers() { return userJdbcRepository.getUsers(); } public void updateUser(UserUpdatRequest request) { if (userJdbcRepository.isUserNotExist(request.getId())) { throw new IllegalArgumentException(); } userJdbcRepository.updateUserName(request.getName(), request.getId()); } public void deleteUser(String name) { if (userJdbcRepository.isUserNotExist(name)) { throw new IllegalArgumentException(); } userJdbcRepository.deleteUser(name); } } package com.group.repository.user; import com.group.libraryapp.dto.user.response.UserResponse; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import java.util.List; @Repository public class UserJdbcRepository { private final JdbcTemplate jdbcTemplate; public UserJdbcRepository(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } public boolean isUserNotExist(long id) { String readSql = "SELECT * FROM user WHERE id = ?"; return jdbcTemplate.query(readSql, (rs, rowNum) -> 0, id).isEmpty(); } public void updateUserName(String name, long id) { String sql = "UPDATE user SET name = ? WHERE id = ?"; jdbcTemplate.update(sql, name, id); } public boolean isUserNotExist(String name) { String readSql = "SELECT * FROM user WHERE name = ?"; return jdbcTemplate.query(readSql, (rs, rowNum) -> 0, name).isEmpty(); } public void deleteUser(String name) { String sql = "DELETE FROM user WHERE name = ?"; jdbcTemplate.update(sql, name); } public void saveUser(String name, Integer age) { String sql = "INSERT INTO user (name, age) VALUES (?, ?)"; jdbcTemplate.update(sql, name, age); } public List<UserResponse> getUsers() { String sql = "SELECT * FROM user"; return jdbcTemplate.query(sql, (rs, rowNum) -> { long id = rs.getLong("id"); String name = rs.getString("name"); int age = rs.getInt("age"); return new UserResponse(id, name, age); }); } }package com.group.libraryapp.controller.user; import com.group.libraryapp.dto.user.request.UserCreateRequest; import com.group.libraryapp.dto.user.request.UserUpdatRequest; import com.group.libraryapp.dto.user.response.UserResponse; import com.group.libraryapp.service.user.UserServiceV2; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController //스프링 빈이 됨. 즉 jdbc에 의존하게됨 public class UserController { private final UserServiceV2 userService ; //@Quailifier("main")가 primary보다 더 앞선다. public UserController(UserServiceV2 userService){ this.userService = userService; } @PostMapping("/user") public void saveUser(@RequestBody UserCreateRequest request){ userService.saveUser(request); } @GetMapping("/user") public List<UserResponse> getUsers(){ return userService.getUsers(); } @PutMapping("/user") public void updateUser(@RequestBody UserUpdatRequest request){ userService.updateUser(request); } @DeleteMapping("/user") public void deleteUser(@RequestParam String name) { //query를 직접 사용해서 포스트맨으로 찾음 그래서 requestbody가 아니라 param을 씀userService.deleteUser(name); userService.deleteUser(name ); } }
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
질문있습니다.
강사님 안녕하세요.혹시 개인적인 질문이 있는데 메일 주소 하나 알 수 있을까요 ? 감사합니다.
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
45강 dev 연결 에러
java -jar build/libs/library-app-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev 2024-03-06 06:57:53.124 ERROR 3375 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-j-8.0.31.jar!/:8.0.31] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-j-8.0.31.jar!/:8.0.31] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) ~[mysql-connector-j-8.0.31.jar!/:8.0.31] at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448) ~[mysql-connector-j-8.0.31.jar!/:8.0.31] at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[mysql-connector-j-8.0.31.jar!/:8.0.31] at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]2024-03-06 06:34:35.506 WARN 24251 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadatacom.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.2024-03-06 06:57:53.140 ERROR 3375 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]2024-03-06 06:57:53.140 WARN 3375 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]2024-03-06 06:57:53.152 INFO 3375 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]2024-03-06 06:57:53.185 INFO 3375 --- [ main] ConditionEvaluationReportLoggingListener :Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2024-03-06 06:57:53.233 ERROR 3375 --- [ main] o.s.boot.SpringApplication : Application run failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 제 컴퓨터 mysql로 연결되어서 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 이런 에러가 나온 것 같은데 AWS에서 빌린 컴퓨터에서 mysql연결하려면 어떻게 해야하나요? 아니면 제 컴퓨터 mysql로 연결하고 진행하나요?
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
Entity 객체에 접근제어자로 protected를 사용하는 이유가 궁금합니다.
안녕하세요. 30강 강의를 수강하고 한가지 궁금한 점이 있어 질문드립니다.book 테이블에 매핑되는 Entitiy객체인 Book.java 클래스 생성 시 JPA 사용을 위해 기본 생성자를 넣어주는데 이때 접근 제어자를 protected를 사용하는 것을 확인했습니다.protected 접근 제어자가 본래 상속관계에 있는 객체에 접근할 때 쓰는 것으로 알고 있는데 BookRepository 인터페이스가 JpaRepository를 상속받고 Map 구조에 Book이 들어가서 protected를 사용하는 것인지 궁금합니다.또한 protected 접근 제어자 외에 public, default 접근 제어자를 사용해도 되는 것인지 궁금합니다.
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
기타 질문
워밍업 통해 너무 잘 듣고 있습니다😊강의 관련 질문은 아니고 기타적인 질문인데요혹시 이 강의의 후속강의나 스프링 백엔드 관련 강의 더 내실 계획은 없으신가요?강사님 강의 더 듣고 싶어서요..!
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
Jpa 데이터베이스 매칭 관련 질문입니다.
안녕하세요 강사님.인프런 스터디 과제 7일차 문제 1번 jpa 코드로 변환하던 중 warehousingDate 컬럼 부분에서 문제가 발생하였습니다.Fruits의 테이블 컬럼 이름은 warehousingDate 입니다. { "name":"바나나", "warehousingDate":"2024-02-25", "price":7000 }jpa 코드로 바꾼 후 위에처럼 post 하였더니 아래와 같은 결과가 나왔습니다.Unknown column warehousing_date in field list라고 에러가 뜹니다. 처음에는 @Column(name="warehousing_date") 을 붙이지 않아서 에러가 나는 줄 알고 @Column(name="warehousing_date") 을 붙이고도 진행하였더니 똑같은 에러가 발생하였습니다.그래서 Fruits 앤티티 warehousingDate 변수명을 warehousing_date로도 변경을 해봤더니 똑같은 에러가 발생하였습니다. Fruits 엔티티는 아래와 같습니다.@Entity public class Fruits { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; @Column(name="warehousing_date") private LocalDate warehousingDate; private long price; @Column(nullable = true) private boolean sales; public Fruits() { } public Fruits(String name, LocalDate warehousingDate, long price, boolean sales) { this.name = name; this.warehousingDate = warehousingDate; this.price = price; this.sales = sales; } public String getName() { return name; } public void setName(String name) { this.name = name; } public LocalDate getWarehousingDate() { return warehousingDate; } public void setWarehousingDate(LocalDate warehousingDate) { this.warehousingDate = warehousingDate; } public long getPrice() { return price; } public void setPrice(long price) { this.price = price; } public boolean isSales() { return sales; } public void setSales(boolean sales) { this.sales = sales; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } }컨트롤러 코드는 아래와 같습니다.@PostMapping("/api/v1/fruit") public void fruitInformation(@RequestBody FruitCreateRequest information){ fruitService.saveInformation(information); }서비스 코드는 아래와 같습니다.private final FruitJpaRepository fruitRepository; public FruitService(FruitJpaRepository fruitRepository) { this.fruitRepository = fruitRepository; } public void saveInformation(FruitCreateRequest request){ fruitRepository.save(new Fruits(request.getName(),request.getWarehousingDate(), request.getPrice(), request.getSales())); }RequestDto 코드는 아래와 같습니다.public class FruitCreateRequest { private String name; private LocalDate warehousingDate; private long price; private boolean sales; @JsonIgnore private Long id; public String getName() { return name; } public void setName(String name) { this.name = name; } public LocalDate getWarehousingDate() { return warehousingDate; } public void setWarehousingDate(LocalDate warehousingDate) { this.warehousingDate = warehousingDate; } public long getPrice() { return price; } public void setPrice(long price) { this.price = price; } public void setSales(boolean sales) { this.sales = sales; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setId(long id) { this.id = id; } public boolean getSales(){ return sales; } } 혹여나 제가 놓친 부분이 없는 지 확인해 주시면 감사하겠습니다. 그리고 fruits 컬럼명은 warehousingDate 라 적었는 데 hibernate는 warehousing_date과 매칭할려는지 알고싶습니다.질문이 서투른 점 양해바랍니다..
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
entity 객체에 기본생성자를 넣어주는 이유
안녕하세요User객체에 기본생성자를 넣어야 작동하는 이유가 궁금합니다혹시 필드에 아무값도 넣지않을때를 대비해서 기본생성자를 사용하는건가요?
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
자바 스프링부트 버전 선택
스프링부트 버전이 2.7x 버전은 없는데 무엇으로 선택해야 하나요?
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
오류로 인해 실행 안됨
이 에러가 발생합니다.설정에서 Gradle을 jdk로 바꿔봤습니다.아래 3가지를 선택 취소 후 다시 선택했습니다.java 폴더 -> Sources Tab 선택test 폴더 -> tests Tab 선택resource 폴더 -> resource Tab 선택그래도 해결이 안되기에 이렇게 글을 적습니다. 해결: 우측 상단에 Main으로 되어있었는데 이것을 LibraryAppApplication으로 바꾸니 해결되었습니다.
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
@Configuration에 대해서 궁금합니다
안녕하세요@Configuration 과 @Bean은 세트라고 하셨는데요제가 프로젝트를 하나 하고있는데요implements WebMvcConfigurer를 구현하면메서드에 @Bean을 안붙여도 잘 동작을 하는데요 이유가 뭔지 궁금합니다..
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
아직도 시작을 못하고 있어요,,,,,
다음과 같은 오류가 나와서 어떻게 해야할 지 모르겠네요 따로 건든건 없는데요... A problem occurred configuring root project 'library-app'.> Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.1 > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but: - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a component, 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 11) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.1 declares a runtime of a library, 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 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a library, 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 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a component, 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 11) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.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.
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
자바 버젼이 안맞는거같은데 어떻게 해야할지 모르겠네요 ㅜㅜ
No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but:위와같은 오류가 나오면서 오류가 나서 그레이들이 멈추는데 해결을 못해서 강의 시작을 못하고 있어요 ㅠㅠ 어떻게 해야하나요
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
application.yml 포트번호
spring: datasource: url: "jdbc:mysql://localhost:3307/library" username: "root" password: "kimdh991234@" driver-class-name: com.mysql.cj.jdbc.Drivermysql을 설치할때 3306포트가 사용중이어서 설치가안되어서 3307로 포트를 설정하고 설치했더니 기존코드에서는 에러가 발생했습니다 그래서 포트번호를 달아줬더니 에러없이 동작하는데 3306포트로 동작하게 되면 생략이 가능한건가요?mysql 기본 포트세팅이 3306이어서 그런걸까요?
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
인텔리제 프로젝트 삭제와 프로젝트 실행 오류
5강을 듣다가 제 화면과 강사 선생님과 화면이 달라서 프로젝트를 삭제 했습니다. 그런 뒤 다시 프로젝트를 오픈했는데 저런 화면이 뜨면서 실행되지 않고 오류가 생깁니다.프로젝트를 삭제하고 캐쉬도 삭제 하고, 심지어 인텔리제이도 삭제해봤는데 여전히 저런 화면이 뜹니다. 어떻게 해야되나요?
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
강의 내용을 따라가던 도중에 의문이 생겨서 질문드립니다.
안녕하세요. 태현님, 좋은 강의 감사합니다. 오늘 BookService 코드를 같이 타이핑하던 도중 의문이 생겼습니다. 뭔가 점점 BookService에서 의존을 주입받는 레포지토리가 점점 늘어나고 있음이 그 원인이었는데요. 보통 커머스 서비스의 앱에서 주문 상세 버튼을 누르면 다음과 같은 정보들이 나오는데요.가게 정보메뉴 정보,주문 자체의 정보(주문 일시, 주문번호)메뉴와 옵션 선택 정보쿠폰 적용 주문자의 개인정보(주소 및 연락처)등등.. 물론 내부적으론 어떻게 해결이 되어있겠지만 벌써 주문 상세를 보여주는 기능을 처리하기 위한 서비스에서 엄~청 많은 레포지토리를 가져와야할 것 같은? 느낌이 듭니다. 이런 경우엔 의존 주입을 받는 객체의 갯수의 상한선을 따로 두고 개발하실까요?아니면 이런 문제를 해결하는 방법론 같은 것이 이미 있나요?혹은 제 생각엔 짤막하게 배운 디비 지식으로 주문과 같은 것은 반정규화로 테이블을 합쳐서 그 테이블과 대응되는 하나의 레포지토리로만 가져오나요?감사합니다.
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
이미지 조회 404
리액트로 이미지를 조회하려는데 자꾸 404 Not Found가 반환되요.포스트맨으로 동일한 조건으로 요청을 하면 제대로 이미지가 반환이 되네요. async function getIamge(filename){ await axios.get(`http://localhost:8080/imageFiles/${filename}`) .then((action)=>{ let data = action.data; let copy = [...images,data]; setImages(copy); }) .catch((error)=>{ console.log('서버 응답 코드:', error.response.status); console.log('서버 응답 데이터:', error.response.data); console.log('서버 응답 헤더:', error.response.headers); }) }이런식으로 요청을 했습니다. img태그로 직접 엔드포인트로 요청을 보냈을 때도 똑같은 상황입니다. @GetMapping("/imageFiles/{filename}") @CrossOrigin(origins = "*") public ResponseEntity<Resource> downloadExecute(@PathVariable("filename") String filename) throws IOException { log.info("Full Path = {}", fileDir + filename); String str = URLEncoder.encode(filename, "UTF-8"); Path path = Paths.get(fileDir + filename); Resource resource = new InputStreamResource(java.nio.file.Files.newInputStream(path)); System.out.println("resource : "+ resource.getFilename()); return ResponseEntity.ok() .header(HttpHeaders.CONTENT_TYPE, "application/octect-stream") .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename="+str+";") .body(resource); }이미지를 보내주는 서버측 엔드포인트입니다. @Configuration public class CorsMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") //.allowedOrigins("http://localhost:3000") .allowedOrigins("*") .allowedMethods( HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.HEAD.name(), HttpMethod.PUT.name(), HttpMethod.DELETE.name() ); registry.addMapping("/imageFiles/**") .allowedOrigins("*") .allowedMethods( HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.HEAD.name(), HttpMethod.PUT.name(), HttpMethod.DELETE.name() ); } } cors설정도 해봤는데 결과는 똑같았습니다. 뭐가 문제일까요 ㅠ
- 미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
PATCH와 PUT의 차이점
14강 유저 업데이트 부분에서 PATCH가 아닌 PUT을 사용하는 이유가 궁금합니다!! 제가 알기로는 PATCH는 일부 수정이 가능하고, PUT은 완전 덮어쓰기라고 알고 있는데, PATCH가 아닌 PUT을 사용하는 이유가 무엇인가요?? 만약 PATCH 사용이 불가능한게 아니라 가능할 경우 코드가 어떻게 되는지도 궁금합니다! 항상 감사합니다!!
- 해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
13강 마지막 부분 질문 있습니다.
제가 람다식, 익명클래스, 제네릭에 대한 개념이 확실하게 안 잡혀서 코드이해가 너무 안 되길래 개념부터 다시 찾아보고 공부하고 있는데요 ㅠㅠㅠ 이렇게 공부하는 게 조금 과할 수 있지만 완벽하게 이해를 하고 넘어가고 싶습니다.제가 궁금한 점은query함수를 실행하면 sql이 적용된 결과데이터베이스 전체가 mapRow함수의 파라미터 rs로 들어가게 되는 것 같은데 데이터베이스의 자료형이 ResultSet인가요?rowNum 변수의 필요성입니다. mapRow메서드를 오버라이딩을 해줄 때 rowNum사용을 전혀 안 하고 있는 것 같은데, 어떤 값이 rowNum으로 들어가고 어떻게 작동하는 건가요?mapRow메서드의 반환값은 UserResponse객체 형태인데 결과적인 getUsers메서드의 반환값이 어떻게 List<UserResponse> 형태로 변환될 수 있나요? query함수의 역할인가요?감사합니다.