Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice.NoEndpointException

Hello I am working on a java module to a .NET application which already use ICE for communication among its services.
I created the java module (service which implements one function - parseOntology() -defined by slice) and I compile it into bin/Server/OWLParser directory.
I want to call the parseOntology() function from another .NET (C#) module - the problem is in checkedCast() function - when I try to execute this code it throws Ice.NoEndpointException.
Could you please help me find the solution?
Thank you.

part of C# (client) module
            Ice.Communicator ic = null;
            ic = Ice.Util.initialize();
            Ice.ObjectPrx obj = ic.stringToProxy("Ferda.OntologyRelated.OWLParser");
            [B]Ferda.OntologyRelated.generated.OWLParserPrx prx = Ferda.OntologyRelated.generated.OWLParserPrxHelper.checkedCast(obj);[/B]
            prx.parseOntology("url");

important part of icegrid xml
		<replica-group id="FerdaOntologyRelatedReplicaAdapter">
			<object identity="Ferda.OntologyRelated.OWLParser" type="::Ferda::OntologyRelated::OWLParser"/>
		</replica-group>

		<service-template id="FerdaServiceTemplate">
			<parameter name="name"/>
			<parameter name="entry"/>
			<parameter name="endpoints"/>
			<service name="${name}" entry="${entry}">
				<adapter name="${service}" register-process="true" endpoints="${endpoints}" replica-group="${service}ReplicaAdapter"/>
			</service>
		</service-template>

		<server-template id="FerdaServerTemplateJava">
			<parameter name="index"/>
			<parameter name="endpoints" default="tcp:udp"/>
			<parameter name="pwd" default="${application.distrib}"/>
			<icebox id="${index}" exe="java" activation="on-demand" pwd="${pwd}">
			  <service-instance template="FerdaServiceTemplate" name="FerdaOntologyRelated" entry="Ferda.OntologyRelated.Service" endpoints="${endpoints}"/>
				<property name="IceBox.UseSharedCommunicator.FerdaOntologyRelated" value="0"/>
			</icebox>
		</server-template>	

		<node name="Local">
			<server-instance template="FerdaServerTemplate" index="0" pwd="bin/Server" endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1"/>
      	
			<server-instance template="FerdaServerTemplateJava" index="1" pwd="bin/Server/OWLParser" endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1"/>
		</node>

Comments

  • The string you pass to stringToProxy contains neither an endpoint nor an object adapter name. Hence, it is assumed to be the proxy for a well-known object. (See the section on well-known objects in the Ice Manual.)

    As shown in Section 39.6.2, well-known objects must be known to the registry and can be registered by adding an object descriptor to the deployment. However, the XML you show doesn't contain that descriptor, so the registry, when asked by the client-side run time to resolve the stringified proxy, replies with NoEndpointException because the registry doesn't know where that object can be found.

    Adding the missing object descriptor should fix your problem.

    Cheers,

    Michi.
  • Thanks for your reply, but I worry that the object descriptor is not right solution.
    I experimented with it whole day, and althought it is still not working (the same error - Ice.NoEndpointException) , I have a clearer version of xml.
    <node name="Local">
          <server-instance template="FerdaServerTemplate" index="0" pwd="bin/Server" endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1"/>
          
          <server id="1"
            exe="java"
            activation="on-demand"
            pwd="bin/Server/OWLParser">
            <option>Ferda.OntologyRelated.Service</option>
            <adapter name="FerdaOntologyRelatedReplicaAdapter"
              register-process="true"
              endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1">
              <object identity="Ferda.OntologyRelated.OWLParser" type="::Ferda::OntologyRelated::OWLParser"/>
            </adapter>
          </server>
          
    </node>
    

    All the services from the first server (server-instance with index 0) work fine. But the service from the server with id 1 doesn't work.

    I think I can successfully find the adapter from the client, objPrx from next code is "Ferda.OntologyRelated.OWLParser -t @ 1.FerdaOntologyRelatedReplicaAdapter"
    ObjectPrx objPrx = BoxModule.Manager.getManagersLocator().findAllObjectsWithType(
                            "::Ferda::OntologyRelated::OWLParser"
                            )[0];
    
    But when I call
    OWLParserPrxHelper.checkedCast(objPrx)
    
    There is thrown that Ice.NoEndpointException.

    Can't ther be a problem that I wrote two servers into one node? or that the second node isn't running?
  • First up, my apologies... I somehow missed that your original XML contained an object descriptor, so my answer wasn't terribly relevant :mad:

    It's difficult to know what is going wrong without having a self-contained test case that shows the problem. I would suggest the following:

    - Run the node and registry with

    IceGrid.Node.Trace.Activator=3
    IceGrid.Node.Trace.Server=3
    IceGrid.Registry.Trace.Adapter=1
    IceGrid.Registry.Trace.Locator=2

    - Use the IceGrid GUI to see whether your server actually starts.

    - Run the client with Ice.Trace.Protocol=2 and see after which on-the-wire message the exception is raised.

    - Check whether it works if you start the server manually instead of relying on automatic activation.

    This should give you an idea of what is going on quite quickly.

    If you can send us a small, stand-alone example, we can have a look at that too.

    Cheers,

    Michi.
  • Hello,

    the problem is in the server - the second one (with id 1) can't be started even manually through IceGrid Admin - error message is:

    "Server '1' did not start: The server terminated unexpectedly with exit code 1."

    I am trying to create some simple simulation of that error to post it here.
  • I'd put some trace into the server to see exactly why it terminates abnormally. That should quickly get you to the root cause of the problem.

    Cheers,

    Michi.
  • Hello Michi I want to thank you for your help - it was greatly appreciated.

    I solved the problem finally. I am posting the mistakes i did - for potential future solution seekers.

    1) I forgot to add <option>IceBox.Server</option> to java command.

    2) I didn't set path to classes which are used by the service (this includes two mistakes in one
    a) I had to include .jar files, which are directly referenced from the Service.java this allowed me to start the java icebox (no more Ice.NoEndpointException), but the service didn't work correctly
    b) I had to include all the .jar files (respectively all the classes), which are referenced from the classes already included (indirect referenced classes)

    The relevant part of icegrid xml file looks like this (it could be of course more brief, without the teplates)
      <replica-group id="FerdaOntologyRelatedReplicaAdapter">
        <object identity="Ferda.OntologyRelated.OWLParser" type="::Ferda::OntologyRelated::OWLParser"/>
      </replica-group>
    
      <service-template id="FerdaServiceTemplate">
        <parameter name="name"/>
        <parameter name="entry"/>
        <parameter name="endpoints"/>
        <service name="${name}" entry="${entry}">
          <adapter name="${service}" register-process="true" endpoints="${endpoints}" replica-group="${service}ReplicaAdapter"/>
        </service>
      </service-template>
    
      <server-template id="FerdaServerTemplateJava">
        <parameter name="index"/>
        <parameter name="endpoints" default="tcp:udp"/>
        <parameter name="pwd" default="${application.distrib}"/>
        <parameter name="owlapipath"/>
        <parameter name="icepath"/>
        <icebox id="${index}" exe="java" activation="on-demand" pwd="${pwd}">
          <env>CLASSPATH=${pwd};${icepath};${owlapipath}\owlapi-api.jar;${owlapipath}\owlapi-apibinding.jar;${owlapipath}\owlapi-oboparser.jar;${owlapipath}\owlapi-krssparser.jar;${owlapipath}\owlapi-functionalparser.jar;${owlapipath}\owlapi-owlxmlparser.jar;${owlapipath}\owlapi-rdfxmlparser.jar;${owlapipath}\owlapi-impl.jar;${owlapipath}\owlapi-rdfxmlrenderer.jar;${owlapipath}\owlapi-owlxmlrenderer.jar;${owlapipath}\owlapi-functionalrenderer.jar;${owlapipath}\owlapi-rdfapi.jar;%CLASSPATH%</env>
          <option>IceBox.Server</option>
          <service-instance template="FerdaServiceTemplate" name="FerdaOntologyRelated" entry="Ferda.OntologyRelated.Service" endpoints="${endpoints}"/>
          <property name="Ice.MessageSizeMax" value="409600"/>
          <property name="Ice.ThreadPool.Server.Size" value="10"/>
          <property name="Ice.ThreadPool.Server.SizeMax" value="1000"/>
          <property name="Ice.ThreadPool.Server.SizeWarn" value="950"/>
          <property name="IceBox.UseSharedCommunicator.FerdaOntologyRelated" value="0"/>
        </icebox>
      </server-template>
    		
      <node name="Local">
        <server-instance template="FerdaServerTemplate" index="0" pwd="bin/Server" endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1"/>			
        <server-instance template="FerdaServerTemplateJava" index="1" pwd="set in ferda.build" icepath="set in ferda.build" owlapipath="set in ferda.build" endpoints="tcp -h 127.0.0.1 :udp -h 127.0.0.1"/>
      </node>
    

    The properties of the service-instances are set in nant build file because I didn't find a way how to dynamically set full path to some file. Here is an example of setting the property:
      <xmlpoke file="bin/db/application.xml" xpath="/icegrid/application[@name = 'FerdaModulesApplication']/node[@name = 'Local']/server-instance[@template = 'FerdaServerTemplateJava']/@owlapipath" value="${path::get-full-path('src/Modules/FerdaOWLParser/OWL_API_src')}"/>
    

    Thanks again for your help and for your quick replies.
    See you.

    Marthin