|
|
|
|||||
|
Ice::NoObjectFactoryException
Hello,
I my slice definition I've created a sequence, that contains Test objects. In this class there is a function, which returns the 'TestSequence': class Test; sequence<Test> TestSequence; class Test { TestSequence op(); }; The client invokes the function as follows: TestSequence test = new TestSequence; test = testProxy->op(); The server executes the function call: TestSequence TestI: p(){ TestSequence testSeq = new TestSequence; ... TestPtr obj = new TestI(); testSeq.push_back(obj); ... return testSeq; } If I run my application I get the following error message: Test.cxx: Ice::NoObjectFactoryException: protocol error: no suitable object factory found for '::Test' I don't know where the problem lies. Can you help me out? Thanks |
|
||||||
|
Sure, that's called "by proxy". (We try to avoid the term "reference", because it is so ambiguous.)
Sending a proxy for an object instead of the object by value is much more common. Please see the Ice documentation for more information, it has lots of examples for by-proxy transfer. |
|
|||||
|
After I had a look at the demo programs, I have changed my example to 'by proxy' transfer. In my client I invoke a function as remote call. In the server the function is executed and send back a proxy [TestSequence - Object] to the client.
Slice: **** class Test; sequence<Test> TestSequence; class Test { void op(out TestSequence testSeq); }; Client: ***** Ice::ObjectFactoryPtr factory = new ObjectFactory; communicator->addObjectFactory(factory, "::Test"); TestSequence *testObject = new TestSequence; proxy->op(*testObject); Server: ****** void TestI: p(TestSequence &testSeq, const Ice::Current&){ ... TestPtr obj = new TestI(); testSeq.push_back(obj); ... } While executing my application I get the following message: server: error: unknown exception in 'Ice.ThreadPool.Server' I think it's only a small problem, but I can't see it. |
|
||||||
|
This is still by-value transfer. If you want by-proxy transfer, you would have to change:
sequence<Test> TestSequence; To: sequence<Test*> TestSequence; As for the exception, I'm afraid I don't know where this is coming from. Do you have a stack trace? Also note that you don't need an object factory for by-proxy transfer. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NoObjectFactoryException for method-less class | borax00 | Help Center | 7 | 07-20-2006 05:07 AM |
| "NoObjectFactoryException" when call methods in interface by java | richardma | Help Center | 8 | 12-02-2005 08:46 AM |