Deserialization error : 'input stream error'

Forum for posting problems using QxOrm library

Deserialization error : 'input stream error'

Postby nickla » Fri Sep 28, 2012 9:16 am

My programm works good if i try to use it into one computer. I mean client and server side on one i386 machine.

Today i tried to deploy it on production server and clients. I compiled it and started. When i try to send request from client to server i receive error in client and this on server:
[QxOrm] qx::QxArchive<T>::fromByteArray() -> Deserialization error : 'input stream error'
"28.09.2012 12:38 : [QxOrm] unable to read request from socket : 'Deserialization error : 'input stream error''"


I`ll check it in the evening, but it will be great if you know the reason of this issue. I`ll sniff packets using wireshark today to get more information.

Server configuration:
administrator@tlimon-server:/usr/lib$ uname -a
Linux tlimon-server 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
administrator@tlimon-server:/usr/lib$ ls -l /usr/lib/*boost*
-rw-r--r-- 1 root root 101544 2011-06-04 01:30 /usr/lib/libboost_iostreams.so.1.46.1
-rw-r--r-- 1 root root 1242810 2011-06-04 01:30 /usr/lib/libboost_serialization.a
lrwxrwxrwx 1 root root 24 2011-06-04 01:30 /usr/lib/libboost_serialization-mt.a -> libboost_serialization.a
lrwxrwxrwx 1 root root 32 2011-06-04 01:30 /usr/lib/libboost_serialization-mt.so -> libboost_serialization.so.1.46.1
lrwxrwxrwx 1 root root 32 2011-06-04 01:30 /usr/lib/libboost_serialization.so -> libboost_serialization.so.1.46.1
-rw-r--r-- 1 root root 446552 2011-06-04 01:30 /usr/lib/libboost_serialization.so.1.46.1
-rw-r--r-- 1 root root 846074 2011-06-04 01:30 /usr/lib/libboost_wserialization.a
lrwxrwxrwx 1 root root 25 2011-06-04 01:30 /usr/lib/libboost_wserialization-mt.a -> libboost_wserialization.a
lrwxrwxrwx 1 root root 33 2011-06-04 01:30 /usr/lib/libboost_wserialization-mt.so -> libboost_wserialization.so.1.46.1
lrwxrwxrwx 1 root root 33 2011-06-04 01:30 /usr/lib/libboost_wserialization.so -> libboost_wserialization.so.1.46.1
-rw-r--r-- 1 root root 323112 2011-06-04 01:30 /usr/lib/libboost_wserialization.so.1.46.1
administrator@tlimon-server:/usr/lib$ qmake --version
QMake version 2.01a
Using Qt version 4.7.4 in /usr/lib/x86_64-linux-gnu


Client configuration:
administrator@OFFICE-MANAGER-1:~$ uname -a
Linux OFFICE-MANAGER-1 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux
administrator@OFFICE-MANAGER-1:~$ ls -l /usr/lib/*boost*
-rw-r--r-- 1 root root 991278 янв. 2 2012 /usr/lib/libboost_serialization.a
lrwxrwxrwx 1 root root 24 янв. 2 2012 /usr/lib/libboost_serialization-mt.a -> libboost_serialization.a
lrwxrwxrwx 1 root root 32 янв. 2 2012 /usr/lib/libboost_serialization-mt.so -> libboost_serialization.so.1.46.1
lrwxrwxrwx 1 root root 32 янв. 2 2012 /usr/lib/libboost_serialization.so -> libboost_serialization.so.1.46.1
-rw-r--r-- 1 root root 420268 янв. 2 2012 /usr/lib/libboost_serialization.so.1.46.1
-rw-r--r-- 1 root root 693230 янв. 2 2012 /usr/lib/libboost_wserialization.a
lrwxrwxrwx 1 root root 25 янв. 2 2012 /usr/lib/libboost_wserialization-mt.a -> libboost_wserialization.a
lrwxrwxrwx 1 root root 33 янв. 2 2012 /usr/lib/libboost_wserialization-mt.so -> libboost_wserialization.so.1.46.1
lrwxrwxrwx 1 root root 33 янв. 2 2012 /usr/lib/libboost_wserialization.so -> libboost_wserialization.so.1.46.1
-rw-r--r-- 1 root root 301196 янв. 2 2012 /usr/lib/libboost_wserialization.so.1.46.1
administrator@OFFICE-MANAGER-1:~$ qmake -v
QMake version 2.01a
Using Qt version 4.8.1 in /usr/lib/i386-linux-gnu
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Deserialization error : 'input stream error'

Postby qxorm » Fri Sep 28, 2012 9:49 am

Hi,

If you are using binary serialization (this is the default setting for QxService module), perhaps it's your problem !
As it's explained in the FAQ (http://www.qxorm.com/qxorm_en/faq.html#faq_75), binary serialization is "not portable" => so you can't transfer data between 2 differents platforms.

To fix it, it's very easy to do, you just have to modify on server side AND on client side the type of serialization used.
You could try XML serialization, it's portable.

Just use this code to modify the serialization type (server AND client) :
Code: Select all
qx::service::QxConnect::getSingleton()->setSerializationType(qx::service::QxConnect::serialization_xml);


Note : there is a combobox in qxClientServer sample project to show how to modify serialization type dynamically.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Deserialization error : 'input stream error'

Postby nickla » Fri Sep 28, 2012 7:22 pm

I see it in sniffer. You are right - it is bonary serialization. I need to set it to something like XML.

Thank you.

P.S.:

Note : binary type is not portable, so you can't transfer data between Windows and Unix for example.


Add that binary type is not portable between x32 and x64 platform. I tested it on ubuntu 12.04 on both sides as you can see in my first comment.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron