在测试的时候引发的bug:
由于我在项目中使用了druid数据源,由于druid数据源的版本太低,不支持JDK8中的LocalDate、LocalTime、LocalDateTime等日期类型,所以解决方案就是下载新版本的druid依赖。
十一月 17, 2023 12:52:50 上午 org.springframework.test.context.support.AbstractTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
十一月 17, 2023 12:52:50 上午 org.springframework.test.context.support.AbstractTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@4b952a2d, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3159c4b8, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@73846619, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@4bec1f0c, org.springframework.test.context.support.DirtiesContextTestExecutionListener@29ca901e, org.springframework.test.context.transaction.TransactionalTestExecutionListener@5649fd9b, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@6adede5, org.springframework.test.context.event.EventPublishingTestExecutionListener@2d928643]
十一月 17, 2023 12:52:51 上午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl info
信息: {dataSource-1} inited
org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'create_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException
; null; nested exception is java.sql.SQLFeatureNotSupportedException
对于异常(org.springframework.dao.InvalidDataAccessApiUsageException)的处理:
org.springframework.dao.InvalidDataAccessApiUsageException是Spring框架中的一个异常类,
通常在使用Spring Data JPA时出现。
它表示尝试将一个游离状态(detached)的实体对象持久化(persist)到数据库中时出现了异常。
而这个异常的原因是因为实体对象已经存在于数据库中,但是在持久化时却被当做一个新的实体对象来处理,导致了数据冲突。
引用中的错误信息是在尝试从结果集中获取名为’create_time’的列时出现了java.sql.SQLFeatureNotSupportedException异常,
这个异常通常是由于JDBC驱动程序不支持某些特定的功能或方法而引起的。
可能的解决方法是升级JDBC驱动程序或更改代码以避免使用不支持的功能或方法。