월 19,800원
5개월 할부 시다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결스프링 기반 REST API 개발
spring doc 관련 파일 생성 관련 배포 관련 질문 드립니다.
안녕하세요. 설 연휴 잘 보내셨는지 궁금하네요.늦었지만 새해 복 많이 받으셨으면 좋겠습니다. 설 연휴에 처음부터 끝까지 재수강하여 재밌게 잘 배웠네요. 다름이 아니라 배포관련하여 질문이 있습니다. 일단 배포 전 항상 테스트 하는 것에 대해서 부정적인 입장은 아닙니다. 만약에 MSA를 구축하지 않고 단일 프로젝트에서프로젝트 규모가 커진다면 배포 할 때 마다 모든 테스트를 돌리기가 버거워질 텐데요. 그래서 테스트 스킵을 고려하는 팀에서는 spring doc snippet생성을 어떻게 해야 할까요..?
- 미해결스프링 기반 REST API 개발
섹션2 201응답받기 부분 테스트 404에러 질문입니다
위, 아래의 사진은 수업에서 진행한 EventConroller, EventControllerTests의 전문입니다.테스트하면 아래의 에러메세지가 나옵니다 수업과 같이 진행했는데 왜 발생하는지를 모르겠습니다 도와주세요Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appendedMockHttpServletRequest: HTTP Method = POST Request URI = /api/events/ Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/hal+json"] Body = null Session Attrs = {}Handler: Type = org.springframework.web.servlet.resource.ResourceHttpRequestHandlerAsync: Async started = false Async result = nullResolved Exception: Type = nullModelAndView: View name = null View = null Model = nullFlashMap: Attributes = nullMockHttpServletResponse: Status = 404 Error message = null Headers = [Vary:"Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers"] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = []java.lang.AssertionError: Status Expected :201Actual :404<Click to see difference> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:637) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:214) at me.gang.demorestapi.events.EventControllerTests.createEvent(EventControllerTests.java:31) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:76) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) 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)
- 미해결스프링 기반 REST API 개발
강의 자료가 404입니다 확인 부탁 드려요!
강의 자료가 404입니다 확인 부탁 드려요!
- 미해결스프링 기반 REST API 개발
연동 DB문의
안녕하세요. 디비는 oracle 이나 mysql사용하여도 되나여? 혹시 postgresql 쓰는 이유가 있을까요?
- 미해결스프링 기반 REST API 개발
이벤트 Repository강의 중 Event 클래스에 private Integer Id; 위치 질문
이벤트 Repository강의 중 Event 클래스에 private Integer Id; 이 한줄의 위치가 맨 위가 아니면 에러가 납니다.왜 그런건가요? (저는 강의 순서대로 입력하느라 아래쪽에 입력했었습니다.) 에러내용은 : org.springframework.orm.jpa.JpaSystemException: Unknown integral data type for ids : java.lang.String
- 미해결스프링 기반 REST API 개발
Spring Boot 3.x.x 버전 , gradle 사용 할 때 ASCII 관련 설정 참고하세요
혹여나 Spring Boot 3.x.x. 버전에 gradle 사용할 경우 ASCII 관련 해 설정하는 부분을 정리 해 놓았습니다.혹시 저와 같은 Setting을 진행하시는 분들은 참고해주시면 좋을 것 같아요!설명 바로가기
- 미해결스프링 기반 REST API 개발
(Mac) postgressql 관련하여 port kill 해도 다시 살아나는 경우
문제 발생 상황 : 기존에 작동하고 있던 PostGressql을 kill 해도 다시 살아나는 현상 문제 원인 : 백그라운드에서 작동되고 있어 postgressql이 죽지를 않음. 문제 해결 방법 :[시스템 설정] -> [로그인 항목] -> [백그라운드 허용] 에서 postgressql 관련 항목들을 off 해주신 후 서버를 기동시키면 정상 작동 됩니다. 저 같은 경우는 흔치 않을 것 같으나 기존에 postgressql을 설치한 것이 문제였던 것 같습니다.
- 미해결스프링 기반 REST API 개발
maven으로 생성한 docs파일(index.html)에서의 not found 오류 질문
안녕하세요. 백기선님 강의 덕분에 성장 중입니다. 강의 항상 감사합니다. 다름이 아니라, 인텔리제이의 maven 메뉴에 있는 package로 생성된 index.html 에 있는 내용들이not found operator:: 라면서 오류가 납니다.pom.xml, test에 있는 createEvent(), EventController 에서 틀린 부분이 있는지 찾아봤는데도 분명 소스는 같은데 왜 틀리는지 잘 모르겠습니다.제가 아직 not found operator:: 이 부분이 무슨 뜻인지 몰라서일까요...테스트는 일단 잘 돌아갑니다(?)현재 사용 중인 버전은아파치 메이븐 3.8.1 (약 2018년 버전으로 예상)스프링 부트 2.6.13입니다. 도와주시면 감사드리겠습니다🙇♂️소스는 링크로 걸어놓겠습니다. (pom.xml 외 다른 소스들은 실습 중이라 달라질 수 있습니다)EventControllerhttps://github.com/intrager/Spring-STUDY2/blob/main/restfulHan/src/main/java/me/brucehan/restfulhan/events/EventController.java RestDocsConfigurationhttps://github.com/intrager/Spring-STUDY2/blob/main/restfulHan/src/test/java/me/brucehan/restfulhan/common/RestDocsConfiguration.java EventControllerTestshttps://github.com/intrager/Spring-STUDY2/blob/main/restfulHan/src/test/java/me/brucehan/restfulhan/events/EventControllerTests.java pom.xmlhttps://github.com/intrager/Spring-STUDY2/blob/main/restfulHan/pom.xml index.adochttps://github.com/intrager/Spring-STUDY2/blob/main/restfulHan/src/main/asciidoc/index.adoc
- 미해결스프링 기반 REST API 개발
테스트 오류 질문드립니다.
<입력값 제한하기> 강의에서 Expected와 Actual이 같은데도테스트가 실패합니다. 도와주세요..andExpect(jsonPath("eventStatus").value(EventStatus.DRAFT))값은 정상인데 대체 왜 실패라고 뜨는건가요?
- 미해결스프링 기반 REST API 개발
docs 요청값이 반영이 안되네요... (해결)
docs 화면이 이상합니다..<plugin> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> <version>2.1.0</version> <executions> <execution> <id>generate-docs</id> <phase>prepare-package</phase> <goals> <goal>process-asciidoc</goal> </goals> <configuration> <backend>html</backend> <doctype>book</doctype> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.springframework.restdocs</groupId> <artifactId>spring-restdocs-asciidoctor</artifactId> <version>2.0.2.RELEASE</version> </dependency> </dependencies> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <id>copy-resources</id> <phase>prepare-package</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory> ${project.build.outputDirectory}/static/docs </outputDirectory> <resources> <resource> <directory> ${project.build.directory}/generated-docs </directory> </resource> </resources> </configuration> </execution> </executions> </plugin>이 경로에서는잘 나옵니다...그런데...http://localhost:8080/docs/index.html으로 접속했을 때 저렇게 깨져서 나오네요... --------------------------------------------------해결했습니다.설정문제였네요..아래처럼 변경하시면 잘 반영됩니다.참고하세요 ! 화이팅!
- 미해결스프링 기반 REST API 개발
psql 적용 후 에러
Caused by: org.postgresql.util.PSQLException: FATAL: role "postgres" does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2787) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:173) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:290) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.Driver.makeConnection(Driver.java:402) ~[postgresql-42.3.6.jar:42.3.6] at org.postgresql.Driver.connect(Driver.java:261) ~[postgresql-42.3.6.jar:42.3.6] at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na] at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:181) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final] at org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl.getIsolatedConnection(DdlTransactionIsolatorNonJtaImpl.java:44) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final] ... 36 common frames omittedProcess finished with exit code 1위와 같은 에러가 나오며 app 이 실행되지 않는경우 해결방법을 여쭤보고 싶습니다. 컨테이너 명령어를 통해 다음과 같은 role 이 있는것도 확인을 했는데도 불구하고요..postgres=# \conninfoYou are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5432".postgres=# \du List of roles Role name | Attributes | Member of-----------+------------------------------------------------------------+----------- postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}postgres=#
- 미해결스프링 기반 REST API 개발
mvn package 시 다음과 같은 에러가 나시면
Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module다음과 같은 에러 나시면 plugin 에<groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> <version>2.1.0</version>버전을 최신으로 업데이트 하심 해결됩니다.
- 미해결스프링 기반 REST API 개발
Event에 Account manager를 추가했으면 문서화 필요
이벤트 테스트할 때 에러나요 // 요청이랑 응답 둘다... ... fieldWithPath("limitOfEnrollment").description("..."), fieldWithPath("free").description("..."), fieldWithPath("eventStatus").description("..."), fieldWithPath("offline").description("..."), fieldWithPath("manager").description("..."), fieldWithPath("manager.id").description("..."), fieldWithPath("manager.email").description("..."), fieldWithPath("manager.password").description("..."), fieldWithPath("manager.roles").description("...") )
- 미해결스프링 기반 REST API 개발
2년 훨씬 전 부터 Restlet-> Talend API 로 바뀌었습니다~
참고하세요~
- 미해결스프링 기반 REST API 개발
asciidoc 추가 스니펫 에러 해결법
errors에 저 두개의 파일을 아무 내용이나 생성해 줍니다.
- 미해결스프링 기반 REST API 개발
_links 는 현재 fieldWithPath 를 해주지 않아도 됩니다.
손아프게 따라 안치셔도 되요. 치면 에러나요
- 미해결스프링 기반 REST API 개발
깃랩 처음 사용자를 위한 index.adoc raw 보는 법
asciidoc 이라는 폴더를 들어가면 마치 index.adoc을 연 것 마냥 페이지가 보이는데 착각입니다. 폴더를 연 것입니다. index.adoc를 찾으면 한 번 더 누를 수 있습니다. 오른쪽에 없던 Open raw가 생기면서 raw파일을 강의대로 지지고 볶고 하면 됩니다.
- 미해결스프링 기반 REST API 개발
eclipse 쓰시는 분을 위한 maven-resources-plugin 팁
<artifactId>maven-resources-plugin<artifactId> <version>2.7</version> 은 에러가 나므로 <artifactId>maven-resources-plugin<artifactId> <version>3.1.0 또는 3.2.0</version> 킹텔리제이가 추천해 주는 3.1.0 이나 3.2.0 을 입력해주세요
- 미해결스프링 기반 REST API 개발
부트 + jupiter 인 경우 설정법
@SpringBootTest @AutoConfigureMockMvc @ExtendWith(RestDocumentationExtension.class) class EventControllerTest { private MockMvc mockMvc; private WebApplicationContext webApplicationContext; private final ObjectMapper objectMapper; private final EventRepository eventRepository; @Autowired public EventControllerTest(WebApplicationContext webApplicationContext, ObjectMapper objectMapper, EventRepository eventRepository) { this.webApplicationContext = webApplicationContext; this.objectMapper = objectMapper; this.eventRepository = eventRepository; } @BeforeEach public void setUp(RestDocumentationContextProvider restDocumentation) { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.webApplicationContext) .apply(documentationConfiguration(restDocumentation)).build(); } //..... 이하 생략 }
- 미해결스프링 기반 REST API 개발
혹여 기선님 말 안 듣고 gradle로 프로젝트 생성했다가 피똥싸고 계신 분들을 위하여
1. gradle 버전이 7 이상이신 경우 6.xx대로 다운그레이드 하시고 2. https://gaemi606.tistory.com/entry/Spring-Boot-REST-Docs-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0 의 'Gradle 버전에 맞게 수정하기!' 의 코드대로 따라해주세요. 화이팅!