Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7722275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:07:43+00:00 2026-06-01T04:07:43+00:00

I am trying to update some hibernate code that was written by someone else

  • 0

I am trying to update some hibernate code that was written by someone else in the past and running into the deserialization issue. The way original code was written, it did not have serialVersionUID explicitly declared and just implemented Serializable interface –

public class SamplePOJO implements Serializable {

Now, I am trying to add a new column to the table and map it to this object. I:

  1. Altered table to create new column
  2. Updated the object to include a new String object and getter/setter
    for that, and
  3. Updated .hbm file to map the db table column with the object.

However, when I run it after compilation I get the following error –

"Error while deserializing from byte[]., caused by x.y.SamplePOJO; local class incompatible: stream classdesc serialVersionUID = 7997933458932550222, local class serialVersionUID = <other number internally auto generated as  source didn't explicitly mention serialVersionUID>"

If I update the code to include the serialVersionUID that matches the one thrown in the above error, it executes without any issues.

Based on what info I have found the most common cause seem to be different hibernate jars in client and server. However, that is not the case here as it uses the same hibernate jar. Could someone help if there is a way to fix this problem without having to specifically mention the serialVersionUID that’s thrown during the exception? Also, if I have to stick with this approach and if my code moves to another environment (qa/prod), would it expect different serialVersionUID depending on how it is serialized in other environments?

I will appreciate any/all help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:07:45+00:00Added an answer on June 1, 2026 at 4:07 am

    To answer your second question first, the generation of serialVersionUID at runtime by the JVM is specified by the Java Object Serialization Specification. Whilst the generation of the serialVersionUID at runtime is predicatable, it can vary between java compilers as it is dependant on composition of the class file which is compiler implementation specific. So your compiled code should not generate different serialVersionUIDs at runtime in different environments. You can use the serialver command from the JDK to calculate the runtime generated serialVersionUID for a class.

    You talk about having the hibernate jar on the client and the server, this sounds like you are serializing your entities between two different JVM’s, are you sure the client has the updated entity class? The error indicates that you are attempting to deserialize a byte[] generated from the serialization of a different version of the class file. You either need to ensure you are deserializing into the same version of the class or add the serialVersionUID to the class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to update the contents of an element after running some php code.
Im trying to update some nested params from a form. I can see that
I'm trying to update some properties with KVC. The properties have been synthesized. This
Hi I am trying to update a div with some html from another div.
I'm trying to update the display brightness from a widget but i have some
i'm trying to make a ajax update in prototype with some values from a
I am trying to use drush to update my drupal core but in some
I'm trying to convert my hibernate-based GWT implementation into a JPA2 version. I've added
I have been trying to use Hibernate for a while. I like hibernate that
I'm trying to get started with Hibernate, but can't insert data, for some reason.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.