Hi,<br>i'm trying, but i don't know where is my mistake here is my client in Java:<br><br>EchoClient.java<br>----------------------<br>import org.omg.CosNaming.*;<br>import org.omg.CORBA.*;<br><br>public class EchoClient {<br>
<br> public static void main(String args[]) {<br> try {<br> String SetInfo, ReturnInfo, ref;<br> org.omg.CORBA.Object objRef;<br> Echo EchoRef;<br> ORB orb = ORB.init(args, null);<br>
<br> objRef = orb.resolve_initial_references("NameService");<br> NamingContext ncRef = NamingContextHelper.narrow(objRef);<br><br> // locate the service<br> NameComponent nc = new NameComponent("test", "my_context");<br>
NameComponent nc2 = new NameComponent("Echo", "Object");<br> <br> NameComponent path[] = { nc,nc2 };<br> EchoRef = EchoHelper.narrow(ncRef.resolve(path));<br>
<br> if (args.length > 1) {<br> SetInfo = args[1];<br> } else {<br><br> }<br> System.out.println("Client Process Begin: ");<br> ReturnInfo = EchoRef.echoString("my corba test");<br>
System.out.println(ReturnInfo);<br> */<br> } catch (Exception e) {<br> System.out.println("ERROR : " + e);<br> }<br> }<br>}<br>-------------------------------<br>
<br>When run the client :<br><br>java EchoClient -ORBInitialPort 2809 <br><br>gives this error :<br>ERROR : org.omg.CosNaming.NamingContextPackage.NotFound: IDL:<a href="http://omg.org/CosNaming/NamingContext/NotFound:1.0">omg.org/CosNaming/NamingContext/NotFound:1.0</a><br>
<br>Can anyone help me please?<br><br>Thanks for your attention.<br><br clear="all"><span style="color: rgb(153, 153, 153);"></span>Best regards,<br>Valter Henrique.<br><br><div class="gmail_quote">2010/11/24 Valter Henrique <span dir="ltr"><<a href="mailto:valter.bcc@gmail.com">valter.bcc@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Sorry Duncan, but i don't understand what you say, i'm new in CORBA.<br>Could you give me an example, please ?<br>
<br>Thanks.<br><br><br><div class="gmail_quote">2010/11/24 Duncan Grisby <span dir="ltr"><<a href="mailto:duncan@grisby.org" target="_blank">duncan@grisby.org</a>></span><div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Wed, 2010-11-24 at 05:55 -0800, Valter Henrique wrote:<br>
<br>
> i'm tryng do build a simple application using 'echo' example.<br>
><br>
> I have my client in Java:<br>
<br>
</div>[...]<br>
<div>> // locate the service<br>
> NameComponent nc = new NameComponent("Echo", "");<br>
> NameComponent path[] = { nc };<br>
> EchoRef = EchoHelper.narrow(ncRef.resolve(path));<br>
<br>
</div>[...]<br>
<div>> java EchoClient -ORBInitialPort 2809<br>
> ERROR : org.omg.CosNaming.NamingContextPackage.NotFound:<br>
> IDL:<a href="http://omg.org/CosNaming/NamingContext/NotFound:1.0" target="_blank">omg.org/CosNaming/NamingContext/NotFound:1.0</a><br>
<br>
</div>As the exception says, the name you have looked up is not found. The eg3<br>
example uses the name test.my_context/Echo.Object . You need to either<br>
create the two NameComponents separately, or use the<br>
NamingContextExt::resolve_str method that will take the string form.<br>
<br>
Cheers,<br>
<br>
Duncan.<br>
<font color="#888888"><br>
--<br>
-- Duncan Grisby --<br>
-- <a href="mailto:duncan@grisby.org" target="_blank">duncan@grisby.org</a> --<br>
-- <a href="http://www.grisby.org" target="_blank">http://www.grisby.org</a> --<br>
<br>
<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>