🌳 에러 코드
2023-06-03 16:34:45,359 INFO [com.language.message.bo.MessageBOTest] ########### 메세지 보내기
Hibernate:
insert
into
message
(content, createdAt, receiverId, title, updatedAt, userId)
values
(?, ?, ?, ?, ?, ?)
2023-06-03 16:34:45,391 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] SQL Error: 1146, SQLState: 42S02
2023-06-03 16:34:45,391 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] Table 'foreign_language.message' doesn't exist
2023-06-03 16:34:45,401 INFO [org.springframework.test.context.transaction.TransactionContext] Rolled back transaction for test: [DefaultTestContext@651aed93 testClass = MessageBOTest, testInstance = com.language.message.bo.MessageBOTest@6cac0334, testMethod = 메세지보내기@MessageBOTest, testException = org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement, mergedContextConfiguration = [WebMergedContextConfiguration@4dd6fd0a testClass = MessageBOTest, locations = '{}', classes = '{class com.language.LanguageApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@44c03695, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@74e52ef6, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@3857f613, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@79079097, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@710f4dc7, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@234bef66], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]
2023-06-03 16:34:45,420 INFO [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] Closing JPA EntityManagerFactory for persistence unit 'default'
2023-06-03 16:34:45,421 INFO [com.zaxxer.hikari.HikariDataSource] HikariPool-1 - Shutdown initiated...
2023-06-03 16:34:45,426 INFO [com.zaxxer.hikari.HikariDataSource] HikariPool-1 - Shutdown completed.
🌳 해결 방법
🌾 원인 : JPA - message test 중에, Entity, BO, DAO 코드는 다 만들었으나, table를 만들지 않아서 발생한 오류.
🌾 해결 방법 : mysql에서 table을 만들고 다시 test 시도한다.
After
'코딩 에러 및 질문' 카테고리의 다른 글
There was an unexpected error (type=Not Found, status=404). (0) | 2023.06.04 |
---|---|
javax.el.PropertyNotFoundException (1) | 2023.06.04 |
nested exception is org.apache.ibatis.executor.ExecutorException (0) | 2023.05.31 |
글 삭제가 안 되는 현상. (0) | 2023.05.31 |
좋아요 빈하트에서 채운 하트로 바뀌지 않는 현상. (0) | 2023.05.31 |