dcsimg
Get a reference to the NamingContext object through an applet run remotely
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nicola_Bianchessi
Posted On:   Friday, July 20, 2001 01:46 AM

Running the applet through the appletviewer on the same machine all goes well, but when I try to run the applet remotely, resolving the reference to the NamingContext result in a null reference. Here the code: hostValue=getParameter("ORB_INITIAL_HOST"); if (hostValue==null){ hostValue=HOST_VALUE; } portValue=getParameter("ORB_INITIAL_PORT"); if (portValue==null){ portValue=PORT_VALUE; } Properties props=new Properties(); props.put(HOST_PROPERTY,hostValue); props.put(PORT_PROPERTY,portValue); // Initialize the ORB. show   More>>


Running the applet through the appletviewer on the same machine all goes well, but when I try to run the applet remotely, resolving the reference to the NamingContext result in a null reference.


Here the code:

			

hostValue=getParameter("ORB_INITIAL_HOST");

if (hostValue==null){

hostValue=HOST_VALUE;

}


portValue=getParameter("ORB_INITIAL_PORT");

if
(portValue==null){

portValue=PORT_VALUE;

}


Properties props=new Properties();

props.put(HOST_PROPERTY,hostValue);

props.put(PORT_PROPERTY,portValue);


// Initialize the ORB.

showStatus("Initializing the ORB");



try

{

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

}

catch (Exception e)

{

System.out.println("Exception during ORB inizialization");

}


// Get a reference to the Naming service

org.omg.CORBA.Object nameServiceObj =null;


try

{

nameServiceObj = orb.resolve_initial_references ("NameService");

}

catch (Exception e)

{

System.out.println("Exception during...");

}



The HTML file containing the applet tag
specify the tho parameters ORB_INITIAL_HOST (the host on which the tnameserv is running) and ORB_INITIAL_PORT (the port on which the tnameserv is listening).
Some suggestions?

   <<Less
About | Sitemap | Contact