I tried the approach (2), and it works well.
Anyway I have some question on the first one in this context : A Java
client wants to use the TAO NS to connect to a TAO server
I tried to launch the TAO NS on a specific port using this option
-ORBnameserviceport 1050
And on the Java client I use this following code to specify the port number
of the NS:
// With resolve_initial_references
Properties props = new Properties();
props.put("org.omg.CORBA.ORBInitialPort", "1050");
ORB orb = ORB.init(args, props);
// get the root naming context
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
But it didn't work.
One another question what is the option -ORBEndpoint. I didn't find it in
the TAO NS supported option
Any kind of help are welcome.
Regards
Virginie
---------------------- Forwarded by Virginie Amar/NCE/AMADEUS on 20/07/99
17:08 ---------------------------
From: Rebecca....@gd-is.com on 20/07/99 14:46 GMT
Please respond to ace-...@cs.wustl.edu
To: da...@syscorp.com.au
ace-...@cs.wustl.edu
cc: (bcc: Virginie Amar/NCE/AMADEUS)
Subject: Re: [ace-users] java using TAO Naming Service
If you're using JDK 1.2 and the TAO Name Service, I know of 2 approached
you
can use:
(1) Launch TAO Naming_Service with -ORBEndpoint iiop://hostname:900
since Java IDL bootstrap defaults to using port 900. (Note that if the
TAO name service is running on Solaris, you'll have to be root user
since
port 900 is considered reserved.)
(2) Pass the TAO Name Service IOR to the Java client and do a
string_to_object()
conversion, followed by the necessary narrow().
As a corollary, TAO applications can also use the JDK tnameserv utility.
Just
make sure you specify "-ORBnameserviceport" with the same port number as
tnameserv
when launching the TAO app.
--- becs
va...@amadeus.net wrote:
>
> Hi,
>
> I tried the approach (2), and it works well.
> Anyway I have some question on the first one in this context : A Java
> client wants to use the TAO NS to connect to a TAO server
> I tried to launch the TAO NS on a specific port using this option
> -ORBnameserviceport 1050
I believe the -ORBNameServicePort specifies which port the TAO
Naming Service listens on for multicast requests. I think what
you really want to do is launch the TAO Naming Service with the
option -ORBEndpoint iiop://`hostname`:1050.
(Notice the backwards quotes around the hostname command.
This works on Unix, but I don't know what operating system you
are using. You can just enter the actual host name where you
are running the Naming Service.)
Then, your Java client code below should work, I think.
Is there also a property for ORBInitialHost? That may help, too.
> And on the Java client I use this following code to specify the port number
> of the NS:
>
> // With resolve_initial_references
> Properties props = new Properties();
> props.put("org.omg.CORBA.ORBInitialPort", "1050");
> ORB orb = ORB.init(args, props);
> // get the root naming context
> org.omg.CORBA.Object objRef =
> orb.resolve_initial_references("NameService");
>
> But it didn't work.
>
> One another question what is the option -ORBEndpoint. I didn't find it in
> the TAO NS supported option
-ORBEndpoint is supported by any (server-side) TAO application.
It is not a Naming Service specific option.
-- Steve Totten
--
----------------------------------------------------------------
Steve Totten, Senior Software Engineer 314-579-0066 ext 210
Object Computing, Inc. tott...@ociweb.com
----------------------------------------------------------------
TAO VERSION: 0.4.2
ACE VERSION: 4.6.45
HOST MACHINE and OPERATING SYSTEM:
PC/NT 4.0
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
COMPILER NAME AND VERSION (AND PATCHLEVEL):
Visual C++ 6.0
AREA/CLASS/EXAMPLE AFFECTED:
ORB_INIT
DOES THE PROBLEM AFFECT:
EXECUTION?
ORB_init attempts read access to invalid location
SYNOPSIS:
ORB_init in MFC context attempts read access to invalid location
DESCRIPTION:
ACE/TAO was built with ACE_HAS_MFC 1 in config.h.
ORB_init works ok in a non MFC program.
ORB_Init fails with attempted read access to location 0x0000014
This traces from ORB_init into ACE SINGLETON class
The program uses Multithreaded DLL's
REPEAT BY:
SAMPLE FIX/WORKAROUND:
None available
-Steve
--
Steve Huston Riverace Corporation
Email: shu...@riverace.com http://www.riverace.com
Specializing in TCP/IP, CORBA, ACE (508) 541-9183, FAX 541-9185
Expertise to help your projects succeed We support ACE!
> TAO VERSION: 0.4.2
> ACE VERSION: 4.6.45
>
> DOES THE PROBLEM AFFECT:
> EXECUTION?
> ORB_init attempts read access to invalid location
>
>
> SYNOPSIS:
> ORB_init in MFC context attempts read access to invalid location
>
> DESCRIPTION:
> ACE/TAO was built with ACE_HAS_MFC 1 in config.h.
> ORB_init works ok in a non MFC program.
> ORB_Init fails with attempted read access to location 0x0000014
> This traces from ORB_init into ACE SINGLETON class
>
> The program uses Multithreaded DLL's
It looks like you did not initialize ACE properly. You need to call
ACE::init and ACE::fini in the ctor and dtor of your CWinApp derived
class.
Please see ACE-INSTALL.html for a detailed discussion on this topic.
Thanks,
Nanbor