Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The data serialized by fst-2.16 cannot be deserialized by fst-2.57 #306

Open
wenzhizhang opened this issue Oct 30, 2020 · 2 comments
Open

Comments

@wenzhizhang
Copy link

Hi team,
I suffered the deserialization issue with fst-2.57, could you please have a look?

The data was serialized with fst-2.16 and stored in DB, when I tried to deserialize this data with fst-2.57 I got below error.

unable to decode:]À��#ú(com.dx.test.data.pojo.IpVersionú+com.dx.test.data.pojo.SecurityModeü
2020-10-30-T10:05:31.423+0200 |  |  | main            | ERROR | com.dx.test.nzdt.DataSyncApp | data sync is failed because of error.
org.redisson.client.RedisException: Failed to get NeInfo from DB for key:PLMN-PLMN/SBTS-111
        at com.dx.test.data.repo.ne.NeInfoRepo.get(NeInfoRepo.java:112)
        at com.dx.test.nzdt.repo.NeInfoForNA19AndLaterRepo.get(NeInfoForNA19AndLaterRepo.java:18)
        at com.dx.test.nzdt.repo.NeInfoForNA19AndLaterRepo.getAll(NeInfoForNA19AndLaterRepo.java:65)
        at com.dx.test.nzdt.ExportData.exportRegInfoForNA19OrLaterReleases(ExportData.java:57)
        at com.dx.test.nzdt.ExportData.exportData(ExportData.java:26)
        at com.dx.test.nzdt.DataSyncApp.main(DataSyncApp.java:49)
Caused by: java.io.IOException: java.lang.RuntimeException: unable to find class for code 93
        at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:247)
        at org.nustaq.serialization.FSTConfiguration.asObject(FSTConfiguration.java:1158)
        at com.dx.test.data.common.DataTypeConverter.bytesToObject(DataTypeConverter.java:45)
        at com.dx.test.data.dao.NeDao.select(NeDao.java:153)
        at com.dx.test.data.repo.ne.NeInfoRepo.getFromDB(NeInfoRepo.java:206)
        at com.dx.test.data.repo.ne.NeInfoRepo.get(NeInfoRepo.java:109)
        ... 5 more
Caused by: java.lang.RuntimeException: unable to find class for code 93
        at org.nustaq.serialization.FSTClazzNameRegistry.decodeClass(FSTClazzNameRegistry.java:180)
        at org.nustaq.serialization.coders.FSTStreamDecoder.readClass(FSTStreamDecoder.java:478)
        at org.nustaq.serialization.FSTObjectInput.readClass(FSTObjectInput.java:939)
        at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:347)
        at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:331)
        at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:311)
        at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:245)
        ... 10 more

Are different encoding mechanisms used in the 2 versions?

Your support will be appreciated a lot.

Best regards,
Wenzhi

@RuedigerMoeller
Copy link
Owner

Yes, its not compatible.
Workaround (I did for similar projects)

  • get the sources for 2.16 (from maven.org)
  • setup an IDE project (e.g. intellij)
  • use "refactor/rename" to rename the complete fst package
  • make a build of this

you then can use 2.16 and 2.57 in parallel and write a conversion method.

@wenzhizhang
Copy link
Author

Thank you very much, @RuedigerMoeller , I'll try this workaround in my project.

Best regards,
Wenzhi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants