Deserialization Error: 'unregistered class'

Forum for posting problems using QxOrm library

Deserialization Error: 'unregistered class'

Postby SteveW » Wed Feb 03, 2016 6:56 pm

Hello,

I hope this is my last question for a while, I believe I am close to having a working basic app framework we can start developing on...

As you now know from my previoues issues my project is using Boost serialization, Client/Server, using QxModelView classes DLL and now I have a QML application for the client UI. I believe everything is configured ok now with these settings.

My basic problem is the server is failing the de-serialization on the first test call I make to it. I will explain the settings/code just in case you can spot the obvious error...

Server:-

I have the QxEEGenericServicesServer program running ok (it links in the QxORM.LIB, ServicesServer.LIB), I load that and set the "PlugIn path" to the location of the Server Services.DLL (I assume this is right?)
I enter correct DB Connection settings. And use XML serialization for my initial test.
Click Start Server (btw, in the QxEE generated code the grp control for the Server Parameters) is set to Disabled by default. Is this deliberate?).
And on examine of the TCP stack, it is listening ok on the correct port (7968).

Client App:

The QML application links in the QxORM.LIB, the Model.LIB, ServicesClient.LIB and the Entities.LIB

When it runs I create the QxModelService<> class and perform a "fetchall" for one of the tables as such:-

Code: Select all
   qx::IxModel *pModel = new qx::QxModelService<customer_main_record, services::customer_main_record_services>;
   pModel->qxFetchAll_();


(We can forget about the QML code for now), but later I i have code that does:-

Code: Select all
   QQuickView qmlView;
   QString sQmlFile = "qrc:/main.qml";
   qmlView.rootContext()->setContextProperty("customer_main_record", pModel);


and then in the QML...

Code: Select all
      Button {
         text: "Fetch All"
         onClicked: customer_main_record.qxFetchAll_()
      }


Either calling method "works" ok from the client APP, the XML is generated and serialized ok at the client and sent out of the socket. The server picks it up as valid XML on the listening socket, but when it finally attempts to deserialize it from the code:-

Code: Select all
#if _QX_SERIALIZE_XML
      case QxConnect::serialization_xml:                    bDeserializeOk = qx::serialization::xml::from_byte_array(transaction, dataSerialized); break;
#endif // _QX_SERIALIZE_XML


Then
Code: Select all
qx_bool QxArchive_FromByteArray<T, ArchiveInput, ArchiveOutput>::fromByteArray(T & obj, const QByteArray & data, unsigned int flags /* = boost::archive::no_header */)


Fails at

Code: Select all
try { iar >> boost::serialization::make_nvp(sTag, obj); bDeserializeOk = true; }


With "unregistered class" in the bDeserializeOk.Desc.

Can you work out from my explanation what step I have missed to get the class(es) registered, or what code/build settings I have wrong to get past this (hopefully final) issue.

Thank
Steve.
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Deserialization Error: 'unregistered class'

Postby qxorm » Thu Feb 04, 2016 8:50 am

Hello,

I load that and set the "PlugIn path" to the location of the Server Services.DLL
...
in the QxEE generated code the grp control for the Server Parameters) is set to Disabled by default. Is this deliberate?
...
Error : with "unregistered class" in the bDeserializeOk.Desc

I think your problem is on server side.
The server exec sample generated by QxEE is a plugin loader.
Before starting your server, when you set the plugin directory, it should load all plugins available : in your case, I think it loads 0 plugin ==> this is why you don't have any services published by your server ==> error "unregistered class".

In debug mode, put a breakpoint on the void main_dlg::loadServices() method of the server exec sample generated by QxEE.
The listOfPlugins collection should have at least 1 item (number of plugins loaded).

Anyway, if your plugin is not loaded, I think this is because it fails to load its dependencies, so in the same directory (plugin path), you should put at least :
- the QxOrm DLL ;
- the dao part DLL generated by QxEE ;
- the services (server side) DLL ;
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Deserialization Error: 'unregistered class'

Postby SteveW » Thu Feb 04, 2016 3:28 pm

Hi

Thanks yes, it was missing DLL's I now have database connectivity working good with MySQL Drivers etc all loading and attempting the SQL query. But that leads to other problem unfortunately... I will post in new thread.

Steve.
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Deserialization Error: 'unregistered class'

Postby qxorm » Thu Feb 04, 2016 5:39 pm

it was missing DLL's I now have database connectivity working good with MySQL Drivers etc all loading and attempting the SQL query

Great !

Note : I will add a message box to the services sample exec : when you start your server and no plugin are loaded, something like this : "No plugin loaded, your server doesn't publish any services".
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 8 guests

cron