Reputation: 11
Application is using the Oracle database. And we have the H2 database used for Junit. We were using the h2 version of 1.4.182. Because of the vulnerability we have to upgrade to 2.2.220. When i update version, i got the below exception.
com.gtcgroup.justify.core.exception.internal.BeforeTestMethodRuleException:
Rule Class: com.it.pd.business.bf.ReportsTest
Message:
Causal exception: javax.persistence.RollbackException
A causal message: java.lang.ClassCastException: java.time.OffsetDateTime cannot be cast to java.sql.Timestamp
Causal exception: java.lang.ClassCastException
A causal message: java.time.OffsetDateTime cannot be cast to java.sql.Timestamp
at com.gtcgroup.justify.core.base.JstBaseRule$1.evaluate(JstBaseRule.java:102)
at com.gtcgroup.justify.core.base.JstBaseRule$1.evaluate(JstBaseRule.java:110)
at com.gtcgroup.justify.core.base.JstBaseRule$1.evaluate(JstBaseRule.java:110)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:539)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:761)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:461)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:207)
Caused by: com.gtcgroup.justify.core.exception.internal.JustifyRuntimeException:
Causal exception: javax.persistence.RollbackException
A causal message: java.lang.ClassCastException: java.time.OffsetDateTime cannot be cast to java.sql.Timestamp
Causal exception: java.lang.ClassCastException
A causal message: java.time.OffsetDateTime cannot be cast to java.sql.Timestamp
at com.gtcgroup.justify.jpa.helper.JstTransactionUtilHelper.transactEntities(JstTransactionUtilHelper.java:159)
at com.gtcgroup.justify.jpa.rm.JstTransactionJpaRM.transactMultipleEntities(JstTransactionJpaRM.java:61)
at com.gtcgroup.justify.jpa.rule.JstConfigureJpaRule.processDataPopulator(JstConfigureJpaRule.java:164)
at com.gtcgroup.justify.jpa.rule.JstConfigureJpaRule.beforeTM(JstConfigureJpaRule.java:137)
at com.gtcgroup.justify.core.base.JstBaseRule$1.evaluate(JstBaseRule.java:98)
... 18 more
java.lang.ClassCastException: java.time.OffsetDateTime cannot be cast to java.sql.Timestamp after Upgrading the H2database lib from 1.4.182 to com.h2database:h2:2.2.220
Upvotes: 0
Views: 139