Hi there!
Q: I'm currently unsuccessfully attempting to read back some persistent values i've stored. Please advise
me on what i'm missing. I get an exception (Microsoft C++ exception: Ice::NoObjectFactoryException @ 0x0012eea8).
I have a map:
StringPersistentUserAccountMap userAccountsMap(dbConnection, "UserAccounts");
filled with entries (4):
...
std::string newName3= "User3";
WGICE::PersistentUserAccountPtr newValue3= new WGICE::PersistentUserAccountI();
newValue1->Set("User3","Pass3","User3@UserGroup.com");
userAccountsMap.insert(make_pair(newName3,newValue 3));
...
and an object factory:
class ObjectFactory : public Ice::ObjectFactory
{
public:
virtual Ice::ObjectPtr create(const std::string & type)
{
if(type == "::WGICE::PersistentUserAccount");
return new ::WGICE::PersistentUserAccountI();
assert(false);
}
...
};
and setup the object factory:
ic = Ice::initialize(argc, argv);
ic->addObjectFactory(new ObjectFactory,"::WGICE::PersistentUserAccount");
I fail to get back any of the values:
StringPersistentUserAccountMap::iterator iterator;
for (iterator= userAccountsMap.begin();iterator!= userAccountsMap.end();iterator++)
{
...
std::string value= iterator->first;
...
}
with the following exception (NoObjectFactory):
Eine Ausnahme (erste Chance) bei 0x7c81eb33 in LoginTestServer.exe:
Microsoft C++ exception: Ice::NoObjectFactoryException @ 0x0012eea8.
Regards.

Reply With Quote