I set up Sun's applet/corba example for HelloWorld. It runs fine in
appletviewer, but when run from a browser, even from localhost, an
exception get's thrown on the following line:
org.omg.CORBA.Object tobj = ncRef.resolve(path);
This is running Firefox on a machine running Centos 4 using the sdk v.
1.4.2-12, no firewall. I know there are problems with versino 1.5x,
but this isn't the same problem. Is this just the way it is, or is
there a work around?
Thanks,
-Charles
code plus output:
import HelloApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import java.awt.Graphics;
public class HelloApplet extends java.applet.Applet
{
public void init()
{
try{
// Create and initialize the ORB
// The applet 'this' is passed to make parameters from the tag
// available to initialize the ORB
ORB orb = ORB.init(this, null);
// Get the root naming context
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
// Resolve the object reference in naming
NameComponent nc = new NameComponent("Hello", "");
NameComponent path[] = {nc};
org.omg.CORBA.Object tobj = ncRef.resolve(path); // Exception
thrown here!!!
Hello helloRef = HelloHelper.narrow(tobj);
// Call the Hello server object and print the results
//message = helloRef.sayHello();
} catch(Exception e) {
System.out.println("HelloApplet exception: " + e);
e.printStackTrace(System.out);
}
}
String message = " ";
public void paint(Graphics g)
{
g.drawString(message, 25, 50);
}
}
Output:
HelloApplet exception: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor
code: 201 completed: No
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed:
No
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:173)
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
at
com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
at
com.sun.corba.se.internal.corba.ClientDelegate.request(ClientDelegate.java:886)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:431)
at
org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:397)
at HelloApplet.init(HelloApplet.java:39)
at sun.applet.AppletPanel.run(AppletPanel.java:354)
at java.lang.Thread.run(Thread.java:534)


|