Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Corba > problem running...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 465 of 534
Post > Topic >>

problem running example applet

by "scout3801" <scout3801@[EMAIL PROTECTED] > Oct 30, 2006 at 01:00 PM

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)




 1 Posts in Topic:
problem running example applet
"scout3801" <  2006-10-30 13:00:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 23:59:58 CDT 2008.