[Spring Error] could not execute statement; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

2020. 12. 26. 11:07·Error code 모음/5. JAVA, Spring errors
반응형

 

원인

- 테스트코드 Junit 실행시 예외가 발생하는 경우,

- Repository 관련 클래스를 실행할때 여외가 발생하는 경우이다

- 말그대로 쿼리 실행할수 없는 문장이라고 나옴, 

- 오타가 났거나, 연결한 DB 의 테이블하고 스프링 프로젝트 상의 코드와 맞지 않을 때 발생하는 에러

 

해결 방법

- TABLE 과 비교한 결과 Not Null 인데 Null 값을 insert 하려고 했었고

- 자동으로 값이 들어가는 Auto_Increment 설정이 안되어 있어서 Null 값이 계속 들어갔었던 것이다.

값을 채워서 실행 했다.

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'Error code 모음 > 5. JAVA, Spring errors' 카테고리의 다른 글

[Spring Error] warning: Not generating hashCode: One of equals or hashCode exists. You should either write both of these or none of these (in the latter case, lombok generates them).  (0) 2021.01.13
[ Spring ] org.apache.jasper.JasperException: Unterminated <c:url tag  (0) 2020.12.27
[JAVA Error] java.lang.ClassCaseException 에러  (0) 2020.12.09
[JAVA Error] 프로젝트 실행 후 import 안되는 문제 - Failed to start component [StandardEngine[Catalina].StandardHost[localhost]  (0) 2020.11.30
[JAVA Error] 톰캣 실행 에러 - java.util.zip.ZipException: invalid CEN header (bad signature)  (0) 2020.11.30
'Error code 모음/5. JAVA, Spring errors' 카테고리의 다른 글
  • [Spring Error] warning: Not generating hashCode: One of equals or hashCode exists. You should either write both of these or none of these (in the latter case, lombok generates them).
  • [ Spring ] org.apache.jasper.JasperException: Unterminated <c:url tag
  • [JAVA Error] java.lang.ClassCaseException 에러
  • [JAVA Error] 프로젝트 실행 후 import 안되는 문제 - Failed to start component [StandardEngine[Catalina].StandardHost[localhost]
쟈누
쟈누
Ad astra per aspera
    반응형
  • 쟈누
    쟈누의 기록공간
    쟈누
  • 전체
    오늘
    어제
    • 분류 전체보기 (444)
      • AWS (31)
        • Glue (4)
        • S3 (1)
      • 클라우드 (0)
      • Data Engineering (37)
        • GitHub (10)
        • NiFi (11)
        • Spark (10)
        • Snowflake (0)
        • 머신러닝, AI (6)
      • 언어 (118)
        • 데이터 베이스 (42)
        • JAVA (9)
        • Python (34)
        • Java Script (15)
        • Linux (18)
      • 프로젝트, 인강 그리고 책 (30)
        • Spotify Project (7)
        • RASA chatbot Project (9)
        • Naver shopping Project (6)
        • 빅데이터를 지탱하는 기술 (8)
      • OLD (56)
        • IT 용어 사전 (13)
        • Front End (12)
        • Back End (31)
      • Error code 모음 (165)
        • 1. SQL errors (17)
        • 2. Hadoop errors (20)
        • 3. Linux Errors (14)
        • 4. Python errors (33)
        • 5. JAVA, Spring errors (41)
        • 6. Jav Script errors (10)
        • 7. Dev Tools errors (9)
        • 8. Git errors (8)
        • 9. Jenkins Errors (4)
        • 10. airflow Errors (2)
        • 11. Aws errors (7)
      • 개인 (1)
        • 책 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 블로그 관리
    • 글쓰기
  • 링크

  • 공지사항

    • 간단한 블로그 소개
  • 인기 글

  • 태그

    자바
    install
    json
    파이썬
    node
    python error
    error
    linux
    SQL
    Spring
    Git
    API
    NiFi
    리눅스
    java
    AWS
    설치
    에러
    MySQL
    Python
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
쟈누
[Spring Error] could not execute statement; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
상단으로

티스토리툴바