Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me

 
mk singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic