org.dbunit.dataset.datatype.TypeCastException

Unable to typecast value <1997/02/14> of type <java.lang.String> to TIMESTAMP

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web66

Stack trace

  • org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <1997/02/14> of type <java.lang.String> to TIMESTAMP at org.dbunit.dataset.datatype.TimestampDataType.typeCast(TimestampDataType.java:120) at org.dbunit.dataset.datatype.TimestampDataType.setSqlValue(TimestampDataType.java:176) at org.dbunit.database.statement.SimplePreparedStatement.addValue(SimplePreparedStatement.java:73) at org.dbunit.operation.RefreshOperation$RowOperation.execute(RefreshOperation.java:189) at org.dbunit.operation.RefreshOperation.execute(RefreshOperation.java:113) at org.dbunit.AbstractDatabaseTester.executeOperation(AbstractDatabaseTester.java:190) at org.dbunit.AbstractDatabaseTester.onSetup(AbstractDatabaseTester.java:103) at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:156) at test.HibernateDbUnitTestCase.setUp(HibernateDbUnitTestCase.java:85) at test.PlayerTest.setUp(PlayerTest.java:117) Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] at java.sql.Timestamp.valueOf(Unknown Source) at org.dbunit.dataset.datatype.TimestampDataType.typeCast(TimestampDataType.java:116) ... 10 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
vega113vega113
4 times, last one
Unknown visitor
Unknown visitorOnce,