반응형 Error & Fix172 스프링부트 JPA Cannot invoke "경로.Repository.findAll()" because "this.Repository" is null 해결방법 스프링부트에서 JPA 사용 시 그냥 findAll 함수 호출하는 도중 Cannot invoke "경로.Repository.findAll()" because "this.Repository" is null 이런 에러가 계속 발생해서 뭐지 이러고 있었는데 보니까 Repository에 위에 @Autowired를 안해줘서 주입이 안되서 null이 뜨던 거였다 2021. 12. 2. 구글 애널리틱스 API Sort key adsenseRevenue is not a dimension or metric 해결방법 com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request POST https://analyticsreporting.googleapis.com/v4/reports:batchGet { "code": 400, "errors": [ { "domain": "global", "message": "Sort key adsenseRevenue is not a dimension or metric in this query.", "reason": "badRequest" } ], "message": "Sort key adsenseRevenue is not a dimension or metric in this query.", "status.. 2021. 11. 26. 스프링부트 JPA No Persistence provider for EntityManager named '값' 해결방법 스프링부트 JPA에서 EntityManagerFactory를 만드려고 하는 경우 위와 같이 persistenceUnitName 이 META-INF의 persistence.xml 에서 설정한 값과 다른 값을 걸어주면 No Persistence provider for EntityManager named 'persistenceUnitName명' 에러가 발생하게 되는데 전체 에러내용은 아래와 같다 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.jpa.jpaexample.service.CrudService]: Constructor threw exception; nested exception is .. 2021. 11. 25. 스프링부트 'com.mysql.jdbc.Drvier'. This is deprecated 해결방법 스프링부트 프로젝트에 persistence.xml을 추가하고 프로젝트 start 시 위 이미지와 같이 This is deprecated가 발생하고 있는데 전체 내용은 다음과 같다 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. 보면 알겠지만 에러는 아니고 com.mysql.jdbc.Driver가 옛날 버전이기 때문에 com.mysql.cj.jdbc.Dr.. 2021. 11. 25. 인텔리제이 Local variable '변수명' is redundant 해결방법 인텔리제이 사용 중 위와 같이 Local variable '변수명' is redundant 가 발생하는 것이 보이는데 에러는 아니고 불필요한 코드기 때문에 바꾸라는 내용인데 위 이미지에서는 resultList를 가지고 딱히 하는게 없으므로 resultList에 조회한 데이터를 넣은 후 resultList를 return 할게 아니라 바로 조회한 내용을 return 시키고 끝내라는 내용이 되겠다 이런 내용이 나왔을 경우에는 Inline variable을 눌러주면 인텔리제이에서 자동으로 변경을 해 주게 된다 이렇게 굳이 만들 필요가 없는 코드를 빼는 식으로 변경을 해 준다 물론 lnline variable를 누르지 않고도 변경해도 상관은 없다 2021. 11. 24. 스프링부트 JPA 테이블명 is not mapped 에러 해결방법 org.hibernate.hql.internal.ast.QuerySyntaxException: sample_member is not mapped entityManager를 사용해서 쿼리를 호출하는 경우 테이블명 is not mapped 에러가 발생하는 경우가 있는데 에러의 원인을 확인하려면 해당 테이블이 Entity에 등록이 되었는지 확인해봐야 하는데 Entity를 한번 확인해보면 @Table 어노테이션 오른쪽에 sample_member 테이블을 작성해 놓았는데 createQuery 메소드에서는 @Table 어노테이션에 입력한 테이블명이 아니라 Entity 클래스명을 찾고 있는건데 CrudEntity 밖에 없는데 sample_member 에서 조회를 하라고 하니 is not mapped 에러가 발생하게 .. 2021. 11. 24. 이전 1 ··· 4 5 6 7 8 9 10 ··· 29 다음 반응형