Home Help Center

createObjectAdapter() question

mcrystalmcrystal Member Mayer CrystalOrganization: Goldman SachsProject: N/A
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

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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,
    Bernard
  • mcrystalmcrystal Member Mayer CrystalOrganization: Goldman SachsProject: N/A
    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,
    Mayer

    bernard wrote: »
    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,
    Bernard
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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,
    Bernard
Sign In or Register to comment.