TroubleShooting

    [JPA] 쿼리 생성하는 메서드명의 keyword를 체크하자.

    [JPA] 쿼리 생성하는 메서드명의 keyword를 체크하자.

    에러 발생한 에러는 다음과 같습니다. Caused by: java.lang.IllegalStateException: Operator SIMPLE_PROPERTY on imageId requires a scalar argument, found class {클래스명} in method {메서드명}({메서드의 인자 path}). failed to creqte query ~~ 라고 하며 위와 같이 문제되는 메서드를 친절히 알려주는데, 해당 메서드가 쿼리를 만들어내지 못한다는 의미로 해석할 수 있습니다. 바로 아래 deleteAllByImageId() 메서드가 문제입니다. @Repository public interface ImageRepository extends JpaRepository { // 생략 void..

    [데이터 무결성 위반] nested exception is org.springframework.dao.DataIntegrityViolationException

    [데이터 무결성 위반] nested exception is org.springframework.dao.DataIntegrityViolationException

    발생 에러 Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement DataIntegrityViolationException, 즉 데이터 무결성 (Data Integrity) 위반 문제(Violation Exception)가 발생했다. 에러 원인 Review id를 외래키로 참조하고 있는 Comment 테이블이 있기 때문에 Review 데이터를 제거하려할..

    MySQL 삭제 후 재설치 에러 : The older version of MYSQL Installer

    MySQL 삭제 후 재설치 에러 : The older version of MYSQL Installer

    기존에 있던 MySQL의 root 비밀번호를 잊어버리는 바람에 제거 후에 재설치를 하게 됐는데... 이번 글에서 다룰 오류 뿐만 아니라 여러 문제로 해결하는 데에만 하루하고 몇 시간을 쏟았다... 결국 원인은 구글링하며 문제를 해결하던 중 레지스트리 파일을 건들인 것이 원인이라고 생각이 든다. 만약 필자의 상황처럼 root 비밀번호를 잊어버려 MySQL 제거 후 재설치하다가 위와 같은 에러가 발생한 상황이라면 아래 과정을 진행해보자! 문제 mysql-installer-community-8.0.27.1 파일을 클릭하여 다운을 받으려하면 아래와 같이 오류가 뜬다. The older version of MySQL Installer - Community cannot be removed. Contact your ..

    [mustache 에러] com.samskivert.mustache.MustacheParseException: Section close tag with mismatched open tag 'if' != 'if sessionScope.principal'

    [mustache 에러] com.samskivert.mustache.MustacheParseException: Section close tag with mismatched open tag 'if' != 'if sessionScope.principal'

    발생 에러 com.samskivert.mustache.MustacheParseException: Section close tag with mismatched open tag 'if' != 'if sessionScope.principal' @ line 44 구체적으로는 아래와 같다. 더보기 com.samskivert.mustache.MustacheParseException: Section close tag with mismatched open tag 'if' != 'if sessionScope.principal' @ line 44 at com.samskivert.mustache.Mustache$Accumulator.requireSameName(Mustache.java:754) ~[jmustache-1.15..

    toString() 을 재정의하는 것을 잊지말자

    toString() 을 재정의하는 것을 잊지말자

    Spring boot에서 JPA로 쿼리문을 실행하여 값을 얻는데 문제가 발생했다. 현재 필자의 상황은 User 테이블에서 PK인 userId를 이용해서 필드 now_emotion과 ad_id를 조회하고자 했다. 그리고 조회된 ad_id를 출력하니 19가 아닌 클래스명과 주소값인 com.healing4u.healing4umobileWeb.model.Advertisement@116da866 이 출력되는 것이다. (클래스명을 출력하는 메서드는 user.getAdId().getClass() ) 이때의 코드는 아래와 같다. @Service public class UserService { @Autowired private UserRepository userRepository; @Autowired private Ad..

    [Linux] E: /var/lib/dpkg/lock-frontend 잠금 파일을 얻을 수 없습니다 에러

    [Linux] E: /var/lib/dpkg/lock-frontend 잠금 파일을 얻을 수 없습니다 에러

    sudo apt-get upgrade 명령어를 입력했을 때 이런 오류가 뜨는 경우가 있습니다. 재부팅을 하면 보통 해결된다고 하지만, 터미널 기록을 지우기 아쉬운(?) 상황이라면, 재부팅보다는 lock 파일들을 지우는 방법을 이용하면 해결됩니다. sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock* # 후에 다시 실행하면 오류없이 잘 진행됩니다. sudo apt upgrade 이렇게 하면 보통 해결이 된다하는데, 만약 계속 오류가 난다면 다음 명령어를 실행하고 다시 upgrade 해보세요. sudo dpkg --configure -a sudo apt-get update