작성
·
185
0
[질문 내용]
https://drive.google.com/file/d/1z8O0dwyDnjTmm-OtFu6CcHwTW6sXSxlV/view?usp=sharing
강의 따라하다가 clean 하고 build를 다시 했는데 빌드시 테스트에 오류나고 테스트실행시 모두 오류떠서 돌아가지 않습니다..ㅜㅜ !
답변 1
1
제 환경에서는 build에도 문제가 없었습니다.
(1) h2가 실행중인 상태에서 테스트를 시도하신게 맞을까요?
(2) h2 버전이 2.2.224를 설치하신게 맞을까요? querydsl DB도 2.2.224를 통해 생성한게 맞는지도 알려주세요 😀
(3) (1)~(2)에서 특이점이 보이지 않는다면 test에 대한 설정파일을 분리해서 확인해볼 수 있을 것 같습니다 😀
test/resources/application.yml을 생성하신 후 아래 설정을 yml에 적용하여 확인해보시겠어요?
spring:
datasource:
url: jdbc:h2:mem:testdb
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true
use_sql_comments: true
해봤는데 안되네여 ㅠㅠ..
빌드 자체가 안되서 명령 프롬프트로 빌드 실행하면
C:\workspace\querydsl\querydsl>gradlew compileQuerydsl
FAILURE: Build failed with an exception.
* What went wrong:
Task 'compileQuerydsl' not found in root project 'querydsl'.
* Try:
> Run gradlew tasks to get a list of available tasks.
> For more on name expansion, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 1s
이렇게 뜨고
인텔리제이로 실행하면
이렇게 뜹니다
또 테스트 실행시 다 오류가 뜨고 엄청 긴 오류가 뜨는데 글자수 제한으로 에러부분만 복사했습니다
2024-05-20T17:46:09.980+09:00 ERROR 6404 --- [ Test worker] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)
2024-05-20T17:46:09.982+09:00 WARN 6404 --- [ Test worker] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)
2024-05-20T17:46:10.010+09:00 INFO 6404 --- [ Test worker] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-05-20T17:46:10.058+09:00 ERROR 6404 --- [ Test worker] o.s.boot.SpringApplication : Application run failed