I have two projects on tomcat. Both are web application. One acts like server and another acts as a client. The client application relies on the server application for data. It make data request to server and server respond with data as serialized java object. For the sake of desterilizing client is provided with a stub(Same classes that are streamed from server).
Recently the project was updated on one test server. After updating the arrangement worked fine but with one problem. After keeping the application on browser for 10 to 15 minutes one particular page start to crash. On investigating I found that for that page client is requesting server for some data but server is responding with older version of the same class existing with the client as a stub. This error doesn’t occur before this 10 minute time out. Server returns same class version as that is with client. I can’t figure out from where tomcat is getting the older version of that class after tat idle time out. Error throne is:
`java.io.InvalidClassException: com.ABC.XYZ; local class incompatible:stream classdesc serialVersionUID = 6683390643574875053, local class serialVersionUID = 100`
To narrow down the error I explicitly defined serialVersionUID fot that class 100L.
`serialVersionUID = 100L`
Before time out the class XYZ from both server and client prints same serialVersionUID = 100. but after sometime when it crashes it shows the serialVersionUID as 6683390643574875053 which was compiler generated serialVersionUID for the older version.
TH server in question is tomcat6.0 server on cantos6.3. This arrangement is working successfully on production as well as on various other test environment for last couple of years so the code is fine.
Further details will be provided if needed. Any idea what could be causing this. Thanks in advance.