1. EAGER 를 굳이 사용을 하지않고 그냥 두면 알아서 join 해서 같이 로딩이 되는데 굳이 사용되는 이유가 있나요 ??? default가 지연로딩인 OneToMany, ManyToMany의 경우에 EAGER 시켜주기 위함인가요 ? 2. member.java의 lazy를 없애고 그냥 team 으로 한 번 실험을 해봤는데 지연로딩이 된 것 같습니다. 이 이유는 team이 OneToMany로 기본이 지연로딩이기 때문인가요? 지연로딩과 프록시.. 한 번에 감을 확 잡기가 힘드네요 ㅜㅜ
2.2.8 버전으로 낮췄을 때는 이렇게 오류가 나면서 스프링이 종료가 되는데, 2.3.0 버전 이후에는 오류가 발생하지 않습니다. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-06-18 21:08:41.809 ERROR 22277 --- [ 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: mappedBy reference an unknown target entity property: jpabook.jpashop.domain.Category.parent in jpabook.jpashop.domain.item.Item.child at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE] at jpabook.jpashop.JpashopApplication.main(JpashopApplication.java:10) [classes/:na] Caused by: org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: jpabook.jpashop.domain.Category.parent in jpabook.jpashop.domain.item.Item.child at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:844) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:795) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:53) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1693) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1661) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:286) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) ~[spring-orm-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) ~[spring-orm-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] ... 16 common frames omitted Process finished with exit code 1 혹시 이 문제를 해결할 수 있는 방법이 있을까요? 제가 의심한 문제는 spring 자체적인 변경점이 있거나, hibernate에서 변경점이 있는 것인데... 찾기가 쉽지 않네요. https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa/2.2.8.RELEASE https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa/2.3.0.RELEASE 문제점을 버전을 내려서 확인하고 소스는 정상동작 하는 상태입니다. 졸면서 하다가 ㅠㅠ 엉뚱한데에 소스를 넣었었네요.
안녕하세요, `3-2-2) Kubernetes` 단계에서 이미지와 같은 에러가 뜹니다. 1) 원할한 강좌수강을 위해 권장하는 해결방법이 있을지요? 2) 저는 `yum install kubernetes-cni = 0.7.5-0`커맨드로 요구하는 버전을 설치했는데.. kubeadm은 댓글이미지와 같은 오류메세지와 함께 설치가 진행되지 않습니다. 혹시 어떻게 해결해야할까요..? * 이전 단계는 기본적으로 영상을 그대로 따라했으나, 네트워크 설정단계에서 `네트워크에 브릿지` 대신 `NAT Network`로 설정하고 포트포워딩한 상태입니다.
안녕하세요 1. 13:00경에 숫자입력받고 문자열은입력받을때 아래코드로 실행을하면 cout<<Your age?<<endl; int age; cin>>age; cout<<Your name?<<endl; string name; std::getline(std::cin ,name); cout<<name<<" " << age << endl; Your age? 에 1 엔터 를 하면 Your name? 1이 출력되고 끝납니다. 왜이러는건가요? 1엔터를 치는순간 1과 엔터가 콘솔입력버퍼로 들어가고 1은 cin>>age 에따라 age에 들어가서 버퍼는 엔터말고는 비어버리니까std::getline(std::cin ,name); 에 의해 추가로버퍼로의 문자열 입력이 필요하므로 콘솔창 추가입력이 있어야 콘솔->버퍼-> name 으로의 입력이 최종적으로 끝나고 출력단계로 넘어가야 하는것 아닌가요? 2.위의 오류는 정수입력을 종료하고나서(cin>>age 아랫줄에) std::cin.ignore(32767,'₩n') 을 입력하면 해결되는데 std::cin.ignore(32767,'₩n') 은 구체적으로 무슨역할을 하는건가요?
root@ip-172-31-39-250:/home/ubuntu/Nodebird/front# npm run build > react-nodebird-front@1.0.0 build /home/ubuntu/Nodebird/front > cross-env ANALYZE=true next build Creating an optimized production build ... Webpack Bundle Analyzer saved report to /home/ubuntu/Nodebird/front/.next/analyze/server.html Failed to compile. ./node_modules/@ant-design/icons/lib/dist.js 5:6 Module parse failed: 'import' and 'export' may only appear at the top level (5:6) You may need an appropriate loader to handle this file type. | // 加载script标签会阻塞js执行,antd部分组件(如表格)无法在一轮循环内完成完整的渲染,故延时 | setTimeout(function(){ > import(/* webpackChunkName: "antd-icons" */'!!./dist.js').then(function(allIcons) { | AutoReloadIcon.load(allIcons); | }); > Build error occurred Error: > Build failed because of webpack errors at Object.build [as default] (/home/ubuntu/Nodebird/front/node_modules/next/dist/build/index.js:192:15) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! react-nodebird-front@1.0.0 build: `cross-env ANALYZE=true next build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the react-nodebird-front@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-06-18T10_35_44_822Z-debug.log root@ip-172-31-39-250:/home/ubuntu/Nodebird/front# --------------------------------------------------------------- 아래 질문이랑 참고해서 웹팩버전을 바꿨는데.. 그래도 같은 오류가 발생합니다.
안녕하세요. 좋은 강의 올려주셔서 공부하고 있습니다. 그리고 실력 향상에 많은 도움이 되고 있습니다. ^^ 바쁘시겠지만.. 혹시 나중에 시간이 되신다면.. 강사님 스타일로 사이트를 통째로 코딩하는 강의도 올려 주실 수 있으실지 하고 문의남겨드립니다. 저는 아직 배우는 중이라서 잘은 모르겠지만 코드 쓰시는 방법들이 명확하고 깨끗하게 쓰시는 것 같다는 느낌을 받았습니다. 실무에서 어떤 방식으로 사이트를 코딩 하시는지 궁금증이 커졌습니다. 그럼 남은 하루도 편안한 시간 되세요. 감사합니다!
27강 DomainClassConverter 관련 수업을 들으며 코드 동일하게 따라치며 강의 듣고 있는데요, DomainClassConverter 사용 전 @PathVariable 을 사용하여 Long 으로 id 를 받아와서 repo 로 부터 엔티티를 꺼내 리턴하는 방식으로 동일한 테스트 코드에서 이상 없이 돌아갑니다. 하지만 DomainClassConverter 를 사용하는 취지로 @PathVariable("id") Post post 와 같이 작성한 뒤 테스트를 돌려보면 테스트가 돌아가지 않습니다. 구체적인 코드는 아래와 같습니다. DomainClassConverter 사용 전 코드입니다. @GetMapping("/posts/{id}") public String getPost(@PathVariable Long id) { Optional<Post> byId = postRepository.findById(id); Post post = byId.get(); return post.getTitle(); } DomainClassConverter 기능을 사용하기 위해 변경한 코드입니다. @GetMapping("/posts/{id}") public String getPost(@PathVariable("id") Post post) { return post.getTitle(); } 테스트 코드 입니다. @Test public void getPost() throws Exception { // Arrange Post post = new Post(); post.setTitle("jpa"); postRepository.save(post); // Act ResultActions actual = mockMvc.perform(get("/posts/" + post.getId())).andDo(print()); // Assert actual.andExpect(status().isOk()); actual.andExpect(content().string("jpa")); } 발생하는 예외 로그 입니다. Hibernate: call next value for hibernate_sequence Hibernate: insert into post (created, title, id) values (?, ?, ?) 2020-06-18 18:30:50.714 TRACE 86203 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [TIMESTAMP] - [null] 2020-06-18 18:30:50.715 TRACE 86203 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [jpa] 2020-06-18 18:30:50.715 TRACE 86203 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [1] 2020-06-18 18:30:50.752 WARN 86203 --- [ main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentConversionNotSupportedException: Failed to convert value of type 'java.lang.String' to required type 'com.github.callmewaggs.commonweb.post.Post'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.github.callmewaggs.commonweb.post.Post': no matching editors or conversion strategy found] MockHttpServletRequest: HTTP Method = GET Request URI = /posts/1 Parameters = {} Headers = [] Body = null Session Attrs = {} Handler: Type = com.github.callmewaggs.commonweb.post.PostController Method = com.github.callmewaggs.commonweb.post.PostController#getPost(Post) Async: Async started = false Async result = null Resolved Exception: Type = org.springframework.web.method.annotation.MethodArgumentConversionNotSupportedException ModelAndView: View name = null View = null Model = null FlashMap: Attributes = null MockHttpServletResponse: Status = 500 Error message = null Headers = [] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = [] MockHttpServletRequest: HTTP Method = GET Request URI = /posts/1 Parameters = {} Headers = [] Body = null Session Attrs = {} Handler: Type = com.github.callmewaggs.commonweb.post.PostController Method = com.github.callmewaggs.commonweb.post.PostController#getPost(Post) Async: Async started = false Async result = null Resolved Exception: Type = org.springframework.web.method.annotation.MethodArgumentConversionNotSupportedException ModelAndView: View name = null View = null Model = null FlashMap: Attributes = null MockHttpServletResponse: Status = 500 Error message = null Headers = [] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = [] java.lang.AssertionError: Status Expected :200 Actual :500 <Click to see difference> ...생략 단순히 제가 오타가 있다거나 하는 문제인가요? 검색을 해봤는데도 해결책을 찾기 어려워서 질문 올립니다.
1. 3:18에 single_table 전략은 그냥 dtype이 들어가는데 굳이 @DiscriminatorColumn 을 해주시는 특별한 이유가 있나요 ?? 2. 생각해보면 item 테이블 또한 공통의 테이블들인데, 이것들을 MappedSuperclass로 사용하지 않는 이유는 조회를 하기위해서 그냥 상속관계로 두는 것이 맞나요 ? 그렇다면 만약 createdBy 처럼 find 로 찾을 이유는 없지만 공통된 부분인 것만 MappedSuperclass를 사용하면 된다고 받아들여도 될까요?
[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-6-c115971908ad> in <module> ----> 1 from googletrans import Translator 2 dave = Translator ( ) 3 word = dave . translate ( '나는 가방을 매고 학교에 갔습니다.' , dest = 'en' , src = 'ko' ) 4 print ( word . text ) ModuleNotFoundError : No module named 'googletrans' 위와 같이 모듈을 찾을 수 없다는 오류가 발생합니다. 현재 윈도우 사용중이며, 실습 내용에 따라 pip install --upgrade google-api-python-client pip install googletrans 위 명령어대로 cmd에 입력하여 설치했습니다. 제가 시도한 방법은 두 가지입니다. 1. upgrade 명령어로 최신 버전 업그레이드를 시도했으며 pip list로 최신 버전이 설치됐음을 확인했습니다. 2. 혹시 path 때문인가 의심되어 제어판->고급 시스템 설정 -> 환경 변수에서 경로를 확인했지만 C:\Users\KKM\AppData\Local\Programs\Python\Python38-32\Scripts\ C:\Users\KKM\AppData\Local\Programs\Python\Python38-32\ 위와 같이 경로가 정상적으로 지정되어 있었습니다. 3. 컴퓨터를 완전히 종료한 후 재시도했습니다. 변화는 없었습니다. googletrans 실습 전의 math 라이브러리 실습의 경우 잘 작동했는데 혹시 더 시도해볼만한 방법이 있을까요?