File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "help me" Watch "help me" New topic
Author

help me

mk singh
Greenhorn

Joined: May 30, 2002
Posts: 4
hi ranchers

i got one problem while executing the code for corba and idl, code for client side
mport HelloApp.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;

public class HelloClient
{
public static void main(String s[])
{

try{
ORB orb= ORB.init();
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("Hello", "");
NameComponent path[] = {nc};
Hello helloRef = HelloHelper.narrow(ncRef.resolve(path));
String hello = helloRef.sayHello();
System.out.println(hello);
}catch(Exception e)
{
System.err.println("Error:"+e);
}
}
}
code for server side

import HelloApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import java.security.*;

class HelloServent extends _HelloImplBase
{

public String sayHello()
{
return " hi to all of u from OMG";
}
}

public class HelloServer
{
public static void main(String s[])
{
try{

ORB orb = ORB.init();
HelloServent helloref = new HelloServent();
orb.connect(helloref);
org.omg.CORBA.Object objRef =orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("Hello", "");
NameComponent path[] = {nc};
ncRef.rebind(path, helloref);
java.lang.Object sync = new java.lang.Object();
synchronized(sync) {
sync.wait();
}
}catch(Exception e)
{
System.err.println("ERROR"+e);
}
}
}

when i start Server side code for execution it come with Secutity exception at run time .

plese give me the soluation.
thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: help me
 
Similar Threads
CORBA help needed
New to CORBA, problem with java client application
Problems with NameService
CORBA beginner, help needed
Corba - J2EE - tnameserv problem