Home Help Center

NoEndpointException and IceGrid

albertodsalbertods Member Alberto Della SantinaOrganization: University of Pisa - department of IT EngineeringProject: Mobile remote controller ✭✭
Hi all,
I've written a j2me client that asks for a bidirectional connection (with the help of the callback-bidir example).

I've configure IceGrid in order to have a Locator service, but I get this error from the icegridnode when I start the client.
[ icegridnode: Activator: activated server `CallbackServer' (pid = 780) ]
C:\Documents and Settings\Alberto\Documenti\Visual Studio 2005\Projects\callback
\server.exe: .\ObjectAdapterI.cpp:951: Ice::IllegalIdentityException:
illegal identity: `'
[ icegridnode: Activator: detected termination of server `CallbackServer'
  exit code = 1 ]
[ icegridnode: Activator: activated server `CallbackServer' (pid = 3448) ]
C:\Documents and Settings\Alberto\Documenti\Visual Studio 2005\Projects\callback
\server.exe: .\ObjectAdapterI.cpp:951: Ice::IllegalIdentityException:
illegal identity: `'
[ icegridnode: Activator: detected termination of server `CallbackServer'
  exit code = 1 ]
[ icegridnode: Activator: activated server `CallbackServer' (pid = 38C:\D16)ocu
]
ments and Settings\Alberto\Documenti\Visual Studio 2005\Projects\callback\server
.exe: .\ObjectAdapterI.cpp:951: Ice::IllegalIdentityException:
illegal identity: `'
[ icegridnode: Activator: detected termination of server `CallbackServer'
  exit code = 1 ]
[ icegridnode: Activator: activated server `CallbackServer'C:\D (pocuid men= 1ts
 596and) ] Se
ttings\Alberto\Documenti\Visual Studio 2005\Projects\callback\server.exe: .\Obje
ctAdapterI.cpp:951: Ice::IllegalIdentityException:
illegal identity: `'
[ icegridnode: Activator: detected termination of server `CallbackServer'
  exit code = 1 ]



And this NoEndpointException when I start the client:
Ice.NoEndpointException
	at IceInternal.IndirectReference.getConnection(+69)
	at Ice.ObjectPrxHelperBase.ice_connection(+15)
	at Ice.ObjectPrxHelperBase.ice_isA(+12)
	at Ice.ObjectPrxHelperBase.ice_isA(+12)
	at Demo.CallbackSenderPrxHelper.checkedCast(+23)
	at ClientMIDlet.startApp(+71)
	at javax.microedition.midlet.MIDletProxy.startApp(+7)
	at com.sun.midp.midlet.Scheduler.schedule(+270)
	at com.sun.midp.main.Main.runLocalClass(+28)
	at com.sun.midp.main.Main.main(+116)


What would be the cause of this misfunctioning? Could you be so kind to give me some hints to figure out this problem?


Thanks in advance


This is the config.grid file:
IceGrid.InstanceName=DemoIceGrid

#
# The IceGrid locator proxy.
#
Ice.Default.Locator=DemoIceGrid/Locator:default -p 12000

#
# IceGrid registry configuration.
#
IceGrid.Registry.Client.Endpoints=default -p 12000
IceGrid.Registry.Server.Endpoints=default
IceGrid.Registry.Internal.Endpoints=default
IceGrid.Registry.Admin.Endpoints=default
IceGrid.Registry.Data=db/registry

#
# IceGrid node configuration.
#
IceGrid.Node.Name=localhost
IceGrid.Node.Endpoints=default
IceGrid.Node.Data=db/node
IceGrid.Node.CollocateRegistry=1
#IceGrid.Node.Output=db
#IceGrid.Node.RedirectErrToOut=1

#
# Trace properties.
#
IceGrid.Node.Trace.Activator=1
IceGrid.Node.Trace.Patch=1
#IceGrid.Node.Trace.Adapter=2
#IceGrid.Node.Trace.Server=3

...which I left almost untouched from the "simple" IceGrid example.


This is the application.xml:
<icegrid>

 
  <application name="Callback">
     <node name="localhost">
       <server id="Callback.Server" exe="server" activation="on-demand">
     <adapter name="Callback.Server" endpoints="tcp -h 192.168.1.220 -p 15000" register-process="true">
     <object identity="callback" type="myCallBack"/>
  </adapter>
  </server>
  </node>
</application> 
  

</icegrid>





Here are the instructions I use to make the j2me client communicate with the server (locator) and after with the real server from which I want the service.
 final String[] args = new String[0];
		    Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
    		Ice.Properties properties = Ice.Util.getDefaultProperties(argsH);
    		properties.setProperty("Ice.Default.Locator", "DemoIceGrid/Locator:default -h 192.168.1.220 -p 12000");
    		_communicator = Ice.Util.initialize(argsH);
    		
		    _hostnameConnection = (javax.microedition.io.ServerSocketConnection)javax.microedition.io.Connector.open("socket://");
	   		String mycurrentIP=_hostnameConnection.getLocalAddress(); //per trovare IP del client
		    
	   			   		
	   		_sndPrx = CallbackSenderPrxHelper.checkedCast(_communicator.stringToProxy("callback"));
	   	
		    System.out.println("Running on " + _hostnameConnection.getLocalAddress());
		    
	     
	      Ice.ObjectAdapter adapter = _communicator.createObjectAdapterWithEndpoints("Callback.Client", "tcp -h "+_hostnameConnection.getLocalAddress()); //NECESSARIO
		    Object=new CallBackReceiverI();
		    adapter.add(object,Ice.Util.stringToIdentity("callbackReceiver"));
		   
		    System.out.println("_sndPrx");
		    
		    
		  	ident.name = Ice.Util.generateUUID();
			ident.category = "";
			adapter.add(object, ident);   //queste ultime 3 istruzioni sono necessarie al bidir
		    adapter.activate();
		    
		  _sndPrx.ice_connection().setAdapter(adapter);   //bidir
			
		    _msg.setText("activated - client IP:"+_hostnameConnection.getLocalAddress());
		    System.out.println("activated");
	        _rcvPrx = CallbackReceiverPrxHelper.uncheckedCast(adapter.createProxy(Ice.Util.stringToIdentity("callbackReceiver")));  
	        System.out.println("rcvProxy ok");
		    }  
    	
         catch(Ice.NotRegisteredException ex)
		{
		    System.out.println("IceNotRegistered");
    		final String proxy = "DemoIceGrid/Query";
		    IceGrid.QueryPrx query = IceGrid.QueryPrxHelper.checkedCast(_communicator.stringToProxy(proxy));
		    _sndPrx = CallbackSenderPrxHelper.checkedCast(query.findObjectByType("myCallBack").ice_twoway().ice_timeout(-1));
		    if (_sndPrx==null){System.out.println ("Null...");}
		}
    	
    	catch(Exception ex)
	    {	      
	      //the code for this exception I presume
	      //that is not relevant for this post
	    }
	    


This is the code of the server:
 Ice::PropertiesPtr properties = communicator()->getProperties(); //IceGrid
	 Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Callback.Server");
	 Ice::Identity id = Ice::stringToIdentity(properties->getProperty("Identity"));  
 
	 CallbackSenderIPtr sender = new CallbackSenderI(properties->getProperty("Ice.ServerId")); 
	 adapter->add(sender,id); 

	 adapter->activate();  
	 
	 sender->start();  //bidir

	try	
    {
	communicator()->waitForShutdown();
    }
    catch(...)
    {
	sender->destroy();
	throw;
    }
    sender->destroy();

	
    return EXIT_SUCCESS;

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    You need to add '<property name="Identity" value="callback"/>' to your server descriptor. You server fails to start because it's missing this configuration property.

    Cheers,
    Benoit.
  • albertodsalbertods Member Alberto Della SantinaOrganization: University of Pisa - department of IT EngineeringProject: Mobile remote controller ✭✭
    Thank you very very very much! :):):)


    Alberto
Sign In or Register to comment.