dcsimg
corba applet client fail to run
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   weini_lu
Posted On:   Tuesday, September 24, 2002 07:50 PM

Hi, I write a applet client to invoke corba server. The applet can run ok in appletviewer of jbuilder5, but can not run in my IE browser. the exception is: org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No the client code is: // Client.java package CorbaAppletTest; import org.omg.CosNaming.*; import java.applet.*; import java.awt.*; public class Client extends Applet { public void init(){ TextField TextHello=new TextField(this.getHello("lwn")); add(TextHello );   More>>

Hi,

I write a applet client to invoke corba server. The applet can run ok in appletviewer of jbuilder5, but can not run in my IE browser.


the exception is:


org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No


the client code is:


// Client.java


package CorbaAppletTest;


import org.omg.CosNaming.*;


import java.applet.*;


import java.awt.*;


public class Client extends Applet {


public void init(){


TextField TextHello=new TextField(this.getHello("lwn"));


add(TextHello );


}


public String getHello(String name) {


String[] arg=null;


String data="";


try {


java.util.Properties props = new java.util.Properties();


org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(arg,props);


org.omg.CORBA.Object rootObj = orb.resolve_initial_references("NameService");


NamingContextExt root = NamingContextExtHelper.narrow(rootObj);


org.omg.CORBA.Object mgrObj = ((NamingContext)root).resolve(root.to_name("BankManager"));


Bank.AccountManager manager = Bank.AccountManagerHelper.narrow(mgrObj);


Bank.Account account = manager.open(name);


float balance = account.balance();


data = new String("the balance in "+name+"'s account is $"+balance);


}
catch (Exception e) {


e.printStackTrace();


}


return data;


}


}


th HTML file is:










HTML Test Page








Applet1 will appear below in a Java enabled browser.



codebase = "."
code = "CorbaAppletTest.Client.class"
name = "CorbaApplet"
archive = "CorbaTest.jar"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "top"
>











   <<Less

Re: corba applet client fail to run

Posted By:   mep_wang  
Posted On:   Wednesday, September 25, 2002 07:10 AM

You had specified initial host and port,but didnt put it into ORBs.


Your ORB initialization should be:


//>>>>>>>>>>>>>> the following is code


java.util.Properties props = new java.util.Properties();
props.put("ORBInitialPort",getParameter("org.omg.CORBA.ORBInitialPort"));
props.put("ORBInitialHost",getParameter("org.omg.CORBA.ORBInitialHost"));


org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this,props);


//>>>>>>>>>>>>>> end of code

About | Sitemap | Contact