Skip to main content

Timeline for JPA invalid stream header: 32303138

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Jun 8, 2021 at 13:30 comment added All Pereira I faced this problem when I was using LocalDatime instead of Timestamp.
Apr 1, 2021 at 13:52 comment added David Victor Just another one to watch out for. My IDE kindly auto-completed an import of what should have been 'java.sql.Timestamp' as 'java.security.Timestamp'. That resulted in the following: StreamCorruptedException: invalid stream header: 7874090D as it doesn't match the db.
Feb 19, 2021 at 16:49 comment added jediwompa Helped me realize that there was an issue deserializing an enum
Mar 23, 2019 at 12:54 comment added Frédéric Vinet It is clearly a problem of mapping. Replace LocalDate by javax.sql.Date and it should work.
Apr 17, 2018 at 15:50 comment added Kpo I used java.sql.Timestamp and it's working all fine! Thanks!
Apr 17, 2018 at 15:50 vote accept Kpo
Apr 17, 2018 at 15:09 comment added Stephen C Using SQL date time types ... IMO
Apr 17, 2018 at 15:04 comment added Kpo In which form should we store them then?
Apr 17, 2018 at 14:30 comment added Stephen C That is plausible. But IMO the real problem is in the mapping. Storing dates in the database as serialized Java objects is a bad idea.
Apr 17, 2018 at 13:13 comment added Kpo Could it be because I filled the row manually? We don't have an UI yet to fill a form so they told me to manually insert datas in the table to do my tests.
Apr 17, 2018 at 13:07 comment added Stephen C Actually, the evidence suggests that it is probably a VARCHAR in the database! And that the VARCHAR contains a formatted date / time string. Either way, the hibernate mapping is incorrectly attempting to deserialize some data that wasn't created by serialization.
Apr 17, 2018 at 13:05 comment added Kpo My date is stored as a serializable LocalDate object in my model, and as a timestamp without time zone in my table.
Apr 17, 2018 at 12:53 history answered Stephen C CC BY-SA 3.0