TAO FAQ

last updated on: 4/17/2007
Send updates, additions, and corrections to faq@ociweb.com



General


Q:

What is this FAQ about?

Q:

Where can I find the source code for the examples in the TAO Developer's Guide?;

Q:

What is the best way to start learning CORBA and TAO ?

Q:

What's the relationship between OCI's TAO and the DOC Group's TAO?

Q:

What's a PRF?

Q:

I want to ask a question about TAO; what can I do?

Q:

With which OMG CORBA specifications is TAO compliant?

Q:

How can I help extend TAO's functionality and add new features?

Q:

Why doesn't TAO support the BOA?

Q:

Is the tao-users mailing list archived anywhere?

Q:

Can I use version X of TAO with version Y of ACE?


Building Distributions of ACE and TAO (basic)


Q:

How do I obtain, configure, and build ACE and TAO on Windows with Visual C++?

Q:

How do I obtain, configure, and build ACE and TAO on Linux?

Q:

How do I generate static project files?

Q:

How can I build debug applications with non-debug libraries?


OCI-Specific Issues


Q:

What's the advantage to buying OCI's Distribution of TAO?

Q:

Does the OCI documentation set include the CD, too?

Q:

If I install TAO from the OCI CD set, do I need to build it?

Q:

Are the Table of Contents and Index for the TAO Developer's Guide available on-line?

Q:

Is it possible to install debug and release versions of TAO on the same Windows machine?

Q:

Why is the TAOd.dll library I install from OCI's CD so large?

Q:

How do I get support from OCI?

Q:

Which platforms (hardware/OS combinations) are supported by OCI's Distribution of TAO?


ORB Services


Q:

I'm having weird problems with the Naming Service. How can I solve them?

Q:

How do I locate the Naming Service without resorting to multicast discovery?

Q:

Why is multicast discovery of the Naming Service failing?

Q:

Is the Naming Service server's object reference "persistent?"

Q:

How do I keep Cos Event Service consumers from blocking suppliers?

Q:

Why does my event channel get so slow when consumers die?

Q:

Does TAO's CosEvent Service support Typed Events?

Q:

What is the difference between TAO's Real-Time Event Service and the OMG Notification Service?


Security Service & SSLIOP


Q:

Is it built automatically or do I have to do something special?

Q:

What additional software do I need to install?

Q:

How do I build TAO to get security and SSLIOP?

Q:

Is it legal for me to have this? What sort of legalities are there in using this?

Q:

How I can enter the certificate password using an API rather than requiring a user to type in the password?

Q:

Why can't I make an SSLIOP connection using a DSA certificate?

Q:

How can I use a non-security enabled Naming Service with a security (SSLIOP) enabled client?


Boostrapping and Discovery Mechanisms


Q:

Can I use resolve_initial_references() to directly bind to my own servers?

Q:

How do I use a "corbaloc" object reference with a TAO server?

Q:

How do I make my object references persistent?

Q:

Using the Naming Service


Runtime Configuration


Q:

How do I get a TAO server to use IIOP v1.0 or v1.1?

Q:

Why is my "client" thread dispatching requests?

Q:

How can I prevent nested upcalls in my application?

Q:

What's the recommended configuration when using thread-per-connection?


General/Miscellaneous Questions


Q:

How can I get TAO to use a transport protocol other than TCP/IP?

Q:

Which thread does TAO use to dispatch a request?

Q:

How can I detect when a connection between a client and server is broken?

Q:

What are these CORBA::Environment parameters? Why do I get errors about pure virtual functions?

Q:

What is involved with using std library (inc stl) with ACE/TAO?

Q:

Why does ORB_init change the order of the command line arguments if we pass argv to ORB_init(argc, argv)?

Q:

Why don't signals work with the ORB's reactor?

Q:

What is TransportCurrent library used for ?

Q:

How can my TAO application obtain endpoint information (e.g., IP address and port for IIOP) of the client during a request invocation?

Q:

How can my TAO client obtain information about the endpoint (e.g., IP address and port for IIOP) it is using to send a request?


Errors, and possible solutions


Q:

Why do I experience a run-time link error, even though my path and environment variables are set correctly and I have a fresh build tree?

Q:

My server IOR contains the address 127.0.0.1 and my client, running on a different machine, can't connect. What do I do?

Q:

Why I am getting errors when I try to initialize the first ACE object in an application?

Q:

Why is my application leaking memory when I use local objects?

Q:

Why does my application fail when the client and server are on different hosts?

Q:

Why does my multithreaded server deadlock when I make an invocation from an event handler registered with the ORB's reactor?

Q:

How can I fix the follwing linker errors from VC71 or VC8 when using IDL sequences of basic types?


Interoperability Issues


Q:

Why does Orbix 2000 reject large messages from TAO?

Q:

What ORBs does TAO interoperate with?

Q:

Is the TAO Naming Service interoperable with the JDK 1.4 beta 3 ORB?


Realtime/Performance/Embedded Systems Issues


Q:

Where can I see performance comparisons between TAO and <some other ORB>?

Q:

How can I minimize the sizes of the ACE and TAO libraries?

Q:

My platform doesn't have a filesystem; how can I use service configurator directives?

Q:

Running a thread pool ORB

Q:

Does TAO support request/reply timeouts?

Q:

What IDL compiler options help reduce the footprint?

Q:

How can I reduce my compile time during development?


Miscellaneous platform-specific Issues


Q:

What's the minimum set of directories I need to build to be able to develop applications with ACE and TAO?

Q:

Why can't my client connect to a server running on a wintel host with dialup networking?

Q:

What issues are involved when using MFC with ACE/TAO?

Q:

Are there any project wizards for Borland C++ Builder?


Windows-based platforms


Q:

Does OCI's version of TAO contain MFC libraries?

Q:

Why do I encounter linking errors when building Debug applications in Windows with Visual C++?

Q:

How do I export generated classes from DLLs?

Q:

Why doesn't using the Naming Service with Multicast work?

Q:

How do I link against multithreaded libraries in Visual C++?

Q:

When I use the ACE_Process_Manager to launch my process, why does the reactor fail to initialize?

Q:

Which project settings should I change to ensure acemfc.lib is built?

Q:

How do I instantiate a singleton from a DLL?

Q:

Why does my TAO application leak memory when using Windows threads?


VxWorks


Q:

I've just built the libraries and they're HUGE...how can I make them smaller?

Q:

How do I create shared libraries?


TAO and Java


Q:

Is there a Java version of TAO?

Q:

Does TAO support a Java binding?

Q:

Is TAO interoperable with Sun's Java JDK 1.3 ORB?

Q:

Is TAO interoperable with JacORB?

Q:

How can I use TAO with Java's tnameserv?

Q:

How can I use TAO's Naming Service with my Java ORB?

Q:

What is ZEN?


TAO and JacORB


Q:

What is JacORB?

Q:

How can I ensure that the Java JDK is using JacORB rather than its own ORB?

Q:

My TAO server publishes an object reference to my JacORB client, but the "narrow" call is failing on the client. What should I do?

Q:

Does JacORB support the "iioploc" object reference format?

Q:

How do I use JacORB with TAO's Naming Service?

Q:

I've upgraded to JacORB 1.3.21 (or later), and I'm getting an "org.omg.CORBA.INITIALIZE" exception. What's wrong?

Q:

JacORB is using the wrong Ethernet adapter address. What should I do?

Q:

JacORB-only Naming Service example


Fault Tolerance


Q:

How do I enable Fault Tolerance features in the ORB?

Q:

Why doesn't set_primary() work even though a "primary server" is up-and-running?

Q:

Why does the client receive a failure (COMM_FAILURE) during failover to a secondary server even though the secondary server received the request from the client correctly?

Q:

Does TAO support the HEARTBEAT_POLICY?




General


Q:

What is this FAQ about?

A:

This is a FAQ for The ACE ORB (TAO), an open-source CORBA-compliant ORB born of research at Washington University in St. Louis' Center for Distributed Object Computing (http://ace.cs.wustl.edu). If your question isn't answered here, you might want to check out the following links:

We at OCI provide commercial-grade support for this ORB, along with documentation and consulting services (see our web page at http://www.ociweb.com for more details), and provide the site and content of this FAQ as a free service to the TAO community.

If you have questions, and especially if you have answers to them, please send them to support@ociweb.com for inclusion in this FAQ! Let us know whether you'd like to be credited with the answer and, if so, how.



Q:

Where can I find the source code for the examples in the TAO Developer's Guide?;

A:

The source code for all the examples in recent versions of the OCI TAO Developer's Guide is available in the OCI TAO source code distribution, itself. See ACE_wrappers/TAO/DevGuideExamples/. For older versions of TAO and the TAO Developer's Guide, the source code for the examples can be downloaded from our web site. See http://www.theaceorb.com/downloads/index.html for more details.


Q:

What is the best way to start learning CORBA and TAO ?

A:

Books

Advanced CORBA Programming with C++ book by Henning and Vinoski. It's the equivalent of the ACE tutorial (except it's much more complete). This is a general C++ CORBA book and covers the standard way of doing things.

The OCI TAO Developer's Guide, which you can purchase via http://www.theaceorb.com/purchase/index.html . This book picks up where the Henning and Vinoski book stops, covering TAO specific topics as well as CORBA standard features omitted from the Henning and Vinoski book.

Online

The C++ Report and CUJ columns that Vinoski and Schmidt wrote over the past 4 years. They are all online at http://www.cs.wustl.edu/~schmidt/report-doc.html.

You may surf and search the tao-users mailing list archives.

Training

Doug Schmidt teaches a course at UCLA Extension. See http://www.cs.wustl.edu/~schmidt/UCLA.html for more details.

OCI offers courses on CORBA programming with C++, CORBA programming with Java, Advanced CORBA programming using TAO, and programming with ACE. See http://www.ociweb.com/education/services/descrip/dist for more details on these and related courses.

Tutorials

You can build TAO and work through the online tutorials in $TAO_ROOT/docs.



Q:

What's the relationship between OCI's TAO and the DOC Group's TAO?

A:

OCI's Distribution of TAO is signified with a letter in the version number (e.g., TAO 1.3a, TAO 1.4a), whereas DOC Group release version numbers do not include a letter (e.g., TAO 1.4, TAO 1.5). OCI patch releases also indicate a patch level (e.g., TAO 1.4a_p12), whereas DOC Group beta kits indicate the beta number after a major release (e.g., TAO 1.5.4).

Each OCI release is derived from a DOC Group version (for example, TAO 1.4a was derived from TAO 1.4.3), but an OCI release does not correspond exactly to any DOC Group release.

OCI seeks to maintain extremely stable, fully-tested, open source products backed by commercial support, training, consulting, and accompanied by extensive documentation and binaries on CD-ROM available for purchase. Many organizations desire a commercially-supported release of TAO as a basis for their mission critical applications.

The DOC Group's primary focus is research and development rather than commercial support. Support is provided on a "best effort" basis through the public tao-users mailing list, and is often excellent. However, more "predictable" support is availble from OCI and other organizations.

OCI selects a reasonably stable DOC Group release as the basis for each OCI distribution. OCI then builds and tests across over 50 combinations of hardware, operating systems, C++ compilers, and build flags. As bugs are encountered, they are fixed directly (and the fix is contributed back to DOC), fixed by integrating an existing DOC fix (depending on the severity and the degree of entanglement), or documented (if a fix is too involved to be accomplished without sponsorship).

In addition, OCI applies various enhancements, sponsored by our customers. We also integrate these back into the DOC group repository.

OCI also packages select binaries (custom builds are also available -- see http://www.theaceorb.com/product/index.html) and makes them available for purchase on CD-ROM. Since OCI's distribution of TAO is still open source, OCI also distributes the source code and all patches free of charge (see http://www.theaceorb.com/downloads).

In OCI distributions, the original DOC Group ChangeLogs are preserved; OCI changes are documented in OCIChangeLog and OCIReleaseNotes.html files, included in the source code distribution. See, for example, the latest OCI TAO 1.4a Release Notes.



Q:

What's a PRF?

A:

"PRF" refers to the PROBLEM-REPORT-FORM, i.e., $ACE_ROOT/PROBLEM-REPORT-FORM. This boilerplate document is found in both DOC distributions and OCI distributions.

The odds of getting questions answered, bugs fixed, etc., goes up significantly when you report problems using the PRF because it insures that developers and support personnel get the most commonly required information right away. Failure to use the PRF means that those folks have to spend valuable time (yours and theirs) having a conversation to get that information just to start debugging. Unless you've got a paid support contract, there's even a chance that nobody will answer!

So, always use the PRF!


Q:

I want to ask a question about TAO; what can I do?

A:

See ACE+TAO Mailing lists for a full description of all the available ACE and TAO mailing lists. Please remember to use the Problem Report Form (See What's a PRF? ) when posting questions (and not just "problems").

Q:

With which OMG CORBA specifications is TAO compliant?

A:

Compliance, just like source code and the specifications themselves, is a moving target. Each version of TAO is compliant with various OMG CORBA specifications.

Each version of the TAO Developer's Guide includes an appendix that discusses compliance of that version of TAO in detail. These appendices are available via http://www.theaceorb.com/downloads/index.html.



Q:

How can I help extend TAO's functionality and add new features?

A:

TAO is open source and the development group welcomes code contributions. Active participation by users ensures a robust implementation. Please refer to the terms and conditions relating to software submissions in the ACE, TAO, CIAO, and CoSMIC copyright and licensing information: http://www.cs.wustl.edu/~schmidt/ACE-copying.html. In general, incorporation of your code into TAO results in it becoming "open" and the user community being protected by the ACE/TAO copyright and terms.

OCI can also provide consulting and software engineering resources to help you add new functionality into TAO or to span additional platforms. We can also manage the inclusion of such code into the supported releases of new open source versions of TAO. We can provide anonymity if you wish to avoid exposing your technical strategies in public forums, where your competition may be watching. Contact sales@ociweb.com to discuss your project.

Open source software can add immeasurably to the development of a rich infrastructure, and the provision of a high degree of application interoperability, from which we all may derive benefit. Read more about the benefits of open source at http://theaceorb.com/product/benefit.html.


Q:

Why doesn't TAO support the BOA?

A:

The short answer is that the BOA (Basic Object Adapter) is no longer part of the CORBA specification.
The BOA was removed because of its lack of portability and underspecification among various other shortcomings. The main argument for adding BOA support to TAO is migration of existing CORBA applications. Because the BOA is implemented differently by each vendor, porting to a TAO BOA would probably be the same amount of work as porting to the POA (which provides true cross-vendor portability). All in all, applications are probably better off making the transition to the POA.



Q:

Is the tao-users mailing list archived anywhere?

A:

Yes.

You can find the tao-users archives on the web at http://groups.yahoo.com/group/tao-users/.

The ace-users archive is available at http://groups.yahoo.com/group/ace-users/.

ACE+TAO Mailing list info can be found at http://www.cs.wustl.edu/~schmidt/TAO-mail.html, which includes information about subscribing to the various mailing lists, including tao-users.

Thanks to Irfan Pyarali for providing this information!


Q:

Can I use version X of TAO with version Y of ACE?

A:

Only if X and Y were the versions of TAO and ACE that were released together. For example, ACE 5.1/TAO 1.1 or ACE 5.1.12/TAO 1.1.12. There is no attempt to make the interface between ACE and TAO backward (or forward) compatible. That being said, you may be able to coerce mismatched versions to work together, but it is not something you really want to do.



Building Distributions of ACE and TAO (basic)


Q:

How do I obtain, configure, and build ACE and TAO on Windows with Visual C++?

A:

This FAQ provides basic instructions for installing and building ACE+TAO for Windows with Visual C++. ACE+TAO can also be used on other major modern operating systems, such as Linux, Solaris, HP-UX, AIX, and Tru64, and some real-time and embedded operating systems, such as VxWorks, LynxOS, Timesys Linux, and Windows CE. On Windows, ACE+TAO can also be built with the Borland C++ compiler.
Hardware Requirements

  - CPU Speed: Intel x86 P3 500 MHz or faster
  - Memory: 512 MB (more memory improves compile speed)
  - Hard Drive Space: 256MB swap + 250 MB up to several GB
    free (depending upon how much you build)

Operating System Requirements

  - Windows 2000, 2003, or XP

C++ Compiler Requirements

  - Microsoft Visual C++ 6.0 SP5 (no longer supported for
    latest ACE+TAO beta releases)
  - Microsoft Visual C++ 7.1
  - Microsoft Visual C++ 8.0 (Visual Studio 2005) support is
    still somewhat experimental

Other Software Requirements

  - OCI's Distribution of TAO version 1.4a latest patch
    release or the latest beta release of ACE+TAO (see
    instructions below for obtaining and installing ACE+TAO)
  - WinZIP or similar tool for extracting software archives
  - ActiveState Perl v5.6.1 or newer (recommended, but not required)

Obtaining and Installing ACE+TAO

  1. Download the latest patch release of OCI TAO 1.4a from:

     http://download.ociweb.com/TAO-1.4a/ACE+TAO-1.4a_with_latest_patches.zip

     or download the latest beta release of ACE+TAO from:

     http://download.dre.vanderbilt.edu/

  2. Extract the above archive into a path with no spaces in the path
     name (e.g., C:\ACE_wrappers).

  3. Set ACE_ROOT, TAO_ROOT, and PATH environment variables.

     For example, if ACE+TAO are installed in C:\ACE_wrappers, the
     variables will look like this:

    * ACE_ROOT=C:\ACE_wrappers
    * TAO_ROOT=%ACE_ROOT%\TAO
    * The PATH variable should contain these directories: %ACE_ROOT%\bin;%ACE_ROOT%\lib

  4. Create a file named config.h in %ACE_ROOT%\ace with the following
     contents:

     #define ACE_DISABLE_WIN32_ERROR_WINDOWS
     #define ACE_HAS_STANDARD_CPP_LIBRARY 1
     #define ACE_DISABLE_WIN32_INCREASE_PRIORITY
     #include "ace/config-win32.h"

  5. (OCI's Distribution of TAO version 1.4a) If you are using
     Visual C++ 6.0 (no longer supported for the latest beta
     releases), build the Win32 Debug or Release configuration
     of ACE+TAO using the following workspace file:

     %TAO_ROOT%\TAOACE.dsw   

     The projects in the TAOACE workspace build the ACE and
     TAO libraries, TAO IDL compiler, gperf, ORB services
     libraries and executables, and some common utilities.
     They do not include any examples, tests, or performance
     tests.  (Separate workspaces exist for them.)  Libraries
     will be installed in %ACE_ROOT%\lib.  Some executables
     will be installed in %ACE_ROOT%\bin, others (the ORB
     services executables) will be installed in their source
     directories.

     If you don't want to build all of the libraries and
     executables from the TAOACE workspace, we recommend just
     building the Naming_Service project.
     It, and the projects on which it depends includes most of
     the common ACE+TAO libraries that you need for developing
     your applications.

     If the above workspace file does not exist, you will need
     to generate it using MakeProjectCreator (MPC) (requires
     Perl as listed above) with the following commands:

     cd %TAO_ROOT%
     %ACE_ROOT%\bin\mwc.pl -type vc6 TAOACE.mwc

  6. (Either OCI's Distribution of TAO or the latest beta release)
     If you are using Visual C++ 7.1, build the Debug or Release
     configuration of ACE+TAO using the following solution file:

     %TAO_ROOT%\TAOACE.sln  (OCI's Distribution of TAO version 1.4a)
     %TAO_ROOT%\TAO_ACE.sln (latest beta release)

     The projects in the TAOACE or TAO_ACE solution build the
     ACE and TAO libraries, TAO IDL compiler, gperf, ORB
     services libraries and executables, and some common
     utilities.  They do not include any examples, tests, or
     performance tests.  (Separate workspaces exist for them.)
     Libraries will be installed in %ACE_ROOT%\lib.  Some
     executables will be installed in %ACE_ROOT%\bin, others
     (the ORB services executables) will be installed in their
     source directories.

     If you don't want to build all of the libraries and
     executables from the TAOACE or TAO_ACE solution, we
     recommend just building the Naming_Service project.
     It, and the projects on which it depends, includes most of
     the common ACE+TAO libraries that you need for developing
     your applications.

     If the above solution file does not exist, you will need to
     generate it using MakeProjectCreator (MPC) (requires Perl as
     listed above) with the following commands:

     (OCI's Distribution of TAO version 1.4a)
     cd %TAO_ROOT%
     %ACE_ROOT%\bin\mwc.pl -type vc71 TAOACE.mwc

     or

     (Latest beta release of ACE+TAO)
     cd %TAO_ROOT%
     %ACE_ROOT%\bin\mwc.pl -type vc71 TAO_ACE.mwc


Q:

How do I obtain, configure, and build ACE and TAO on Linux?

A:

This FAQ provides basic instructions for installing and building ACE+TAO for Linux. ACE+TAO can also be used on other major modern operating systems, such as Windows, Solaris, HP-UX, AIX, and Tru64, and some real-time and embedded operating systems, such as VxWorks, LynxOS, Timesys Linux, and Windows CE.
Hardware Requirements

  - CPU Speed: Intel x86 P3 500 MHz or faster
  - Memory: 512 MB (more memory improves compile speed)
  - Hard Drive Space: 256MB swap + 250 MB up to several GB
    free (depending upon how much you build)

Operating System Requirements

  - Linux 2.2 (or later) kernel

C++ Compiler Requirements

  - gcc 3.2.x (or later)

Other Software Requirements

  - OCI's Distribution of TAO version 1.4a latest patch
    release or the latest beta release of ACE+TAO (see
    instructions below for obtaining and installing ACE+TAO)
  - GNU gunzip and GNU tar for extracting software archives
  - GNU make
  - Perl v5.6.1 or newer (recommended, but not required)

Obtaining and Installing OCI TAO

  1. Download the latest patch release of OCI TAO 1.4a from:

     http://download.ociweb.com/TAO-1.4a/ACE+TAO-1.4a_with_latest_patches.tar.gz

     or download the latest beta release of ACE+TAO from:

     http://download.dre.vanderbilt.edu/

  2. Extract the above archive into a path with no spaces in the path
     name (e.g., /opt/ACE_wrappers)

  3. Set ACE_ROOT, TAO_ROOT, PATH, and LD_LIBRARY_PATH environment
     variables.

     For example, if ACE+TAO are installed in /opt/ACE_wrappers,
     the variables will look like this:

    * ACE_ROOT=/opt/ACE_wrappers
    * TAO_ROOT=$ACE_ROOT/TAO
    * PATH will include the directory $ACE_ROOT/bin
    * LD_LIBRARY_PATH will include the directory $ACE_ROOT/lib

  4. Create a file named config.h in $ACE_ROOT/ace with the following
     contents:

     #include "ace/config-linux.h"

  5. Create a file named platform_macros.GNU in
     $ACE_ROOT/include/makeinclude with the following contents:

     exceptions=1
     inline=1
     ami=1
     rt_corba=1
     interceptors=1
     interface_repo=1
     corba_messaging=1
     probe=0
     profile=0
     fakesvcconf=0
     shared_libs_only=1
     debug=1     # (or debug=0)
     optimize=0  # (or optimize=1)
     include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

  6. Build ACE+TAO using the following commands:

     cd $TAO_ROOT
     make

     The above commands will build the ACE and TAO libraries,
     TAO IDL compiler, gperf, ORB services libraries and
     executables, and some common utilities.  They will not
     build any examples, tests, or performance tests.
     (Separate directories and GNUmakefiles exist for them.)
     Libraries will be installed in $ACE_ROOT/lib.  Some
     executables will be installed in $ACE_ROOT/bin, others
     (the ORB services executables) will be installed in their
     source directories.

  7. If there are no GNUmakefiles, you will need to generate them
     using MakeProjectCreator (MPC) (requires Perl as listed above)
     with the following commands:

     (OCI's Distribution of TAO version 1.4a)
     cd $TAO_ROOT
     $ACE_ROOT/bin/mwc.pl -type gnuace TAOACE.mwc

     or

     (Latest beta release of ACE+TAO)
     cd $TAO_ROOT
     $ACE_ROOT/bin/mwc.pl -type gnuace TAO_ACE.mwc


Q:

How do I generate static project files?

A:

If you have Perl installed, you can use the Makefile, Project, and Workspace Creator (MPC) to generate them yourself. The steps below, while they assume a UNIX platform, can be used (with minor modifications) on any general purpose platform.

  1. Set the MPC_ROOT environment variable to point to the MPC package location. OCI's TAO release contains the MPC package at $ACE_ROOT/MPC.

    % export MPC_ROOT=<complete path to MPC package>

  2. Set the ACE_ROOT environment variable to the root of your ACE+TAO code base and execute the following commands to generate static project files:

    % cd $ACE_ROOT/TAO
    % $ACE_ROOT/bin/mwc.pl -type gnuace -static -name_modifier *_Static TAOACE.mwc

    Substitute your build tool's type for gnuace (e.g., use -type vc71 for Visual C++ 7.1).
The default configuration can be modified by customising the $ACE_ROOT/bin/MakeProjectCreator/config/default.features file. Use the $ACE_ROOT/bin/MakeProjectCreator/config/global.features file as a template.

Example: The following will generate static project files for the Visual C++ 7.1 compiler on Windows:

% $ACE_ROOT/bin/mwc.pl -type vc71 -static -name_modifier *_Static TAOACE.mwc

On UNIX machines you will need to turn on the static_libs_only flag in $ACE_ROOT/include/makeinclude/platform_macros.GNU inorder to build static libraries.

Q:

How can I build debug applications with non-debug libraries?

A:

During development, you will normally want to build your application code with debugging enabled. However, you may be using non-debug versions of the ACE, TAO, and CIAO libraries. Depending upon your platform and development environment, special care must be taken to make sure your debug-enabled application can link against non-debug ACE, TAO, and CIAO libraries.

On platforms that use GNU Make, all you have to do to enable debugging in your application is set the debug build flag to 1 when you build your application code. You can do this by setting debug=1 on the make command line, as follows:
make debug=1
Or, you can set debug=1 in your platform_macros.GNU file when you build your application. Note: If you have debug=1 in platform_macros.GNU when you build the ACE, TAO, and CIAO libraries, they will be built with debugging enabled, too.

On some platforms, such as Windows with Visual C++, the ACE, TAO, and CIAO library names may have a modifier appended to the library name to indicate whether it was built with a debug, static, MFC, or some other configuration. For example, in a debug build, the name of the ACE shared library will be ACEd.dll, whereas in a non-debug (release) build, the name of the ACE shared library will be ACE.dll.

On these platforms, if you build your application with a debug configuration, and you are using project files generated by MPC, the linker will, by default, look for libraries with the "d" debug modifier appended to the library name. If you are building your debug application against non-debug libraries, you need to tell the linker to look for the unmodified library names. You can do this by directly editing the project settings (e.g., to remove the "d" from the library names). Or, you can use the -value_template MPC option to override the default definition of the library modifier when you generate your project files.

For example, suppose your application's MPC workspace file is MyApp.mwc and suppose you are using Visual C++ 7.1. If you want to build your application against the same set of non-debug ACE, TAO, and CIAO libraries, regardless of whether you build the debug or release configuration, you can use the following command to generate your application's project and solution files:
$ACE_ROOT/bin/mwc.pl -type vc71 -value_template lib_modifier=
The -value_template option in the above command sets the value of the lib_modifier template variable to an empty string, which causes no modifier to be added to the library names with which your application will link, regardless of which configuration (debug or release) you build.

Watch out for build problems if you have any settings in your config.h file that depend upon having debugging enabled, for example:
#if defined(_DEBUG)
#undef __ACE_INLINE__
#endif 
For more information on MPC, see the MPC documentation and the MPC FAQ:

http://download.ociweb.com/MPC
http://www.ociweb.com/products/mpc/faq.html


OCI-Specific Issues


Q:

What's the advantage to buying OCI's Distribution of TAO?

A:

Depending upon your circumstances, there may be several advantages to buying OCI's Distribtution of TAO rather than closely tracking the beta source code kits:

  • Stability: OCI's Distribution of TAO is based on a stable, tested, and supported release of TAO. If you need a solid, consistent version of TAO on which to base your product or project, this is the one for you. If you need to stay abreast of new research directions or want to try out the latest features, you can still obtain TAO beta kits in source code form by visiting http://download.dre.vanderbilt.edu/.
  • Time Savings: Buying and installing a prebuilt binary distribution of TAO, rather than downloading source code and building it yourself, can save you hours of work. In addition, you can be sure that it has been built correctly and tested across several platforms, operating systems, and compilers, and in several different configurations.
  • Installation Support: OCI provides 90 days of installation support for registered purchasers of prebuilt binary distributions of TAO. We want to make sure you are up and running with TAO as quickly as possible.
  • Documentation: Using OCI's Distribution of TAO is easy with OCI's TAO Developer's Guide (available for purchase at http://www.theaceorb.com/purchase/index.html). In addition to the documentation set, you can view the latest TAO release notes at http://www.theaceorb.com/releasenotes/index.html.
  • Frequently Asked Questions: OCI maintains a list of frequently asked questions about TAO. This list is updated regularly by our staff of distributed object computing technology engineers to provide answers to common questions about using TAO. Anyone in the TAO user community can contribute questions (and answers) to the FAQ. Check it first to see if your question has been asked before. The FAQ is located at http://www.theaceorb.com/faq/
  • Professional Support: If you need further support, beyond installation issues or frequently asked questions, such as object technology training, consulting, mentoring, or application development, OCI has several service offerings for you. Visit http://www.ociweb.com for more information.



Q:

Does the OCI documentation set include the CD, too?

A:

No, it does not. The documentation set only includes OCI's own TAO Developer's Guide.
CDs containing prebuilt versions of TAO for multiple platforms are available separately.


Q:

If I install TAO from the OCI CD set, do I need to build it?

A:

In addition to the full source code for ACE and TAO, the OCI CD set includes pre-built libraries for ACE, TAO, and TAO's CORBA services, plus executables for TAO's IDL compiler, gperf, and servers for the various services.

The CD set contains these pre-built components for many popular platforms, operating systems, and C++ compilers.

In addition, the builds on the CD set include more than one build configuration (i.e., debug on or off, native C++ exception support on or off).

Note that the CD set does not include pre-built binaries of the various tests, performance tests, and examples that come with ACE and TAO, but the full source code for them is there.

So, if you install TAO from the OCI CD set for one of the existing platform / operating system / compiler combinations, you can get started writing, building, and running your own applications that use TAO right away.

Of course, since you have the full source code, you can custom build it yourself (e.g., for a particular platform, operating system, compiler, or configuration which is not present on the CD).


Q:

Are the Table of Contents and Index for the TAO Developer's Guide available on-line?

A:

Yes.

The Table of Contents and Index for OCI's TAO Developer's Guide are available in PDF form via:

http://www.theaceorb.com/downloads/index.html

Just follow the appropriate links to download the files you want.



Q:

Is it possible to install debug and release versions of TAO on the same Windows machine?

A:

It is possible to install both debug and release versions of TAO on one Windows machine by selecting a different installation directory for each installation and setting $ACE_ROOT and $TAO_ROOT appropriately. More efficienty, the debug and release versions of TAO can be installed in the same directory since the different versions of the libraries have slightly different names.


Q:

Why is the TAOd.dll library I install from OCI's CD so large?

A:

The DLLs on the CD include all the information you need to debug TAO applications. This information is normally stored by Visual C++ in .pdb files. Our builds store them in the .dll in a location independent manner (using the C7 compatible option for the debug information). This allows you to step into TAO code in the Visual C++ debugger.

If you desire a smaller set of libraries, either install the release versions of the CD or rebuild the debug libraries with the default debug configuration.



Q:

How do I get support from OCI?

A:

You're always welcome to send a question. However, the disposition of your request depends upon whether or not you have a technical support contract with OCI:
  • If you have a technical support contract with OCI, someone will begin addressing the issue and will follow up with you according to the provisions outlined in your support contract.
  • If you do not have a technical support contract with OCI, someone will still review the support request and may get back to you, but we cannot guarantee that we will have time to work on the problem without a support contract.
If you would like to open a technical support contract with OCI, please contact our sales staff at sales@ociweb.com or call +1.314.579.0066 extension 206. Please consult http://www.theaceorb.com/support for a description of the TAO support model.


Q:

Which platforms (hardware/OS combinations) are supported by OCI's Distribution of TAO?

A:

A full list of platforms (and other support details) is available at http://www.theaceorb.com/support/index.html.


ORB Services


Q:

I'm having weird problems with the Naming Service. How can I solve them?

A:

More than likely you're having problems related to multicast discovery of the Naming Service. Multicast was the default mechanism for finding the Naming Service in older versions of TAO. Symptoms range anywhere from a client not being able to find the Naming Service at all, to finding it sometimes, to just completely bizarre and inexplicable behavior.

So, before you do anything, try it all again, but this time turn off multicast discovery. See How do I locate the Naming Service without resorting to multicast discovery? .


Q:

How do I locate the Naming Service without resorting to multicast discovery?

A:

Here are some common ways to use the -ORBInitRef option to locate the Naming Service (where bart is just an example host name):

# Store the IOR of the Naming Service's root Naming Context in a file:

   Naming_Service -m 0 -o /tmp/ns.ior
   client -ORBInitRef NameService=file:///tmp/ns.ior
# Specify an IIOP endpoint when you start the Naming Service:
   Naming_Service -m 0 -ORBListenEndpoints iiop://bart:2809
   client -ORBInitRef NameService=corbaloc:iiop:bart:2809/NameService

You can also use the NameServiceIOR environment variable to achieve the same effect. Here, we show what it might look like on a UNIX or UNIX-like system using the bash shell:

  Naming_Service -m 0 -ORBListenEndpoints iiop://bart:2809
  export NameServiceIOR=corbaloc:iiop:bart:2809/NameService
Now, when your client calls resolve_initial_references("NameService"), no multicast will be performed. The -m 0 option turns multicast off in the Naming_Service server. This is the default in TAO versions 1.1.17 and later. Earlier versions defaulted to multicast enabled in the server.


Q:

Why is multicast discovery of the Naming Service failing?

A:

There can be a myriad of reasons, many related to network or OS-level issues rather than TAO. Try turning on -ORBDebugLevel 5 to get some sense of what might be happening internally.

If you're using Windows, check out Why doesn't using the Naming Service with Multicast work? and see if it applies.


Q:

Is the Naming Service server's object reference "persistent?"

A:

Yes, TAO's implementation of the OMG Naming Service always creates a persistent IOR for the root Naming Context. That is to say, it creates the object reference in a POA that has the PERSISTENT life span policy. Thus, you can use the IOR across invocations of the Naming Service provided that the service always starts up on the endpoint used when creating the original reference.

Use the -ORBListenEndpoints option to specify that the server should start on a specific endpoint, e.g.,

  Naming_Service -ORBListenEndpoints iiop://bart:2809
The general form is:
  Naming_Service -ORBListenEndpoints iiop://name_server_host:name_server_port
For more detailed information on using the -ORBListenEndpoints option, see the TAO Developer's Guide

For more information on direct binding of persistent object references, see Henning's and Vinoski's Advanced CORBA Programming with C++, 14.3.2.



Q:

How do I keep Cos Event Service consumers from blocking suppliers?

A:

By default, the COS event channel delivers an event to a consumer using the same thread that received it from the supplier. When suppliers publish or emit events, they do so using a two-way invocation. When the event channel delivers an event, it also uses a two-way invocation. Since these are both two-way calls, and the delivery invocation is initiated during the publishing invocation, this causes the supplier to block (waiting for the response to its two-way publication invocation) while the consumers process the event.
This behavior can be avoided by directing the event channel to use a separate dispatching thread for the push to the consumers. This is accomplished differently depending on which COS EC is being used.
When using the "native" COS EC, the -CECDispatching option can be used to change the dispatching strategy. A dispatching strategy of "mt" (multithreaded) will start a second thread and use it for the push calls to the consumer. Placing the following option in the service configurator file does the trick:
   static CEC_Factory "-CECDispatching mt"
For example, if this line was placed in ec.conf, then the event channel server can be started with the following command:
   CosEvent_Service_Native -ORBSvcConf ec.conf
The -CECDispatchingThreads option is used to control the number of threads used for consumer deliveries.
When using the COS EC that wraps the RTEC (which is the only COS EC in older versions of TAO), the same effect can be accomplished by using the analogous options on the RTEC (-ECDispathing and -ECDispatchingThreads on the EC_Factory).
For more information about these and other event channel options, see the TAO Developer's Guide, 14.8 and the online documentation at $TAO_ROOT/docs/cec_options.html and $TAO_ROOT/docs/ec_options.html.


Q:

Why does my event channel get so slow when consumers die?

A:

By default the event channels (Cos and RTEC) in TAO continue to attempt to push new events at consumers even after previous pushes to that consumer have failed. If a particular consumer is destroyed without disconnecting from the event channel, then all subsequent pushes by the corresponding supplier proxy will fail. Since each of these require the ORB to timeout, they can drastically affect the throughput of the EC.

You can modify this behavior via the -ECSupplierControl and -ECConsumerControl options. The consumer control option sets the strategy used to deal with ill-behaved consumers. Put the following in a service configurator option file (ec.conf):

   static EC_Factory "-ECConsumerControl reactive"

This sets the control strategy for the consumers to reactive. Now start the event channel process with this configuration:

   $TAO_ROOT/orbsvcs/Event_Service -ORBSvcConf ec.conf

Any failed attempts to communicate with a consumer result in the disconnection of that consumer (and its proxy) from the event channel. The reactive strategy also polls all the consumers periodically and disconnects them if they fail to respond. The default polling period is 5 seconds and can be set via the -ECConsumerControlPeriod option.

The supplier control strategy (and associated polling period) works the same way with suppliers.

The native Cos Event Channel has analogous options (-CECConsumerControl, -CECSupplierControl, -CECConsumerControlPeriod, and -CECSupplierControlPeriod).


Q:

Does TAO's CosEvent Service support Typed Events?

A:

Yes, as of TAO 1.3.4. See $TAO_ROOT/orbsvcs/examples/CosEC/TypedSimple for a simple example using Typed Events.

Q:

What is the difference between TAO's Real-Time Event Service and the OMG Notification Service?

A:

The Notification Service is an implementation of the OMG's Notification Service specification, which originally came out of the Telecommunications working group within the OMG. See http://www.omg.org/cgi-bin/doc?formal/2000-06-20 for the specification. The Notification Service is backwards compatible with the OMG Event Service.

The Real-Time Event Service is TAO specific. It was developed prior to the adoption of the OMG Notification Service specification. The RT Event Service was designed to meet the real-time and quality of service needs of certain sponsors of the DOC group, but has applicability in a wide variety of domains.

On the surface, the two services provide several similar features, though the specifics of their interfaces and implementations are quite different:

  • similar communications model
  • support for structured events
  • filtering of events
  • support for subscriptions
  • mechanisms for specifying QoS requirements
  • support for delivery of sequences of events

In addition, the RT Event Service provides some features that are not part of the Notification Service, such as event channel federations, event correlation, suspension and resumption of consumer connections, and integration with a scheduling service.

The RT Event Service is older and perhaps more "mature" in that it has been through multiple iterations of development and is in active use by many real world applications. However, the Notification Service is also quite good and since the Notification Service is based on an OMG specification, it may be a better choice for your application, depending upon your needs.



Security Service & SSLIOP


Q:

Is it built automatically or do I have to do something special?

A:

Security and SSLIOP are not built in a default configuration. You must add stuff to your platform_macros.GNU (see How do I build TAO to get security and SSLIOP? ) as well as install additional software (see What additional software do I need to install? ).


Q:

What additional software do I need to install?

A:

You'll need OpenSSL (http://www.openssl.org).

In addition, you might need a way of getting good random numbers.


Q:

How do I build TAO to get security and SSLIOP?

A:

See https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/docs/Security/SSLIOP-INSTALL.html?view=co.

See also the "TAO Security" chapter of the TAO Developer's Guide



Q:

Is it legal for me to have this? What sort of legalities are there in using this?

A:

First, we're software developers and not lawyers. We might be able to write good software, but it takes a mind far more twisted than ours to understand US Export regulations, especially on cryptography and security issues. Therefore, if you have concerns, you should consult your lawyer.

That said, you might look at http://www.bis.doc.gov/Encryption/ for current information from the U.S. Government if you're under its jurisdiction.


Q:

How I can enter the certificate password using an API rather than requiring a user to type in the password?

A:

The ACE_SSL wrappers don't provide an API or wrapper method(s) to do this. However, you can set a password callback function by manually using the OpenSSL functions. For example, something like the following should work:
        SSL_CTX *ctx = ACE_SSL_Context::instance ()->context ();
// SSL_CTX_set_default_passwd_cb() is from OpenSSL. SSL_CTX_set_default_passwd_cb (ctx, your_callback);
where "your_callback" is a pointer to your PEM passwork callback function. See <openssl/ssl.h> and <openssl/pem.h> for the required callback function signature.


Q:

Why can't I make an SSLIOP connection using a DSA certificate?

A:

If you would like to create and use DSA certificates there are a couple of things that need to be done for it to work with SSLIOP. When using DSA certificates you need to specify DH parameters. You can do this by obtaining the SSL context before any connections are made using the ORB. This is TAO specific therefore not portable to other ORBs. First you need to obtain a set of DH parameters. You can either generate these at runtime ( which will take a very long time ), or generate them once with the openssl tool and append them to the end of your certificate.
  openssl tool: [Command Line]
       openssl gendh 512 >>cert.pem
This will add 512-bit DH parameters to the end of the file cert.pem. After you have created these parameters you will need to load them in your application.
  #include "orbsvcs/SSLIOPC.h"
  #include "openssl/pem.h"
// Open the file with the DH parameters FILE * fp = fopen ( "cert.pem", "r" );
// Read in the DH parameters from the open file DH * dh_params = PEM_read_DHparams ( fp , NULL, NULL, NULL );
// Obtain the SSL Context so we can set the DH parameters for it SSL_CTX * ssl_ctx = ACE_SSL_Context::instance()->context();
// Set the DH Parameters for the SSL Context SSL_CTX_set_tmp_dh ( ssl_ctx , dh_params );
This should be it. This sets the DH parameters needed to use a DSA certificate with SSLIOP. Please note that a greater degree of error checking should be done than what is provided in this code.


Q:

How can I use a non-security enabled Naming Service with a security (SSLIOP) enabled client?

A:

When security is enabled in a CORBA client's ORB, all invocations will be attempted using a secure connection. However, the Naming Service for example may not be set up to use security. Invocations on that Naming Service will result in a CORBA::INV_POLICY exception since the client is unable to make a secure/protected invocation on that non-security enabled Naming Service.
To correct this problem, protected invocations via the Naming Service's object reference must be disabled. This is achieved by setting a policy override on the Naming Service's object reference like so:
  // Disable protection on Naming Service invocations.
Security::QOP qop = Security::SecQOPNoProtection;
CORBA::Any no_protection; no_protection <<= qop;
// Create the Security::QOPPolicy. CORBA::Policy_var policy = orb->create_policy (Security::SecQOPPolicy, no_protection);
CORBA::PolicyList policy_list (1); policy_list.length (1); policy_list[0] = CORBA::Policy::_duplicate (policy.in ());
// Get a reference to Naming Context CORBA::Object_var obj = orb->resolve_initial_references ("NameService");
// Create an object reference that uses plain IIOP (i.e. no // protection). CORBA::Object_var unprotected_obj = naming_context_object->_set_policy_overrides (policy_list, CORBA::SET_OVERRIDE);
// Narrow to a CosNaming::NamingContext CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (unprotected_obj.in ());
This is based on TAO's Secure_Invocation test client side code in $TAO_ROOT/orbsvcs/tests/Security/Secure_Invocation/client.cpp. (TAO 1.2 or better)
The above policy override code is standard and should be portable to all ORBs that support the SecurityLevel2::QOPPolicy quality-of-protection client-side policy.
Don't forget to include "orbsvcs/SecurityC.h" (this is TAO-specific) to pull in the Security QoP policy related constants and types.



Boostrapping and Discovery Mechanisms


Q:

Can I use resolve_initial_references() to directly bind to my own servers?

A:

Instead of binding object references with the Naming Service and requiring clients to resolve them by name, you can make it possible for clients to directly bind to objects using CORBA::ORB::resolve_initial_references(), the same mechanism used to bind to other important objects, such as the Naming Service.

For example, suppose you have a server that provides a Bank object (let's call it "CORBABank"). Rather than binding this object by name in a naming context in the Naming Service, you would like clients to access it directly by simply calling

  orb->resolve_initial_references("CORBABank");

There are several ways to accomplish this.

  1. Directly bind the object reference into the client ORB's list of references using an ORB initializer and the ORBInitInfo::register_initial_references() function.
  2. Use the client ORB's register_initial_reference() member function.
  3. Use the -ORBInitRef ORB initialization option on the client ORB

The following steps describe one way to use the 3rd method described above.

  1. In the server, generate an IOR for the target object as usual.
  2. Give the CORBA Object a simple object key by registering its IOR in the server ORB's IOR Table (See How do I use a "corbaloc" object reference with a TAO server? for details)
  3. Start the server listening on a particular endpoint using the -ORBListenEndpoints option.
  4. Start the client with the -ORBInitRef option and assign the service name to the simple corbaloc-style reference of the CORBA Object.
  5. In the client, call resolve_initial_references() and pass it the service name.

The combination of the simple object key and the fixed endpoint allows us to reference the object via a corbaloc-style reference in the -ORBInitRef option.

For example, we can start our processes as follows:

  server -ORBListenEndpoints iiop://bart:10200
  client -ORBInitRef CORBABank=corbaloc:iiop:bart:10200/BankObject

Where BankObject is the simple object key assigned to the CORBA object in the server.

Now, on the client side, we can use resolve_initial_references("CORBABank") to directly bind to the Bank object living inside the Bank server. For example:

  // Initialize the ORB.
  CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);

  // Get a reference to the Bank using resolve_initial_references().
  CORBA::Object_var obj = orb->resolve_initial_references("CORBABank");
  Bank_var bank = Bank::_narrow(object.in());
  if (CORBA::is_nil(bank.in())) {
    cerr << "Bank::_narrow() failed!" << endl;
    return 1;
  }

  // Use the Bank's object reference like you normally would...

Note that on older versions of TAO (before 1.1.10) the object reference format is slightly different:

  client -ORBInitRef CORBABank=iioploc://bart:10200/BankObject



Q:

How do I use a "corbaloc" object reference with a TAO server?

A:

Note: The corbaloc style object reference was added to the CORBA standard via the Interoperable Naming Service specification. For more information on "corbaloc", see the CORBA 2.3.1 (or later) specification, section 13.6.6.

TAO added support for corbaloc references in version 1.1.10. Prior to that, TAO supported an earlier version of the specification that used the iioploc format. You can use corbaloc references to contact servers built with any version of TAO (assuming the client ORB supports them).

To simplify use if corbaloc object references, you can register your CORBA object in the server ORB's IOR table so it can be located via a simple object key. To bind an object reference to this table in current versions of TAO (1.1.10 and later):

  // Turn your object reference into an IOR string 
  CORBA::String_var ior_string = orb->object_to_string(obj.in());

  // Get a reference to the IOR Table 
  CORBA::Object_var tobj = orb->resolve_initial_references("IORTable");
  IORTable::Table_var table = IORTable::Table::_narrow(tobj.in());

  // Bind your stringified IOR in the IOR Table 
  table->bind("CORBABank", ior_string.in());
You will also need to #include "tao/IORTable/IORTable.h" and link with the TAO_IORTable library.

In older versions of TAO (1.1.9 and prior) this binding is accomplished via the following code:

  // Add our Bank object to the ORB's IOR table (TAO specific).
  orb->_tao_add_to_IOR_table( "CORBABank", obj.in() );

Both of these techniques make it possible for corbaloc-style object references to locate the specified CORBA object via a simple object key ("CORBABank"). The Bank's object reference doesn't necessarily have to be a persistent object reference, but it can be. For more information on persistent object references, see How do I make my object references persistent? .

When we run the TAO server, we must ensure that it listens on a host and port that are known to the client. We use TAO's -ORBListenEndpoints command-line option to do this. The format of -ORBListenEndpoints is

  -ORBListenEndpoints iiop://host:port
For example, if I'm running my server on host "myhost", listening on port 11019:
  server -ORBListenEndpoints iiop://myhost:11019
When running the client, we'll use a "corbaloc" object reference. The format of the "corbaloc" object reference is
  corbaloc:protocol:host:port/ObjectKey
For example:
  corbaloc:iiop:myhost:11019/CORBABank
connects to the server on host "myhost" at port 11019, and finds the object reference in that server corresponding to the "CORBABank" key. This object reference can be passed to ORB::string_to_object() and then is used like any other object reference.


Q:

How do I make my object references persistent?

A:

In CORBA terminology a transient object reference is one that is only good for the lifetime of a given server's execution. If you run a server, distribute a transient reference to a client, and then kill the server, then the object reference is now useless (even if the server is restarted). A persistent reference allows you continue to use the reference even if the server is restarted.
In order to make your object references persistent you must do the following in your server:
  1. Create a child POA with the PERSISTENT and USER_ID policies.
  2. Create an ObjectId for each servant using PortableServer::string_to_ObjectId().
  3. Activate the object in the child POA using activate_object_with_id().
  4. Start the server listening on a particular endpoint using the -ORBListenEndpoints option.
All of this is standard CORBA except for step 4, which requires an ORB-specific option. An alternative to step 4 is to use the Implementation Repository.
For example:
  // Initialize the ORB.
  CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);

  // Obtain an object reference for the root POA.
  CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
  PortableServer::POA_var rpoa = PortableServer::POA::_narrow(obj);

  // Create a policy list for our child POA.
  CORBA::PolicyList bankPolicies;

  // Create the policies for our child POA:
  //   LifespanPolicy: PERSISTENT
  //   IdAssignmentPolicy: USER_ID
  pols.length(2);
  pols[0] = rpoa->create_lifespan_policy(PortableServer::PERSISTENT);
  pols[1] = rpoa->create_id_assignment_policy(PortableServer::USER_ID);

  // Get the Root POA's POA Manager so it can manage our child POA
  PortableServer::POAManager_var poa_mgr = rpoa->the_POAManager();

  // Create the child POA.
  PortableServer::POA_var bank_poa =
    rpoa->create_POA("BankPOA", poa_mgr, pols);

  // Destroy the POA policies (create_POA() makes a copy).
  pols[0]->destroy();
  pols[1]->destroy();

  // Create a Bank servant object and activate it with the POA.
  Bank_i* bankServant = new Bank_i();

  // Explicitly activate the Bank servant.  We will use the string
  // "CORBABank" to generate an ObjectId for the bank.
  CORBA::String_var bankIdString = CORBA::string_dup("CORBABank");
  PortableServer::ObjectId_var bankId =
    PortableServer::string_to_ObjectId(bankIdString.in());
  bank_poa->activate_object_with_id(bankId, bankServant);
  obj = bank_poa->id_to_reference(bankId.in());

  // Activate the POAs.
  poa_mgr->activate();

  // Handle requests from clients.
  orb->run();

Since the Bank's object reference is a persistent IOR, when we invoke the Bank's server, we need to specify a particular endpoint for the ORB. For example:

  BankServer -ORBListenEndpoints iiop://bart:10200

Now, any clients that receive these object references can use them between different runs of the server. Note, that you still need to manually restart the server, unless you use the Implementation Repository.



Q:

Using the Naming Service

A:

The Naming Service is a common boostrapping/discovery mechanism. The following FAQ's address the naming service: I'm having weird problems with the Naming Service. How can I solve them? , How do I locate the Naming Service without resorting to multicast discovery? , Why is multicast discovery of the Naming Service failing? , Is the Naming Service server's object reference "persistent?"


Runtime Configuration


Q:

How do I get a TAO server to use IIOP v1.0 or v1.1?

A:

You must use the -ORBListenEndpoints option. For further details, please refer to the TAO Developer's Guide, the chapter on "ORB Initialization Options." Alternately refer to $TAO_ROOT/docs/Options.html.

The short answer is:

-ORBListenEndpoints iiop://V.v@[hostname:[port]]

The V.v@ portion of this syntax informs the server to use a specific major and minor version of the specified protocol. For example, to force a server to use IIOP v1.1 (instead of the default v1.2) on a host named "barney" at port 22000:

-ORBListenEndpoints iiop://1.1@barney:22000

If you always want to force use of IIOP 1.0 or 1.1, you can set the following macro values and rebuild TAO (and your application):

#define TAO_DEF_GIOP_MAJOR 1
#define TAO_DEF_GIOP_MINOR 0 [or 1]

These macros are typically set in $TAO_ROOT/tao/orbconf.h or $ACE_ROOT/ace/config.h.
Correction to the "-ORBListenEndpoints" syntax. It should be:
-ORBListenEndpoints iiop://1.0@[host][:port]
The hostname is not always required.


Q:

Why is my "client" thread dispatching requests?

A:

By default, TAO attempts to efficiently use all the threads that are given to it. This includes "client" threads that have sent a request and are waiting for a reply from the server. While waiting, these threads enter the normal thread pool reactor event loop. This means that any incoming requests (assuming that the process is also a server) may be dispatched using that thread. Such a situation is referred to as a "nested upcall".

This has a couple of side effects that surpise many people. First, it is possible for even a single threaded server to process more than one request at the same time. Second, if you try to allocate threads exclusively as "server" threads and "client" threads, the ORB will pay no attention to your idea of what these threads are and dispatch requests on both.

Why is this the default behavior of TAO? Mainly because nested upcalls avoid many potential deadlock situations. One example is a simple callback operation with a single threaded client. When the client sends a request to the server, the server sends a callback request back to the client. If the client's only thread is waiting for the reply and not dispatching incoming requests, then a deadlock is now in place. The default behavior allows the client ORB to process the callback request and send a reply to the server which frees the server ORB to send its reply back to the client.

There however are situations where you may wish to prevent nested upcalls in your application. Some common reasons are:

  • Real-time applications which impose strict response times.
  • Resource limitations which impose concurrency limitations.
  • Short response time. The response will be buffered until the nested upcall unwinds.
  • Recursive nested upcalls may lead to unbounded stack growth, which will eventually crash the application.

See entry How can I prevent nested upcalls in my application? for techniques to prevent nested upcalls.


Q:

How can I prevent nested upcalls in my application?

A:

As discussed in entry Why is my "client" thread dispatching requests? there are situations when we may want to disable nested upcalls in our application. There are several techniques available to prevent nested upcalls. These are:

  • The RW wait strategy is the most popular and probably the easiest mechanism to prevent nested upcalls. You can modify the default client wait strategy via the -ORBWaitStrategy (formerly known as the -ORBClientConnectionHandler) service configurator option.Specifying an "rw" wait strategy causes threads waiting for replies to not enter the normal event loop and instead block for their pending reply. This keeps the ORB from dispatching incoming requests on your "client" threads. One side effect of this option is that your client is now more susceptible to deadlocks as discussed in Why is my "client" thread dispatching requests?. Here are the required directives (each directive should appear on one line):

    static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive
    			        -ORBConnectStrategy blocked -ORBConnectionHandlerCleanup 1"
    
    static Resource_Factory "-ORBFlushingStrategy blocking"
    

    Note that you should always set the -ORBTransportMuxStrategy to exclusive, the -ORBConnectStrategy to blocked, the -ORBFlushingStrategy to blocking and the -ORBConnectionHandlerCleanup to 1 when using the rw wait strategy.

    Also note that -ORBConnectionHandlerCleanup is not available in versions of TAO prior to 1.4a_p11.

    The reason for using exclusive transport multiplexing is that you must not allow another request to be sent over a connection if that connection is already being used by another thread that is waiting for a reply. The blocking connect and flushing strategies are required because the event handler for a connection used to send a request is not registered with the ORB's Reactor. The Connection Handler Cleanup strategy needs to be enabled to properly cleanup server side connection closure.

  • The Two-ORB technique relies upon all outbound invocations being made from a designated 'client ORB'. This will prevent the client threads from entering the 'server ORB' thread-pool and hence don't get dispatched for nested upcalls. To make sure invocations on object references always go through the "client" ORB, just make sure those object references are always demarshalled using the client ORB. This can get tricky. For example, if you receive an IOR for a callback object as an in parameter to an operation, it will have been demarshalled through the "server" ORB (the one that received the request). To force the IOR to be demarshalled via the "client" ORB, you have to play some trick like this:
    // Assume the callback's IOR is in a Callback_var called cb.
    
    // First, "remarshal" the callback IOR using the "server" ORB.
    CORBA::String_var cbstr =
        server_orb->object_to_string(cb.in());
    
    // Then, demarshal it using the "client" ORB.
    CORBA::Object_var new_ior =
        client_orb->string_to_object(cbstr.in());
    
    // Finally, narrow it to the derived interface type
    // (can reuse cb).
    cb = Callback::_narrow(new_ior.in());
    

    Now, when your application makes an invocation on the callback IOR, it will be sent via the "client" ORB, where it cannot be dispatched for nested upcalls.

    Note: Both Two-ORB and RW wait startegy are incompatible with BiDirectional GIOP.


  • Q:

    What's the recommended configuration when using thread-per-connection?

    A:

    If you wish to use the thread-per-connection server-side concurrency model, a few other settings should also be present in your svc.conf file. Below is an example of this.
    static Server_Strategy_Factory "-ORBConcurrency thread-per-connection"
    static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive -ORBConnectStrategy blocked -ORBConnectionHandlerCleanup 1"
    static Resource_Factory "-ORBFlushingStrategy blocking"
    

    Note that -ORBConnectionHandlerCleanup is not available in versions of TAO prior to 1.4a_p11.
    The rational behind these settings is as follows: in thread-per-connection a thread is dedicated to servicing requests that come in on a given connection. In order to keep this thread dedicated to its connection, we need to prevent the thread from entering the reactor or the leader-follows pool even in the event that the thread attempts to make a request on a remote object (see the Client_Strategy_Factory settings) or cannot write a large reply back to the socket all at once (the -ORBFlushingStrategy setting). This is closely related to the use of the RW wait strategy in order to prevent nested upcalls.


    General/Miscellaneous Questions


    Q:

    How can I get TAO to use a transport protocol other than TCP/IP?

    A:

    TAO includes a "pluggable" transport protocol framework that allows the ORB to be configured to work over transports other than TCP/IP. In fact, the standard Internet Inter-ORB Protocol (IIOP) is implemented in TAO as a pluggable transport protocol that is based on TCP/IP. Besides IIOP, TAO comes with several alternate transport protocol implementations, including:
    • Unix Inter-ORB Protocol (UIOP), which is based on Unix Domain Sockets (or local IPC)
    • Shared Memory Inter-ORB Protocol (SHMIOP), which uses shared memory as a transport.
    • Datagram Inter-ORB Protocol (DIOP), which uses UDP for efficient message transfer in limited circumstances.
    • Secure Sockets Layer Inter-ORB Protocol (SSLIOP), which is based on SSL.
    • Multicast Inter-ORB Protocol (MIOP), implemented atop Unreliable IP Multicast (UIPMC).
    • Hypertext Inter-ORB Protocol (HTIOP), which uses HTTP tunneling.
    • Stream Control Transmission Protocol Inter-ORB Protocol (SCIOP), which is based on SCTP (IETF RFC 2960).

    Currently, the UIOP, SHMIOP, DIOP, and SCIOP implementations are all found in $TAO_ROOT/tao/Strategies/ and the TAO_Strategies library. SSLIOP is implemented in the TAO_SSLIOP library in $TAO_ROOT/orbsvcs/orbsvcs/SSLIOP/, MIOP/UIPMC in the TAO_PortableGroup library in $TAO_ROOT/orbsvcs/orbsvcs/PortableGroup/, and HTIOP in the TAO_HTIOP library in $TAO_ROOT/orbsvcs/orbsvcs/HTIOP/.

    The use of the underlying transport protocol is completely transparent to the application. In fact, the ORB can actually be configured to use more than one transport protocol simultaneously.

    If one of the above built-in transport protocols does not meet your needs, you may need to implement one yourself. If done correctly, it should require no changes to the TAO core. Use one of the existing pluggable transport protocol implementations as guidance.

    Using and developing pluggable protocols is documented in detail in the TAO Developer's Guide.



    Q:

    Which thread does TAO use to dispatch a request?

    A:

    The answer to this depends on a number of conditions:
    • If the client is collocated with the servant and collocation is enabled, then the request is serviced on the client's thread. Collocation can be disabled via the option: -ORBCollocation no
    • If the client is not in the same process as the servant (or collocation is disabled), then the concurrency strategy of the servant's ORB determines the servicing thread. By default, this is the same thread where orb->run() or orb->perform_work() is called. You can also specify a thread-per-connection model via the -ORBConcurrency option and a threadpool model by using the thread pool reactor.

    See https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/docs/Options.html?view=co for more details on these options.

    See http://www.cs.wustl.edu/~schmidt/PDF/C++-report-col18.pdf for a discussion of TAO's collocation optimizations.


    Q:

    How can I detect when a connection between a client and server is broken?

    A:

    (Paraphrased from e-mail by Carlos O'Ryan coryan@uci.edu)

    You cannot directly detect when this happens. You could write a pluggable protocol that informs your application when a connection dies, but that's about it.

    Typically behind this question is the issue: how can I detect if my client died. Using connections for that is a very bad idea: the client or server ORBs may close the connection just because it is idle for too long or there may not be a physical connection between two ORBs (they may be collocated or using shared memory to communicate). There can also be multiple connections between a given client-server pair. In CORBA, connections are hidden, and can come and go as needed. Trying to rely on them to establish if the client is still there does not work.

    In general you are better off using some application-level session object that gets destroyed by the client when it terminates gracefully, and that gets destroyed by an Evictor if it has been idle or unable to contact the client for too long.


    Q:

    What are these CORBA::Environment parameters? Why do I get errors about pure virtual functions?

    A:

    The CORBA::Environment parameters are part of the alternate exception mapping defined by the OMG's IDL to C++ language mapping specification. Normally, CORBA exceptions are mapped to C++ exceptions. The mapping also allows CORBA to be used when C++ exceptions are unavailable or undesirable by passing exception information via an extra parameter of type CORBA::Environment. TAO versions up to 1.5.1 support both mappings and you can build ACE/TAO to support either mapping by passing exceptions=0 or exceptions=1 to GNU make or by defining the macro ACE_HAS_EXCEPTIONS.

    If you build TAO to use native C++ exceptions, the IDL compiler, by default, does not include the CORBA::Environment parameters. If you build with the alternate mapping, the IDL compiler includes the CORBA::Environment parameter by default. You can explicitly tell the IDL compiler what to do with the -Ge option (-Ge 1 includes the extra parameter, -Ge 0 omits it). You need to generate the skeleton classes in a manner that is compatible with your servant classes or you will receive compiler errors about abstract classes or pure virtual functions.

    For more information about Exceptions and TAO, see the Error Handling chapter of the TAO Developer's Guide.


    Q:

    What is involved with using std library (inc stl) with ACE/TAO?

    A:

    There are several conditional directives that are relevant:
    • ACE_HAS_STANDARD_CPP_LIBRARY -- Causes ACE to #include the standard libraries where appropriate instead of older style runtime libraries, or defining its own equivalent. (ie <cstdio> instead of <stdio.h> or <memory> instead of creating its own auto_ptr)
    • ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB -- This causes ACE to define "using std::xxx" for all the std classes it uses. I've never messed with this one, so I'm not sure of all the ramifications. I notice that it is defined by default for most (all?) windows compilers.
    • ACE_HAS_STDCPP_STL_INCLUDES -- This seems to be used only in ace/IOStream.h. It causes ACE to use <string> instead of <String.h>. It's not defined for VC++, but is for some other win32 compilers. I've never used this one either.
    In practice, I typically define ACE_HAS_STANDARD_CPP_LIBRARY, and use stl and other std objects in my code. You can still use std library functions and objects without defining ACE_HAS_STANDARD_CPP_LIBRARY, but it can be a hassle because of duplicate definitions. (e.g. std::cout & cout are different, so you have to explicitly use std:: most places, and you can't use them interchangeably)
    In practice it is fairly common to use ACE_HAS_STANDARD_CPP_LIBRARY. I always use this, and prefer the standard library to ACE where there is overlap. (ie std::map or hash_map over ACE_Hash_Map_Manager_Ex) Of course this can be a portability issue.


    Q:

    Why does ORB_init change the order of the command line arguments if we pass argv to ORB_init(argc, argv)?

    A:

    CORBA::ORB_init() is supposed to remove all "-ORB" options it recognizes. One way of doing that logically and efficiently is to put all of those recognized arguments at the end of the argument vector and adjust the argument count (argc) accordingly.

    You are only supposed to use the first "argc" number of arguments after call CORBA::ORB_init(). In your case, you had:

      argc = 3    and argv = { "ex", "-ORBDebugLevel", "5" }
    
    After calling CORBA::ORB_init() you have:
      argc = 1    and argv = { "ex", "5", "-ORBDebugLevel" }
    
    This means that you should only be using first argument from the argument vector.

    If you need to maintain the order of the original argument vector for later use, then you have to make a copy before calling CORBA::ORB_init().



    Q:

    Why don't signals work with the ORB's reactor?

    A:

    Signals and the ORB reactor:

    By default ACE uses the ACE_Select reactor, which works with signals. TAO defaults to use the thread pool (TP) reactor, which does not currently work with signals. See DOC Bug 1031:

    http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1031

    The call ACE_Reactor::instance() returns an ACE_Select_Reactor. The call TAO_ORB_Core_instance()->reactor() returns an ACE_TP_Reactor.

    Another possible approach for handling signals in a TAO application that uses the default TP reactor would be to spawn a separate thread and use ACE_OS::sigwait() to handle the signals.



    Q:

    What is TransportCurrent library used for ?

    A:

    It provides an implementation of an interface(Transport::Current) for obtaining common transport information and an implementation of IIOP specific interface (Transport::IIOP::Current) for obtaining IIOP specific transport information. On the other hand it also is a framework for implementing transport-specific plug-ins (for querying specific transport, other than IIOP).

    Please see $TAO_ROOT/docs/transport_current/index.html for description of the Transport Current feature.



    Q:

    How can my TAO application obtain endpoint information (e.g., IP address and port for IIOP) of the client during a request invocation?

    A:

    The TransportCurrent(see What is TransportCurrent library used for ? ) library provides the IIOP specific interface (TAO::Transport::IIOP::Current) and implementation. The TAO::Transport::IIOP::Current interface provides access to the information of the local and remote endpoints.

    Here is an example to obtain endpoint information via TAO::Transport::IIOP::Current interface.

      
      // Get the IIOP Current object.
      CORBA::Object_var tcobject =
        orb->resolve_initial_references (ACE_TEXT_ALWAYS_CHAR
    ("TAO::Transport::IIOP::Current"));
    
      Transport::IIOP::Current_var tc =
        Transport::IIOP::Current::_narrow (tcobject.in ());
    
      if (CORBA::is_nil (tc.in ()))
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("Tester (%P|%t) ERROR: Could not resolve ")
                      ACE_TEXT ("TAO::Transport::IIOP::Current object.\n")));
    
          throw CORBA::INTERNAL ();
        }
    
      // Access the host and the port of the remote endpoint.
      ::CORBA::String_var rhost (tc->remote_host ());
      ::CORBA::Long rport = tc->remote_port ();
      
      // Access the host and the port of the local endpoint.
      ::CORBA::String_var lhost (tc->local_host ());
      ::CORBA::Long lport = tc->local_port ();
      
    Note the transport information is only available on server-side at interception points or inside a servant up-call. Specifically, the code above must be called within interceptor hooks(e.g. receive_request_service_contexts(), receive_request(), send_reply() and etc.) or inside a servant implementation method.

    To use the Transport Current features, the TransportCurrent library must be loaded via Service Configurator, or be statically linked . Here is an example of the Service Configuration file.

    
      dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() ""
    
    

    One could achieve the same, by using -ORBSvcConfDirective with the above as a parameter.



    Q:

    How can my TAO client obtain information about the endpoint (e.g., IP address and port for IIOP) it is using to send a request?

    A:

    The TAO::Transport::IIOP::Current interface can be used to obtain information about the local and remote endpoints. Please see example code in How can my TAO application obtain endpoint information (e.g., IP . Similar code can be used by the client to obtain information about the endpoint used to send a request. Note since the transport information is only available on client side at interceptor points (within send_request, send_poll(), receive_reply(), receive_exception() and receive_other ()), TAO must be built with support for interceptors if the client side needs Transport::Current functionality.


    Errors, and possible solutions


    Q:

    Why do I experience a run-time link error, even though my path and environment variables are set correctly and I have a fresh build tree?

    A:

    You may have an older version of one of the ACE, TAO, or CIAO libraries somewhere in your library search path (e.g., PATH on Windows, LD_LIBRARY_PATH on Linux) that you don't know about, even though you have only one build tree of ACE+TAO+CIAO. For example, the CoSMIC tool chain installer ships with the ACE libraries and installs them on your system. The same is true of OCI's TAO distribution CDs.

    If you do have an out-dated version of one of the ACE, TAO, or CIAO libraries (e.g., ACE.dll), and its path appears in the library search path before $ACE_ROOT/lib from your build tree, you will have run-time link errors. The run-time linker tries to link your program against the first occurrence of the library that it finds in the library search path.

    You can confirm that this is the problem you are having by moving the problematic library in your build tree to a backup file and re-running your application. If you still experience the run-time link error, then you probably have another (stale) version of the problematic library on your system. (The ldd command on Linux and Unix can be very helpful in tracking down where the out-dated library is located.) To correct the problem, ensure that $ACE_ROOT/lib comes first in the library search path. On Windows, you will need to restart your terminal windows and development environment.

    Thanks to Stoyan Paunov for contributing this question and answer.



    Q:

    My server IOR contains the address 127.0.0.1 and my client, running on a different machine, can't connect. What do I do?

    A:

    When determining the endpoint for a server, TAO chooses an interface from the interfaces available to the system and encodes its address within the IOR. If TAO chooses 127.0.0.1 (the local loop back) as the endpoint address, then it could not find any other suitable interfaces. Since this address is only visible to local machine, no other machine will be able to connect to the local machine through that address.
    If there are dynamic interfaces that are available to the system, you may need to explicitly specify that TAO should use that interface with the -ORBListenEndpoints command line option:
      -ORBListenEndpoints iiop://< hostname or ip address >:< port >



    Q:

    Why I am getting errors when I try to initialize the first ACE object in an application?

    A:

    The short answer is that you probably need to call ACE::init() before initializing or using any ACE/TAO objects. You should also be sure to call ACE::fini() at the end of your application's use of ACE.

    When you include ACE/TAO headers from the file containing the main() function, the ACE::init() function is called automatically for you at the start of main(). ACE::init() initializes the ACE Object Manager, and must be called before initializing or using any ACE/TAO objects. When you only use ACE/TAO from libraries that are dynamically linked, you may need to explicitly call ACE::init() beforehand. Also, you will need to call ACE::fini() to close down the ACE Object Manager at the end of your application's use of ACE/TAO (e.g., at an exit point from the code in your library).



    Q:

    Why is my application leaking memory when I use local objects?

    A:

    It is likely that your objects are using reference counting to manage their life cycle. The CORBA::LocalObject class provides an empty implementation of the _add_ref() and _remove_ref() methods. However, the TAO_Local_RefCounted_Object implements real reference counting through these methods.

    The solution to your memory leak may be as simple as inheriting from TAO_Local_RefCounted_Object instead of CORBA::LocalObject.



    Q:

    Why does my application fail when the client and server are on different hosts?

    A:

    When an application works with the client and server on the same host, but fails when they are on different hosts, the usual culprit is some sort of naming problem between the hosts. One simple way to test this is to use the ping command to attempt to ping each host from the other (using the host name). You need to ping in both directions as TAO will require both paths.

    Another way to test this (and even make it work) is to tell TAO to use decimal addresses (i.e. 128.252.120.1) instead of host names. You can do this by passing -ORBDottedDecimalAddresses 1 via argv[] to CORBA::ORB_init() in each process of your application. Note that you need to do this for every CORBA server in your system. Because many client applications are also CORBA servers, it is best to use this option for all processes. Assuming your code passes command line options to CORBA::ORB_init(), you can do this from the command line:

      server -ORBDottedDecimalAddresses 1
      client -ORBDottedDecimalAddresses 1
    
    Even if this works, you still probably want to get your system administrators to fix the naming problems. If you want to always force use of decimal addresses add the following to your $ACE_ROOT/ace/config.h:
      #define TAO_USE_DOTTED_DECIMAL_ADDRESSES 1
    

    Note: In recent versions of TAO, on Windows, the default is to use dotted decimal addresses rather than hostnames.

    You may also run into the problem described in this question if your server happens to be listening on the address associated with the loopback device. The IP address for this "host" is 127.0.0.1 and often (especially on Linux-based hosts), the hostname is set to localhost.localdomain. Thus, when your client tries to resolve the hostname, it resolves it correctly but connects to itself rather than the host on which the server is actually running.

    Use catior (in $TAO_ROOT/utils/catior) to "peek inside" your TAO-generated IORs; if you see localhost.localdomain (or something similar) in the output, then you might have this problem! Use the -ORBListenEndpoints option (also called the -ORBEndpoint option) to specify the hostname on which the server should listen for requests (and, thus, the hostname that it encodes in the IORs it generates).

    The -ORBListenEndpoints option takes many arguments and modifiers. See https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/docs/ORBEndpoint.html?view=co and the TAO Developer's Guide for more details on the the -ORBListenEndpoints option.

    Thanks to Tim Fry <tfry at imoney dot com> for posting to the tao-users mailing list the raw material from which this entry was created.



    Q:

    Why does my multithreaded server deadlock when I make an invocation from an event handler registered with the ORB's reactor?

    A:

    (Expanded question): I am running a server with a few threads in a thread pool. I have also registered an event handler with the ORB's Reactor from which I am making remote invocations. My server is deadlocking. Note: I am using the default configuration (i.e., default concurrency strategy, wait strategy, flushing strategy, etc.)

    (Answer): By default, the ORB uses a Leader Follower (LF) for receiving requests and processing replies from remote targets. It uses a simple protocol that keeps track of the server threads that are ready to process invocations and the client threads that are waiting to process replies.

    When you register your own event handlers with the reactor, the reactor makes an upcall directly into your application code. If your event handler code then makes a remote call and waits for a reply, the LF protocol breaks down since a thread marked as a server thread becomes a client thread without the LF's knowledge. The signature of the problem is a blocked server with stack traces showing none of the threads in the select() system call.

    To fix this problem, you have to abide by the LF protocol. Do the following within your event handler code (e.g., in handle_timeout() or the other handle_* methods):

       TAO_ORB_Core *oc = my_orb->orb_core ();
       oc->lf_strategy ().set_upcall_thread (this->orb_core_->leader_follower ());
    

    You may have to include the header files "tao/ORB_Core.h" and "tao/LF_Strategy.h" in your code to get the above code to compile cleanly. Also, when you make the above calls, remember to use the ORB within whose reactor you registered your event handler.

    Thanks to Milan Cvetkovic <mcvetkovic@mpathix.com> for reporting the problem and to Balachandran Natarajan <bala@dre.vanderbilt.edu> for providing the answer.

    Note: You could also solve the problem by configuring the ORB to use a different wait strategy other than the default Leader Follower.
    See Why is my "client" thread dispatching requests? for more information.

    Or, you could use a different ORB (other than the server ORB) in your event handler for making the outbound invocation.



    Q:

    How can I fix the follwing linker errors from VC71 or VC8 when using IDL sequences of basic types?

    A:

    If you see the following (or similar) linker errors...
    TAO.lib(TAO.dll) : error LNK2005: "public: void __thiscall TAO::unbounded_value_sequence::length(unsigned int)" ([mangled name removed]) already defined in fooC.obj
    
    ...and the IDL file foo.idl contains a typedef of a sequence of basic types like so... (basic types are types defined by the OMG IDL spec like string, long, etc.)
    typedef sequence<unsigned long> MyULongList;
    
    ...the problem is that both your library or exe (from fooC.obj) and TAO.dll are exporting the same class (instantated from the sequence template). Until and unless this issue is fixed for good in the IDL compiler (see DOC group bugzilla entry 2703), use one of the following work-arounds:
    • Instead of typedef'ing your own MyULongList, use CORBA::ULongSeq or similar.
    • Add #include <tao/orb.idl> (which includes tao/ULongSeq.pidl) to the top of your IDL file, or just the include statement for the sequence type(s) that you are using (such as tao/ULongSeq.pidl).
    Either of these work-arounds will force the compiler, when building fooC.obj from fooC.cpp, to see the exported class in the TAO library's headers and avoid re-exporting it.


    Interoperability Issues


    Q:

    Why does Orbix 2000 reject large messages from TAO?

    A:

    (as related by Balachandran Natarajan bala@cs.wustl.edu)

    By default, Orbix 2000 will reject any message larger than 512 KB.

    Orbix 2000 users can get around this by setting a run time policy in their configuration file. The policy is

      policies:iiop:buffer_sizes_policy:max_buffer_size = "-1";



    Q:

    What ORBs does TAO interoperate with?

    A:

    There are many different interpretations of the word "interoperate". In general, TAO works with any ORB that adheres to the relevant OMG CORBA standards. If it doesn't work, then there is a bug in one of the ORB implementations. If it is with TAO it is usually corrected quickly (even quicker if you help document and debug the problem). Other ORB implementors also fix these problems quite quickly when they are brought to their attention.

    There is no definitive list of ORBs that a particular version of TAO works with. Here are some ORBs that users have reported successfully using with TAO in the past:

    • Orbix (3.x, 2000)
    • Visibroker
    • JacORB
    • OpenORB
    • Sun JDK ORB
    • ORBExpress
    • INTERSTAGE
    • CorbaScript
    • Orbacus
    • ZEN
    • MICO
    • OmniORB
    There are probably others.



    Q:

    Is the TAO Naming Service interoperable with the JDK 1.4 beta 3 ORB?

    A:

    JDK 1.4