월 15,400원
5개월 할부 시다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
21강 숙제로 내주신 나머지 테스트 코드도 부탁드립니다.
21강 숙제로 내주신 나머지 테스트 코드도 부탁드립니다.한번 비교도 해보고 막히는 것도 있어서요 부탁합니다.
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
15강 DTO ArticleForm 수정 후 새 데이터 입력 질문
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 데이터 수정 시 수정한 데이터의 id를 받아오기 위해서 ArticleForm에 toEntity 메소드 return을return new Article(null, title, content)에서 return new Article(id, title, content)로 수정하였는데요, 그렇게되면 새로운 데이터를 생성하는 ArticleController의 createArticle메소드에서 에러가 납니다. 처음 데이터 생성 시 id는 자동생성을 하게 해두고 new.mustache에서 id값을 input으로 받아오지 않았어서 그런것이라고 생각되는데, 혹시 해결 방법이 있을까요?
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
19강 Talend API POST 500 에러
안녕하세요. 강의듣던중 오류가 생겨서 코드 남깁니다. 인텔리제이에 코딩한건 아래와 같고, package com.example.firstproject.api; import com.example.firstproject.dto.ArticleForm; import com.example.firstproject.entity.Article; import com.example.firstproject.repository.ArticleRepository; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @Slf4j @RestController //RestAPI용 컨트롤러. 데이터(JSON)을 반환 public class ArticleApiController { @Autowired //DI private ArticleRepository articleRepository; //GET @GetMapping("/api/articles") public List<Article> index() { return articleRepository.findAll(); } @GetMapping("/api/articles/{id}") public Article show(@PathVariable Long id) { return articleRepository.findById(id).orElse(null); } //POST @PostMapping("/api/articles") public Article create(@RequestBody ArticleForm dto) { Article article = dto.toEntity(); return articleRepository.save(article); } //PATCH @PatchMapping("/api/articles/{id}") public ResponseEntity<Article> update(@PathVariable Long id, @RequestBody ArticleForm dto) { // 1: DTO -> 엔티티 Article article = dto.toEntity(); log.info("id: {}, article: {}", id, article.toString()); // 2: 타겟 조회 Article target = articleRepository.findById(id).orElse(null); // 3: 잘못된 요청 처리 if (target == null || id != article.getId()) { // 400, 잘못된 요청 응답! log.info("잘못된 요청! id: {}, article: {}", id, article.toString()); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null); } // 4: 업데이트 및 정상 응답(200) target.patch(article); Article updated = articleRepository.save(target); return ResponseEntity.status(HttpStatus.OK).body(updated); } //DELETE @DeleteMapping("/api/articles/{id}") public ResponseEntity<Article> delete(@PathVariable Long id) { // 대상 찾기 Article target = articleRepository.findById(id).orElse(null); // 잘못된 요청 처리 if (target == null) { return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null); } // 대상 삭제 articleRepository.delete(target); return ResponseEntity.status(HttpStatus.OK).build(); } } package com.example.firstproject.entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; import javax.persistence.*; @Entity //DB가 해당 객체를 인식 가능 (해당 클래스로 테이블을 만든다) @AllArgsConstructor @NoArgsConstructor //디폴트 생성자를 추가 @ToString @Getter public class Article { @Id @GeneratedValue(strategy = GenerationType.IDENTITY)//DB가 ID를 자동 생성 private Long id; @Column private String title; @Column private String content; public void patch(Article article) { if (article.title != null) this.title = article.title; if (article.content != null) this.content = article.content; } } package com.example.firstproject.dto; import com.example.firstproject.entity.Article; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.ToString; import javax.persistence.Entity; @NoArgsConstructor @AllArgsConstructor @ToString public class ArticleForm { private Long id; private String title; private String content; public Article toEntity() { return new Article( id, title, content); } } 인텔리제이 오류는 아래와 같고,org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.ARTICLE(ID) ( /* key:1 */ CAST(1 AS BIGINT), '1111', '1')"; SQL statement:insert into article (id, content, title) values (default, ?, ?) [23505-214] Talend API 오류는 아래와 같습니다.{"timestamp": "2022-11-01T12:34:19.732+00:00","status": 500,"error": "Internal Server Error","path": "/api/articles"}아래에는 캡처본 올립니다. 먼저 비슷한 질문 해주신 분 따라서 해봤는데 안되서 질문올립니다.
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
input 체크
쌤 궁금한거있숨다! <input type="checkbox" name="listcheck" value={{name}},{{nameinfo}},{{start}},{{enddate}}> 이러한 체크박스를 체크해서 submit 버튼을 통해서 다른 페이지로 체크된 박스 값들을 출력하려고 합니다..! 혹시 컨트롤러에는 어떻게 작성하면 되나요..? 구글링해도 잘 안나오네요,,, 컨트롤러에 있는 내용중에 DataForm form,Model model,@RequestParam(value= "listcheck",required = false)String[] listcheck 들은 구글링 해서 넣어본겁니다,,,
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
21강 질문
나머지는 다 되는데 Create 성공 test만 에러가 나네요. 코드도 다 똑같이 했는데, 이유를 잘 모르겠습니다. SQL Error: 23505, SQLState: 23505 라는 에러코드가 있어 확인해봤더니 이미 같은값이 존재할때 이런 메세지가 뜬다는데.. 그래서 4L을 다른 숫자로도 바꿔보고 타이틀이나 컨텐트를 다른 문자로도 바꿔봤는데 결과가 똑같네요. 도움 부탁드리겠습니다. > Task :compileJava UP-TO-DATE> Task :processResources UP-TO-DATE> Task :classes UP-TO-DATE> Task :compileTestJava> Task :processTestResources NO-SOURCE> Task :testClasses> Task :test11:12:22.291 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]11:12:22.302 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]11:12:22.336 [Test worker] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.example.firstproject.Service.ArticleServiceTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]11:12:22.349 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.example.firstproject.Service.ArticleServiceTest], using SpringBootContextLoader11:12:22.353 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.example.firstproject.Service.ArticleServiceTest]: class path resource [com/example/firstproject/Service/ArticleServiceTest-context.xml] does not exist11:12:22.354 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.example.firstproject.Service.ArticleServiceTest]: class path resource [com/example/firstproject/Service/ArticleServiceTestContext.groovy] does not exist11:12:22.354 [Test worker] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.example.firstproject.Service.ArticleServiceTest]: no resource found for suffixes {-context.xml, Context.groovy}.11:12:22.355 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.example.firstproject.Service.ArticleServiceTest]: ArticleServiceTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.11:12:22.409 [Test worker] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.example.firstproject.Service.ArticleServiceTest]11:12:22.470 [Test worker] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\jine\Desktop\firstproject\build\classes\java\main\com\example\firstproject\FirstprojectApplication.class]11:12:22.471 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.example.firstproject.FirstprojectApplication for test class com.example.firstproject.Service.ArticleServiceTest11:12:22.573 [Test worker] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.example.firstproject.Service.ArticleServiceTest]: using defaults.11:12:22.573 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]11:12:22.593 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@6d025197, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@27d4a09, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@7e4204e2, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@b7c4869, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@740d2e78, org.springframework.test.context.support.DirtiesContextTestExecutionListener@1c481ff2, org.springframework.test.context.transaction.TransactionalTestExecutionListener@72437d8d, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@1b955cac, org.springframework.test.context.event.EventPublishingTestExecutionListener@676cf48, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@5a1de7fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@335b5620, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@29a0cdb, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@32a68f4f, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@73194df, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@6eb2384f]11:12:22.596 [Test worker] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@30af5b6b testClass = ArticleServiceTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@19835e64 testClass = ArticleServiceTest, locations = '{}', classes = '{class com.example.firstproject.FirstprojectApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@35841320, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@6b695b06, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6f01b95f, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@7a5ceedd, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@26abb146, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@96def03], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null]. . ____ _ /\\ / ___'_ __ (_)_ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.4)2022-10-18 11:12:22.915 INFO 3660 --- [ Test worker] c.e.f.Service.ArticleServiceTest : Starting ArticleServiceTest using Java 1.8.0_345 on Home with PID 3660 (started by jine in C:\Users\jine\Desktop\firstproject)2022-10-18 11:12:22.916 INFO 3660 --- [ Test worker] c.e.f.Service.ArticleServiceTest : No active profile set, falling back to 1 default profile: "default"2022-10-18 11:12:23.475 INFO 3660 --- [ Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.2022-10-18 11:12:23.527 INFO 3660 --- [ Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 43 ms. Found 1 JPA repository interfaces.2022-10-18 11:12:24.037 INFO 3660 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...2022-10-18 11:12:24.283 INFO 3660 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.2022-10-18 11:12:24.349 INFO 3660 --- [ Test worker] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]2022-10-18 11:12:24.413 INFO 3660 --- [ Test worker] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.11.Final2022-10-18 11:12:24.611 INFO 3660 --- [ Test worker] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}2022-10-18 11:12:24.774 INFO 3660 --- [ Test worker] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect2022-10-18 11:12:25.369 DEBUG 3660 --- [ Test worker] org.hibernate.SQL : drop table if exists article CASCADE 2022-10-18 11:12:25.376 DEBUG 3660 --- [ Test worker] org.hibernate.SQL : create table article ( id bigint generated by default as identity, content varchar(255), title varchar(255), primary key (id) )2022-10-18 11:12:25.385 INFO 3660 --- [ Test worker] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]2022-10-18 11:12:25.395 INFO 3660 --- [ Test worker] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'2022-10-18 11:12:25.896 WARN 3660 --- [ Test worker] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning2022-10-18 11:12:26.318 INFO 3660 --- [ Test worker] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb'2022-10-18 11:12:26.699 INFO 3660 --- [ Test worker] c.e.f.Service.ArticleServiceTest : Started ArticleServiceTest in 4.067 seconds (JVM running for 5.345)2022-10-18 11:12:26.843 DEBUG 3660 --- [ Test worker] org.hibernate.SQL : insert into article (id, content, title) values (default, ?, ?)2022-10-18 11:12:26.849 TRACE 3660 --- [ Test worker] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [4444]2022-10-18 11:12:26.850 TRACE 3660 --- [ Test worker] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [라라라라]2022-10-18 11:12:26.853 WARN 3660 --- [ Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 23505, SQLState: 235052022-10-18 11:12:26.854 ERROR 3660 --- [ Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper : Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.ARTICLE(ID) ( /* key:1 */ CAST(1 AS BIGINT), '1111', U&'\\ac00\\ac00\\ac00\\ac00')"; SQL statement:insert into article (id, content, title) values (default, ?, ?) [23505-214]could not execute statement; SQL [n/a]; constraint ["PRIMARY KEY ON PUBLIC.ARTICLE(ID) ( /* key:1 */ CAST(1 AS BIGINT), '1111', U&'\\ac00\\ac00\\ac00\\ac00')"; SQL statement:insert into article (id, content, title) values (default, ?, ?) [23505-214]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statementorg.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint ["PRIMARY KEY ON PUBLIC.ARTICLE(ID) ( /* key:1 */ CAST(1 AS BIGINT), '1111', U&'\\ac00\\ac00\\ac00\\ac00')"; SQL statement:insert into article (id, content, title) values (default, ?, ?) [23505-214]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:276) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:174) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy105.save(Unknown Source) at com.example.firstproject.Service.ArticleService.create(ArticleService.java:37) at com.example.firstproject.Service.ArticleService$$FastClassBySpringCGLIB$$ee1232c.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704) at com.example.firstproject.Service.ArticleService$$EnhancerBySpringCGLIB$$1500e2b6.create(<generated>) at com.example.firstproject.Service.ArticleServiceTest.create_성공____title과_content만_있는_dto_입력(ArticleServiceTest.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 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.util.ArrayList.forEach(ArrayList.java:1259) 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.util.ArrayList.forEach(ArrayList.java:1259) 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 org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) at com.sun.proxy.$Proxy2.stop(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193) at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60) at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71) at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69) at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200) at org.hibernate.dialect.identity.GetGeneratedKeysDelegate.executeAndExtract(GetGeneratedKeysDelegate.java:58) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3279) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3885) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:84) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:645) at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:282) at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:263) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:317) at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:330) at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:287) at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:193) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:123) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:185) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:128) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:55) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:756) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:742) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:311) at com.sun.proxy.$Proxy102.persist(Unknown Source) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:666) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:530) at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:286) at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:640) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164) at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:139) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) 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.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ... 100 moreCaused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.ARTICLE(ID) ( /* key:1 */ CAST(1 AS BIGINT), '1111', U&'\\ac00\\ac00\\ac00\\ac00')"; SQL statement:insert into article (id, content, title) values (default, ?, ?) [23505-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:508) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:120) at org.h2.mvstore.db.MVTable.addRow(MVTable.java:519) at org.h2.command.dml.Insert.insertRows(Insert.java:174) at org.h2.command.dml.Insert.update(Insert.java:135) at org.h2.command.CommandContainer.executeUpdateWithGeneratedKeys(CommandContainer.java:242) at org.h2.command.CommandContainer.update(CommandContainer.java:163) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:209) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:169) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197) ... 145 moreArticleServiceTest > create_성공____title과_content만_있는_dto_입력() FAILED org.springframework.dao.DataIntegrityViolationException at ArticleServiceTest.java:70 Caused by: org.hibernate.exception.ConstraintViolationException at ArticleServiceTest.java:70 Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException at ArticleServiceTest.java:702022-10-18 11:12:26.926 INFO 3660 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'2022-10-18 11:12:26.926 INFO 3660 --- [ionShutdownHook] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'2022-10-18 11:12:26.927 DEBUG 3660 --- [ionShutdownHook] org.hibernate.SQL : drop table if exists article CASCADE 2022-10-18 11:12:26.927 WARN 3660 --- [ionShutdownHook] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 90121, SQLState: 901212022-10-18 11:12:26.927 ERROR 3660 --- [ionShutdownHook] o.h.engine.jdbc.spi.SqlExceptionHelper : Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-214]2022-10-18 11:12:26.928 WARN 3660 --- [ionShutdownHook] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 90121, SQLState: 901212022-10-18 11:12:26.928 ERROR 3660 --- [ionShutdownHook] o.h.engine.jdbc.spi.SqlExceptionHelper : Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-214]2022-10-18 11:12:26.928 WARN 3660 --- [ionShutdownHook] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'entityManagerFactory': org.hibernate.exception.JDBCConnectionException: Unable to release JDBC Connection used for DDL execution2022-10-18 11:12:26.928 INFO 3660 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...2022-10-18 11:12:26.929 INFO 3660 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.1 test completed, 1 failed> Task :test FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':test'.> There were failing tests. See the report at: file:///C:/Users/jine/Desktop/firstproject/build/reports/tests/test/index.html* 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.orgBUILD FAILED in 6s4 actionable tasks: 2 executed, 2 up-to-date
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
20강 질문
위 트랜젝션 코드를 쓰면서 강의와는 다른 부분이 생깁니다. 오른쪽에 붉은색 표시된 부분이 생기는데 왜 그러는걸까요? 데이터는 강의대로 잘 넣어지고 그러는데, 결제실패! 라는 로그가 나오지도 않네요..
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
entity로 변환하는 이유./.
entity로 변환하는 이유가 궁급합니다..
- 해결됨[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
8강 듣고있는데요
인텔리제이에선 에러 없이 잘된거 같은데.. 갑자기 홈페이지 연결이 안되네요. 에러코드도 없고 뭘 봐야될지 잘 모르겠습니다. 바뀐건 제 위치만 바뀌었는데 공유 와이파이가 바뀌어도 이럴수 있나요?
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
윈도우 환경인데요
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 듣기전에 유의해야할 점이 있을까요?
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
구글링해서 방법은 찾았는데 저한테는 안보이네요.. ㅠㅠ
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.이러한 오류가 떠서 구글링을 해봤는데 Run탭에 들어가서 run -> edit configuration들어가서 enabled debug output을 클릭하고 재 실행하면된다는데 저는 왜 없는건가요??
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
강의 그대로 따라했는데 이러는 이유가 무엇인가요...
오류 코드를 보면 entity의 Article 에 들어가서 뭐하라는거같은데.. 도와주세요
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
여기서 @RequestBody 어노테이션 추가후 talend에서 실행시키면 이런 오류가 뜹니다 ㅠㅠ
인텔리제이 오류로는 com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of com.example.fitstproject.dto.ArticleForm (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator) at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 2, column: 3]이렇게 뜹니다 ㅠㅠㅠ
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
댓글 테스트
이거 여기 findByArticleId가 이상하다는 거 같은데..이런 게 뜨네요... 똑같이 따라 적었는데...ㅠ 어떡하면 좋을까요ㅠ눈빠지게 찾아봐도 똑같은데...ㅠㅠㅠ 혹시이 밑은 리파지토리에요!
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
"오케이"가
착착 감기게 말씀 잘하시네요!
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
페이지에 정렬 문제
이렇게 똑같이 작성했는데이렇게 정렬이 안 된 채로 나와요..ㅠㅠㅠ 무슨 문제일까요..?그 전에 질문주신 부분들은 참고해서 잘 해결했습니다. 센스있고 핵심을 쏙쏙 담은 답변 감사합니다!
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
인코딩 등등 질문
질문1. html 태그 넣어서http://localhost:8080/hi 에 들어갔는데이렇게 물음표가 떠요. 똑같이 복붙했는데, 왜 그럴까요??구글링해서 인텔리제이 인코딩설정 뜨는 거 모든 방법 다 했는데 계속 똑같이 떠요...ㅠㅠㅠ질문2.여기에 계속 빨간 박스 뜨는 원인 알고 싶습니다..!질문3.템플릿에 처음에 바로 article 폴더 만드니까템플릿 안에 폴더 만들어 지는 게 아니라 템플릿 자체 이름이 tempales.article로 바꼈었어요!그 부분은 왜 그런 걸까요? 그리고 폴더 잘못 만들었을 때 폴더 삭제 방법도 알고 싶습니다!질문4. 처음에 깔 때는 run 버튼이 없어서... 구글링해서 설정을 해줘야 했습니다!run 없이 깔리는 경우는 왜 그런 걸까요..?질문5. 앞부분 greeting, goodbye부분 말고 article부터 따라하면 안 되는 부분인가요? 레이아웃 부분이 없어서 그런가요? article부터 만드는 방법이 혹시 있는지 궁금합니다! :)질문6.이 강의 다 들으면 스프링 부트에 입문! 정도 할 수 있는건가용?스프링 부트를 제대로 다루려면 뭐를 더 배워야 하는가용???넘 질문이 많아서 죄송해요 강의 이해 완전 잘 되고 유익합니다!!!좋은 강의 만들어 주셔서 넘 감사합니다 ㅎㅎ
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
22강 질문입니다..
22강 테스트 코드에서 계속 에러가 납니다.. 그래서 강사님 코드를 복붙했는데도 계속 에러가 납니다.. 1. 특정 게스트의 모든 댓글 조회 org.opentest4j.AssertionFailedError: 4번 글의 모든 댓글을 출력! ==> Expected :[Comment(id=1, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=park, body=굿윌헌팅), Comment(id=2, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=Kim, body=헌트), Comment(id=3, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=lee, body=아임샘)] Actual :[Comment(id=1, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=park, body=굿윌헌팅), Comment(id=2, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=kim, body=헌트), Comment(id=3, article=Article(id=4, title=당신의 인생영화는?, content=댓글 ㄱ), nickname=lee, body=아임샘)] <Click to see difference> 2. 특정 닉네임 조회시 org.springframework.dao.InvalidDataAccessApiUsageException: Could not locate ordinal parameter [1], expecting one of []; nested exception is java.lang.IllegalArgumentException: Could not locate ordinal parameter [1], expecting one of [] 이런 에러가 납니다.. 원인이 몰까요???? 제가 몰 잘못했을까요??? orm도 복붙해봤는데도 계속 에러가 납니다... 답변 해주시면 감사하겠습니다..
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
run 오류
안녕하세요! 강의 잘 듣고 있습니다. 강의를 듣기 위해 인텔리제이를 설치했으나, 저는 왜 run 버튼을 눌러도 아무것도 되지 않는지 궁금합니다 ㅠㅠ 인터넷에 찾아보기도 해서Edit Configurations에 새로운 경로도 추가해 보려고 했는데 이것마저도 출력되면 강의처럼 되지 않아 여쭤봅니다..!
- 미해결[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
24강 질문입니다.
안녕하세요!! 다름이 아니라 강의 잘 따라오고 있다가, 24강 공부하던 중 아무리 해도 해결이 되지 않아 질문 올립니다 . comments 디렉토리의 사진입니다. 강의를 잘 따라왔습니다. show.mustache 화면 하단입니다. {{>comments/_comments}} mustache 문법을 통해서 comments 디렉토리 안에 있는 _comments 파일을 삽입해줍니다. 강의와 같이 comments 디렉토리 안에 있는 _comments 파일입니다. comments 디렉토리 안에 있는 _list 파일과 _new 파일을 불러옵니다. comments 디렉토리 안에 있는 _list 파일 내부 코드입니다. {{#commentDtos}} {{/commentDtos}} 를 사용해서 Model 을 이용해서 commentDtos의 내용을 사용할 수 있습니다. 즉, commentDtos 안의 nickname과 body 변숫값을 사용할 수 있습니다. ArticleController 내부 show 함수 코드입니다. article의 id값이 들어오게된다면, 그것을 article_id로 받아 commentDtos를 만들게 됩니다. 이전에 json을 이용한 REST API 실습 때, 문제 없이 200값을 받은 것을 보아 문제가 없어보입니다. log.info()로 id 값을 잘 반환하는 것을 확인했습니다. 그렇지만 commentDtos 의 내용을 log.info(commentDtos.toString()) 으로 받은 결과, 빈 list 를 확인하였습니다. 차라리 에러라도 나면 구글링을 통해서 확인을 해볼텐데, 에러도 나지 않아 문제를 어떻게 해결해야할 지 모르겠습니다. 저는 따로 외부 DB로 MariaDB를 사용하면서 실습을 따라오고 있었으며, 위와 같이 MariaDB 에서도 잘 데이터를 받았고, 355번 arricle_id 를 받았을 때, 댓글 3개를 출력하는 것이 예상 시나리오이었지만, 빈 리스트가 반환되어 어떻게 고쳐야할 지 모르겠습니다. F12 를 눌러 개발자 모드를 확인하였는데, {{>comments/_comments}} 는 인식을 한 것 같은데, 안의 코드가 html에 반영이 되지 않습니다... 이런 경우 어떻게 해결해야할까요 ??
- 해결됨[개념은 호옹~, 실습 빡] 스프링 부트, 입문!
15강 Submit 페이지 이동불가
안녕하세요 15강 강의 9:30초 ~ 코드를 모두 따라했는데 저는 Edit 페이지에서 submit button을 눌러도 다음페이지로 url이 이동하지도, 에러페이지가 나오지도 않습니다.. 3번 갈아치웠는데 어디가 잘못됐는지 보이세요..?ㅠㅜ 아무리 찾아도 모르겠어서 도움 요청합니다.. ArticleController ArticleForm Edit 여기서 Submit 버튼을 눌르면 아무 이벤트도 발생하지 않아요..