Archived
This forum has been archived. Please start a new discussion on GitHub.
createObjectAdapter() question
I am writing a .NET application (in c#) to connect to a java server side process. In my attempt to write the c# code (I'm not a .NET programmer by any stretch of the imagination), I've come across the following error:
at Ice.ObjectAdapterI..ctor(Instance instance, Communicator communicator, Obj
ectAdapterFactory objectAdapterFactory, String name, String endpointInfo, Router
Prx router, Boolean noConfig)
at IceInternal.ObjectAdapterFactory.createObjectAdapter(String name, String e
ndpoints, RouterPrx router)
at Ice.CommunicatorI.createObjectAdapter(String name)
at
...
The cause of this error is on the line:
communicator.createObjectAdapter(name + ".Callback.Client");
If I change this to createObjectAdapterWithEndpoints the call appears to succeed. (I'm attempting to use a bi-directional connection so I shouldn't really need to add the endpoints.) Does anyone have an idea of what may be the issue in the createObjectAdapter(string name) case? Is there anything I can do to debug this issue more? (I am using Ice version 3.2.0 on a windows XP machine)
Thanks,
Mayer
at Ice.ObjectAdapterI..ctor(Instance instance, Communicator communicator, Obj
ectAdapterFactory objectAdapterFactory, String name, String endpointInfo, Router
Prx router, Boolean noConfig)
at IceInternal.ObjectAdapterFactory.createObjectAdapter(String name, String e
ndpoints, RouterPrx router)
at Ice.CommunicatorI.createObjectAdapter(String name)
at
...
The cause of this error is on the line:
communicator.createObjectAdapter(name + ".Callback.Client");
If I change this to createObjectAdapterWithEndpoints the call appears to succeed. (I'm attempting to use a bi-directional connection so I shouldn't really need to add the endpoints.) Does anyone have an idea of what may be the issue in the createObjectAdapter(string name) case? Is there anything I can do to debug this issue more? (I am using Ice version 3.2.0 on a windows XP machine)
Thanks,
Mayer
0
Comments
-
Hi Mayer,
If you call "ToString()" on the exception, you should get a more meaningful error message.
If you want to create an object adapter without any property (e.g. one that you associate with a connection for bi-dir communications), this adapter's name must be the empty string ("").
This is a simple check to ensure that when you give a name to your object adapter, you don't mistype the associated property names. For example:
// code (adapter name mispelled)
adapter = createObjectAdapter("AccountManagment");
# config
AccountManagement.Endpoints=tcp
would detect the typo.
Best regards,
Bernard0 -
Wow, thanks for the quick response... Seems to work now. Is this true for all languages? And was this changed between 3.1 and 3.2? I think I did something similar in java in 3.1 and it let me get away with it, but it's been a while so I could just be imagining it.
Thanks again,
MayerHi Mayer,
If you call "ToString()" on the exception, you should get a more meaningful error message.
If you want to create an object adapter without any property (e.g. one that you associate with a connection for bi-dir communications), this adapter's name must be the empty string ("").
This is a simple check to ensure that when you give a name to your object adapter, you don't mistype the associated property names. For example:
// code (adapter name mispelled)
adapter = createObjectAdapter("AccountManagment");
# config
AccountManagement.Endpoints=tcp
would detect the typo.
Best regards,
Bernard0 -
Hi Mayer,
Yes, this object-adapter name behavior/check is new in Ice 3.2, and is the same in all language mappings.
Best regards,
Bernard0