Home Help Center

Ice.InitializationException: null (in Ice.ObjectAdapterI)

deaxmandeaxman Member Dustin AxmanOrganization: LLEProject: Sending Scope data over a connection
What does Ice.InitializationException: null (in Ice.ObjectAdapterI) mean? When I run

communicator=null;
communicator = Ice.Util.initialize();
Ice.ObjectPrx obj = communicator.stringToProxy(Proxy1);
IceStorm.TopicManagerPrx topicManager = IceStorm.TopicManagerPrxHelper.checkedCast(obj);

Ice.ObjectAdapter adapter = communicator.createObjectAdapter("MonitorAdapter");
monitor = new PsmTopicIntfI(); //creates the monitor that waits for the signal
proxy = adapter.addWithUUID(monitor).ice_oneway();
topic = null;

I get it when it tries to create the adapter (MonitorAdapter) this code is almost word for word exactly the same as that in the online documentation for creating a subscriber in icestorm. Any thoughts?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    Welcome to the forum.

    It would be easier for us to track down the reason for this exception if you posted the complete stack trace of the exception.

    Thanks,
    Mark
  • deaxmandeaxman Member Dustin AxmanOrganization: LLEProject: Sending Scope data over a connection
    Stack trace

    Ice.InitializationException
    reason = "object adapter `MonitorAdapter' requires configuration"
    at Ice.ObjectAdapterI.<init>(ObjectAdapterI.java:884)
    at IceInternal.ObjectAdapterFactory.createObjectAdapter(ObjectAdapterFactory.java:130)
    at Ice.CommunicatorI.createObjectAdapter(CommunicatorI.java:77)
    at PsmConnection.<init>(PsmConnection.java:32)


    Here is the entire returned error.
  • No config for your adapter! ---> reason = "object adapter `MonitorAdapter' requires configuration"

    Where your config for adapter 'MonitorAdapter'?
  • deaxmandeaxman Member Dustin AxmanOrganization: LLEProject: Sending Scope data over a connection
    communicator and ObjectAdapter

    I think the root of the problem is that in the documentation online that I looked at for the subscriber you say "Ice.CommunicatorPtr" and "Ice.ObjectAdapterPtr" where as I drop out the ptr because the version of ice I installed has no ptr files. Why do you use them online when I can't find them anywhere (with a search) under the ice installation? Why do some of the more basic programs in your online documentation drop the "ptr" as I did? For example Writing an Ice Application with Java - Ice 3.4 - ZeroC this basic client server setup drops the ptr but this one Implementing an IceStorm Subscriber - Ice 3.4 - ZeroC uses it. Why?
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Dustin,

    The Ptrs are "smart points" used in the C++ mapping; in Java, there is no need for smart pointers (Java references are already 'smart'), so there is no Ptr.

    As cnhome pointed out, the issue here is that you didn't provide configuration for your object adapter--at a minimum, you need to set the .Endpoints property, for example:
    #Ice config file
    MonitorAdapter.Endpoints=tcp -h * -p 10000
    

    Alternatively (if you don't want to write any config), you could use createObjectAdapterWithEndpoints.

    Best regards,
    Bernard
  • deaxmandeaxman Member Dustin AxmanOrganization: LLEProject: Sending Scope data over a connection
    Online Code

    The code online for a java subscriber still uses ObjectAdapterPtr though. Also in the code online they never create a configuration for the adapter... here is the site I'm referencing Implementing an IceStorm Subscriber - Ice 3.4 - ZeroC and here is the code:

    Ice.ObjectPrx obj = communicator.stringToProxy("IceStorm/TopicManager:tcp -p 9999");
    IceStorm.TopicManagerPrx topicManager = IceStorm.TopicManagerPrxHelper.checkedCast(obj);

    Ice.ObjectAdapterPtr adapter = communicator.createObjectAdapter("MonitorAdapter");

    Monitor monitor = new MonitorI();
    Ice.ObjectPrx proxy = adapter.addWithUUID(monitor).ice_oneway();

    Thanks for all the help! I'm taking your advice with my code I just wanted to clarify the "why" aspect a bit more
Sign In or Register to comment.