[error] findByOOOStartingWith / Hibernate error

개발하는자·2022년 5월 24일
0

문재 해결

목록 보기
3/3
2022-05-24 20:38:01.965 ERROR 23545 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [\] did not match expected type [java.lang.String (n/a)]; nested exception is java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)]] with root cause

java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)]
	at org.hibernate.query.spi.QueryParameterBindingValidator.validate(QueryParameterBindingValidator.java:54) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.spi.QueryParameterBindingValidator.validate(QueryParameterBindingValidator.java:27) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.internal.QueryParameterBindingImpl.validate(QueryParameterBindingImpl.java:90) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.internal.QueryParameterBindingImpl.setBindValue(QueryParameterBindingImpl.java:55) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:501) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:122) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.criteria.internal.compile.CriteriaCompiler$1$1.bind(CriteriaCompiler.java:141) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.criteria.internal.CriteriaQueryImpl$1.buildCompiledQuery(CriteriaQueryImpl.java:364) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.query.criteria.internal.compile.CriteriaCompiler.compile(CriteriaCompiler.java:171) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:774) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:114) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]




Spring Data JPA에서 findByOOOStartingWith 를 사용해 결과를 찾으려고 하던 도중 발생한 에러입니다.



첫번째 쿼리

두번째 쿼리

첫번째 쿼리는 정상적으로 동작하나 두번째 쿼리는 실패합니다.



👉 해결

Hibernate 5.6.6 이상에서 발생하는 문제입니다.

        <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.6.0.Final</version>
        </dependency>

pom.xml 에서 버전을 5.6.0으로 바꾸니 해결됬습니다.



자세한 정보를 원하시면 아래 링크를 참고하세요.

https://github.com/spring-projects/spring-data-jpa/issues/2472

profile
To the moon.

0개의 댓글