ace/tao faq

186 views
Skip to first unread message

Stone Jiang

unread,
Mar 7, 2006, 12:08:18 AM3/7/06
to ace-...@googlegroups.com

last updated on: 1/31/2006

Send updates, additions, and corrections to f...@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 DOC's TAO?

Q:

What's a PRF?

Q:

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


Building OCI's Distribution of ACE and TAO


Q:

How do I obtain, configure, and build OCI's Distribution of ACE and TAO on Windows?

Q:

How do I obtain, configure, and build OCI's Distribution of ACE and TAO on Linux?


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 NT machine?

Q:

I get a font error during installation using the TAO 1.1 CD, what can I do?

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 for TAO 1.2a?


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 server without multicast?

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 COS Event Service support Typed Events?

Q:

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

Q:

Why are the notification event channel consumers not receiving events?


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?


General/Miscellaneous Questions


Q:

Which OMG CORBA specifications is TAO compliant with?

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:

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

Q:

Why doesn't TAO support the BOA?

Q:

How can I get TAO to use my own transport rather than TCP/IP?

Q:

Is the tao-users mailing list archived anywhere?

Q:

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

Q:

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

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:

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

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 is my "client" thread dispatching requests?

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 reactor?

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 build debug applications with non-debug libraries?


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?


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:

Can I build ACE and TAO on Windows 95 or Windows 98?

Q:

Does OCI's version of TAO contain MFC libraries?

Q:

Can I use IP multicast for service discovery in Windows 95 or Windows 98?

Q:

Has anybody gotten TAO (and ACE) to compile using Borland CBuilder 4?

Q:

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

Q:

How do I export generated classes from DLL's

Q:

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

Q:

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

Q:

Why do I get errors while using 'TryEnterCriticalSection'?

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 sup...@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 Developers' 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 DOC's TAO?

A:

The short answer is that OCI releases OCI's TAO, and the DOC Group releases DOC's TAO. DOC releases beta kits every few weeks, while OCI puts out a release at most twice annually. OCI's release is based on a DOC Group release, but doesn't correspond exactly to an exact DOC Group release. DOC release numbers are X.Y.Z, where X, Y, and Z are all integers, while OCI numbers them X.Yq where X and Y are integers and 'q' is a lowercase letter.

OCI's release represents a stable, fully-tested, product for which commercial support is available. Many organizations desire a commercially-supported release of TAO as a basis for their application development.

The long answer is that the DOC Group (http://www.cs.wustl.edu/~schmidt/doc-group.html ) is a research group, not a product group. It, therefore, treats its source more like research than product. Often, bug fixes and feature enhancements are combined into a single release or beta kit, and occasionally even into a single commit. This facilitates rapid progress, but occasionally occurs at the expense of stability. Its distributions are solely in the form of source code, and, while the DOC Group often provides excellent support, it doesn't guarantee any support.

OCI selects, with the DOC Group's assistance, some release (either a release or a beta kit) generally considered to be "reasonably stable". OCI then begins its release cycle, building and testing on its build platforms (over 30 combinations of hardware, operating systems, and C++ compilers). As it encounters bugs, it does one of the following:

  • fixes them directly (contributing the fix back to DOC)
  • integrates an existing DOC fix (depending on the severity and the degree of entanglement)
  • documents the scenario as a bug

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

OCI then packages up select binaries (custom builds available -- see http://www.theaceorb.com/product/index.html) and makes them available for purchase on CD-ROM. OCI also distributes its source free of charge (see http://www.theaceorb.com/downloads).

An Example:
OCI's current release (at the time of this writing) is 1.3a. This is derived from DOC's 1.3.1 beta kit, with patches applied (applied patches get documented in the OCIChangeLog files distributed with OCI's release).



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").


Building OCI's Distribution of ACE and TAO


Q:

How do I obtain, configure, and build OCI's Distribution of ACE and TAO on Windows?

A:

This FAQ provides basic instructions for installing and building OCI's Distribution of TAO, version 1.4a, for Windows. 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.
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 free MB

Operating System Requirements

  - Windows 2000, 2003, or XP

C++ Compiler Requirements

  - Microsoft Visual C++ 6.0 SP5 or 7.1 (NOT 7.0)

Other Software Requirements

  - OCI TAO 1.4a latest patch release (see instructions below for
    obtaining and installing OCI TAO)
  - WinZIP or similar tool for extracting software archives
  - ActiveState 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.zip

  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. If you are using Visual C++ 6.0, build the Win32 Debug
     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.  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 the above 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. If you are using Visual C++ 7.1, build the Debug configuration of
     ACE+TAO using the following solution file:

     %TAO_ROOT%\TAOACE.sln

     The projects in the TAOACE solution build the ACE and TAO
     libraries, TAO IDL compiler, gperf, ORB services libraries and
     executables, and some common utilities.  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 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:

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



Q:

How do I obtain, configure, and build OCI's Distribution of ACE and TAO on Linux?

A:

This FAQ provides basic instructions for installing and building OCI's Distribution of TAO, version 1.4a, 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 free MB

Operating System Requirements

  - Linux 2.2 (or later) kernel

C++ Compiler Requirements

  - gcc 3.2.x (or later)

Other Software Requirements

  - OCI TAO 1.4a latest patch release (see instructions below for
    obtaining and installing OCI 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

  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.  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:

     cd $TAO_ROOT
     $ACE_ROOT/bin/mwc.pl -type gnuace TAOACE.mwc



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 1.2a 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://deuce.doc.wustl.edu/Download.html.
  • 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 1.2a. We want to make sure you are up and running with TAO as quickly as possible.
  • Documentation: Using OCI's Distribution of TAO 1.2a is easy with OCI's TAO Developer's Guide (available for purchase at http://theaceorb.com/buy/index.html ). In addition to the documentation set, you can view the TAO 1.2a release notes at http://www.theaceorb.com/1.2a/releasenotes/relnotes.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/1.4a/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 NT machine?

A:

It is possible to install both debug and release versions of TAO on one NT 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:

I get a font error during installation using the TAO 1.1 CD, what can I do?

A:

While this problem may exist on other platforms, we've only seen it trying to perform an installation from CD on Redhat 6.1. The problem will be fixed for the next release.

If you get this error message when starting the installation setup script:

font "" doesn't exist at /tmp/tkfiles.12950/perl/Tk/Widget.pm line 171.
  at /mnt/cdrom/_setup//window.pl line 116
You must use command line options to install TAO from the OCI TAO Distribution CD. Running 'setup -h' will show a list of options like this:
   Usage: setup [options...]
       -b = Builds
        buildtag, staticlibs

        Where possible values for buildtag are:
          il6e11a, il6e11b, il6e11c, il6e11d, is57e11a, 
          is57e11b, is57e11c, is57e11d, iw40v50a, 
          iw40v50b, iw40v50c, iw40v60a, iw40v60b, 
          iw40v60c, ph11h39a, ph11h39b, ph11h39c, 
          ph11h39d

       -e = Do not show the gui and begin installation.
        
       -f = Do not prompt about disk space (non-gui only).
        
       -h = Show this help.
        
       -i = Install Directory
        ace_root, fullsourcecodedistribution, includefilesonly

       -r = Read in the specified configuration file.
        
       -t = TAO Services
        cosevent, event, implrepo, lifecycle, naming, 
        scheduling, time, trading

       -u = Allow the use of Tk on unsupported platforms.
        
NOTE: All option arguments can be shortened to 3 letters.
      Boolean name value pairs default to 1 (true).  To turn
      something off use 0 (false).
  ex. setup -b buildtag=il6e11a -i ace_root=/ace -b static \
            -t eve=0 -t impl=1

      setup -b buildtag=ph11h39b -i ace_root=/home/jim/ace \
            -i inc=1 -t life=1

The -e option will be required to bypass all graphical interfaces.
For example, to install the full source of TAO for Linux with exceptions enabled and debug information disabled into /usr/local/ACE_wrappers, you would use the following command line:

setup -b buildtag=il6e11c -e -i ace_root=/usr/local/ACE_wrappers -i full
Look in the zips directory for a description of the builds. Each build has a .dat file which lists the different attributes associated with the compressed build.


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 sa...@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 for TAO 1.2a?

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, the default in all versions of TAO prior to 1.2a. Symptoms range anywhere from clients not being able to find the naming service, to it 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 server without multicast?.


Q:

How do I locate the naming service server without multicast?

A:

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

# Store the IOR of the Naming Service server'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 server (using TAO 1.1.10 and later):
   Naming_Service -m 0 -ORBEndpoint iiop://bart:2809
   client -ORBInitRef NameService=corbaloc:iiop:bart:2809/NameService
# Specify an IIOP endpoint when you start the Naming Service server (using TAO 1.1.9 and before):
   Naming_Service -m 0 -ORBEndpoint iiop://bart:2809
   client -ORBInitRef NameService=iioploc://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 -ORBEndpoint 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 NT, 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 -ORBEndpoint option to request that the server start on a specific endpoint, e.g.,

  Naming_Service -ORBEndpoint iiop://bart:9999
The general form is:
  Naming_Service -ORBEndpoint iiop://name_server_host:name_server_port

For more detailed information on using the -ORBEndpoint option, see the TAO Developer's Guide, Section 8.5.3.

For more information on direct binding of persistent object references, see Henning and Vinoski, 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 COS Event Service support Typed Events?

A:

No, and there are no plans to do so.
To quote Carlos O'Ryan (cor...@uci.edu):
"The spec is so loose that it is hard to define what an implementation would be, and implementations probably won't be interoperable."


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.


Q:

Why are the notification event channel consumers not receiving events?

A:

In TAO 1.1a the consumers receive all the events coming to the event channel by default. But in TAO 1.2a the consumers need to subscribe to the events to receive them, as they do not receive any events by default.

This can be done by calling subscription_change() on StructuredProxyPushSupplier. You need to do this after calling connect_structured_push_consumer() even when you want to receive all the events.


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 http://doc.ece.uci.edu/TAO/Security/SSLIOP-INSTALL.html.


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.bxa.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.



General/Miscellaneous Questions


Q:

Which OMG CORBA specifications is TAO compliant with?

A:

For a detailed discussion of OCI TAO 1.1a's compliance with CORBA specifications see http://theaceorb.com/compliance


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 -ORBEndpoint 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 -ORBEndpoint 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 -ORBEndpoint command-line option to do this. The format of -ORBEndpoint is

  -ORBEndpoint iiop://host:port
For example, if I'm running my server on host "myhost", listening on port 11019:
  server -ORBEndpoint 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 -ORBEndpoint 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. See http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO/docs/implrepo/ for details.
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 -ORBEndpoint 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:

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 on the Washington University Center for Distributed Object Computing's TAO web site at http://www.cs.wustl.edu/~schmidt/ACE-copying.html before you send code. 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 sa...@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:

How can I get TAO to use my own transport rather than TCP/IP?

A:

The short answer is that you will need to implement a pluggable protocol.

Starting with TAO 1.0.10, you can find the documentation for the pluggable protocol framework in your TAO distribution ($TAO_ROOT/docs/pluggable_protocols) or online here. Note that if you follow through the link, some browsers have problems loading the included graphics. The APIs for pluggable protocols have evolved with each new version of TAO and continue to change with recent betas. Be careful to use documentation that is consistent with the version of TAO you are using.

If the transport satisfies the basic requirements listed in the documentation, then it should be possible to do the implementation without modifying ACE or TAO source code. For an example on how to do this, check out the SSLIOP pluggable protocol.

If, on the other hand, your transport protocol doesn't satisfy those requirements (as described by Bruce Trask in the documentation when discussing his SCRAMnet pluggable protocol), then you may need to modify ACE & TAO as he describes.



Q:

Is the tao-users mailing list archived anywhere?

A:

Yes.

You can find the tao-users archives on the web at http://www.egroups.com/list/tao-users/.

The ace-users archive is available at http://www.egroups.com/list/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:

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

A:

You must use the -ORBEndpoint 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:

-ORBEndpoint 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:

-ORBEndpoint 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 "-ORBEndpoint" syntax. It should be:
-ORBEndpoint iiop://1.0@[host][:port]
The hostname is not always required.


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" to 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 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 (or $TAO_ROOT/tao/orbconf.h):

  #define TAO_USE_DOTTED_DECIMAL_ADDRESSES 1

You can also get this behavior 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 -ORBEndpoint option to specify the host on which the server should listen for requests (and, thus, the host which it sticks in IORs it hands out).

Thanks to Tim Fry tf...@imoney.com for posting the raw material from which this entry was created to the tao-users mailing list.
NOTE: In TAO 1.1a, the hostname provided to -ORBendpoint is not necessarily the hostname that will show up in the IIOP Profile!

Using -ORBendpoint allows the user to specify an interface on which the ORB listens for requests. Because there's no portable way for the ORB to only listen on a specific interface (physical or virtual), and there's usually a 1:1 correspondence between an interface and an IP address, the TAO's -ORBendpoint option specifies the interface by actually specifying the IP address bound to that interface. Since most people are better at remembering names rather than IP addresses, -ORBendpoint offers the convenience of specifying a hostname.

The confusion starts when people expect the hostname provided to -ORBendpoint to appear in the published IIOP profile. TAO, unless otherwise directed by the -ORBDottedDecimalAddresses option, published the canonical hostname in the IIOP profile, where canonical hostname is classically defined as the name returned by the gethostbyaddr() resolver function. Typically, this is the name published in DNS.

For further technical and philosophical discussion on this issue, refer to http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=474 and http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=506.

However in TAO 1.2a, this behavior has changed. If you specify an explicit hostname or IP address with the -ORBEndpoint option, it will be used verbatim to create the IIOP_Acceptor and therefore will show up in the IIOP profile in the IOR.

Since endpoints are transport entities, -ORBendpoint's behavior is peculiar to the transport in use and it may, at times, be inconsistent with other transports' uses of -ORBendpoint.

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 http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO/docs/Options.html 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 cor...@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:

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.


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 CORBA->C++ 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 supports both mappings and you can build ACE/TAO to support either mapping by passing exceptions=0 or exceptions=1 to GNU make or doing a #define of ACE_HAS_EXCEPTIONS.

If you build TAO to use native 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 flag (-Ge 1 includes the extra parameter, -Ge 0 omits it). You need to generate the skeleton classes in manner that is compatible with your servant classes or you will receive the 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 or http://www.cs.wustl.edu/~schmidt/ACE_wrappers/docs/exceptions.html .


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 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.

This has a couple of side effects that suprise 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 it avoids 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.

You can modify the default client side behavior of TAO 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 above. Here are the required directives (each directive should appear on one line):

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

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

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.


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 reactor?

A:

Signals and the ORB reactor:

By default ACE uses the ACE_Select reactor, which works with signals. TAO defaults to use the TP reactor, which does not currently work with signals. The call ACE_Reactor::instance() returns an ACE_Select_Reactor. The call TAO_ORB_Core_instance()->reactor() returns an ACE_TP_Reactor.



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 <mcvet...@mpathix.com> for reporting the problem and to Balachandran Natarajan <ba...@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 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


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 -ORBEndpoint command line option:
  -ORBEndpoint 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.

When you include ACE/TAO headers from the file containing main(), then the ACE::init() function is called automatically for you at the start of main(). When you only use ACE/TAO from libraries that are dynamically linked, you may need to explicitly call ACE::init() beforehand.



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.




Interoperability Issues


Q:

Why does Orbix 2000 reject large messages from TAO?

A:

(as related by Balachandran Natarajan ba...@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 supports Interoperable Object References (IORs). To use the JDK 1.4 ORB with the TAO Naming Service server:

Start TAO Naming Service server:

  $ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -ORBListenEndpoints iiop://host:port

Then, run the JDK 1.4 client as follows to use the TAO Naming Service:

  $ java MessengerClient \
      -ORBInitRef NameService=corbaloc:iiop:host:port/NameService

Here is a sample Java client:

public class MessengerClient
{
  public static void main( String[] args )
  {
    try {
        
      org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
      // resolve the naming service 
      org.omg.CORBA.Object obj =
        orb.resolve_initial_references("NameService");
      NamingContext rootContext = NamingContextHelper.narrow( obj );
      // create sample  name(sever binding)
      NameComponent[] name = { new NameComponent( "example", "" ),
                               new NameComponent( "Messenger", "" ) };
      // resolve the server reference
      obj = rootContext.resolve(name);
      Messenger msgr = MessengerHelper.narrow(obj);
      ..............
      ...........
    } catch ( Exception e ) {
       System.err.println( "ERROR: " + e );
        e.printStackTrace( System.err );
    }
  }
}




Realtime/Performance/Embedded Systems Issues


Q:

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

A:

It's not as easy to compare the performance of ORBs as generically as one might compare, e.g., the performance of microprocessors. There are no standard benchmarks available at the present. Thus, any evaluation of performance of an ORB is largely dependent on the application and its characteristics as well as the environment in which it's running (such as over an ATM network vs. ethernet vs. wireless, etc.).

That said, you might be able to get a better feeling of the situations in which various ORBs "shine" (performance-wise) by looking at some of the benchmarks available through the following links:

Finally, don't forget that nothing comes without a cost, so carefully evaluate the entire ORB package, not just the performance.


Q:

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

A:

There are several ways to minimize the sizes of the ACE and TAO libraries, at least in UNIX. They are described briefly here. More details can be found in the TAO Developer's Guide (Section B.2 of the TAO 1.3a Developer's Guide).

Note that all of these solutions take place at compile time, so if you have OCI's distribution of TAO you'll need to re-compile.

  1. Turn off debugging.

    To turn off the generation of extra debugging information in the libraries, use the "debug=0" make flag when building the ACE, TAO, and orbsvcs libraries. You can do this in your platform_macros.GNU file (e.g ., by putting "debug=0", without quotes, in the file), using the MAKEFLAGS environment variable (e.g., setenv MAKEFLAGS="debug=0"), or when you invoke the make command (e.g., make debug=0).

  2. Build only the ACE components needed for TAO.

    By default, all the ACE components are compiled and included in the ACE library. But, TAO depends upon only a subset of ACE. To build only those components needed for TAO, set ACE_COMPONENTS=FOR_TAO either as an environment variable or in your platform_macros.GNU file.

  3. Build only the "minimumCORBA" features.

    The TAO library can be built according to the "minimumCORBA" specification by excluding support for certain features such as DII, DSI, DynAny, and Servant Managers. To select the minimumCORBA subset of TAO, define the TAO_HAS_MINIMUM_CORBA precompiler macro in config.h, or pass "minimum_corba=1" to GNU Make via the MAKEFLAGS environment variable or directly to the make command.

  4. Use the "soreduce" tool to build a minimal set of shared libraries for your application.

    "soreduce" allows you to reduce the sizes of the ACE and TAO libraries by including only the object files that contain symbols used by the relevant executables. soreduce generates MPC files that can be used to build subsetted versions of the ACE/TAO libraries.

    For more information on soreduce, see $ACE_ROOT/apps/soreduce/README.

IMPORTANT

You should use the "size" command instead of measuring the size of each library file on disk (e.g., with "ls -l") to get a more accurate measure of the true size of the code in the library. For example, in TAO 1.1a, here is the output of the "ls -l" and "size" commands for $ACE_ROOT/ace/libACE.so on Linux (Fedora Core 2) built with gcc 3.3.3 with debug=1, exceptions=1, optimize=1:

    $ ls -l $ACE_ROOT/ace/libACE.so
    -rwxr-xr-x  1 johnc distcomp 48154963 Jan 18 11:13 libACE.so*
$ size $ACE_ROOT/ace/libACE.so text data bss dec hex filename 2018536 49636 11852 2080024 1fbd18 libACE.so

Note that the "ls -l" command reports the size of the library file on disk as a whopping 48154963 bytes (or about 46 MB) while the size command ("dec" column, which is the total of the "text", "data", and "bss" columns, in decimal) reports the size at only 2080024 bytes (or about 2 MB). (The "bss" section is unitialized data, according to the Solaris size(1) man page.)

You can also use the "size" command to measure the size of an executable.

The size of each library's file on disk, as reported by "ls -l", is actually somewhat irrelevant to the runtime size of your executable, for the following reasons:

  • If you are linking statically, most linkers will link into the executable only those parts of the library (the .o's) that you are actually using in your application.
  • If you are linking dynamically, the entire shared library will be loaded into memory, but it will be shared across all processes running on that host that are using the library. So, you only take the memory hit for the library once.
  • Also, even in a shared library situation, you are not likely to have the entire library resident at once. Most modern operating systems will page portions of the library file in and out of memory as needed by processes.

Depending upon your linker and operating system, your mileage may vary.



Q:

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

A:

Many embedded systems don't have filesystems, which really puts a cramp in using the svc.conf file and its directives (e.g., for the Resource_Factory).

However, you can pass Service Configurator directives on the "command line" using the -ORBSvcConfDirective (Section 7.4 in the TAO Developer's Guide).

For example, you might put code like the following in your main():

  ACE_ARGV orb_args(
    "-ORBSvcConfDirective "
    "\"static Resource_Factory '-ORBResources tss'\"");
  CORBA::ORB_var orb = CORBA::ORB_init(orb_args->argc(),
                                       orb_args->argv());



Q:

Running a thread pool ORB

A:

The trick is to configure TAO to use the thread pool reactor and then to call orb->run() from a number of threads, thereby enabling each thread to service incoming requests.

Selection of the reactor is done through the use of the resource factory, a service config object. If you are using a service configuration file, such as svc.conf, add a line:

  static Resource_Factory '-ORBReactorType tp'

If you cannot use a configuration file, add the following to your command line:

  -ORBServiceDirective "static Resource_Factory '-ORBReactor TP'"

Note that if you are already configuring the resource factory for any other behavior, do not add a new directive line, just add "-ORBReactor TP" to the arguments already passed to the resource factory.

Now that you have the correct reactor selected, you must invoke ORB::run() from within the threads that are members of the thread pool. The easiest way to achieve this is to derive from ACE_Task, override the svc() method to run the orb, and then use the activate method to start the desired number of threads.
For example:

  class my_ORB_Pool : public ACE_Task <ACE_MT_SYNCH>
  {
  public:
    virtual int open (void *arg);
    virtual int svc (void);
  private:
    CORBA::ORB_ptr orb_;
  };

  // A reference to the ORB must be supplied to the object, via open
  int
  my_ORB_Pool:: open (void *arg)
  {
    orb_ = ACE_static_cast (CORBA::ORB_ptr,arg); 
    return 0;
  }

  // ACE_Task::activate calls svc() in as many threads as we specify
  int
  my_ORB_Pool::svc (void)
  {
    orb_->run();
    return 0;
  }

  //Now, start it going

  int
  main (int argc, char ** argv)
  {
    // normal program initialization business
    my_ORB_Pool orb_pool;

    // initialize the orb, which also loads the correct reactor
    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
  
    int nthreads = 42; // the number of threads in the pool

    orb_pool.open(orb);
    orb_pool.activate (ACE_NEW_LWP,nthreads); // nthreads = 1 is normal 
                                          // reactive behavior

    ACE_Thread_Manager::instance->wait(); // wait for all threads
    return 0;
  }




Q:

Does TAO support request/reply timeouts?

A:

TAO 1.3a supports the Relative Roundtrip Timeout policy as defined in the CORBA Messaging specification (OMG TC Document orbos/98-05-05). This policy allows you to specify the maximum time allowed (in 100 nanosecond units) for a request to be sent to and processed by a server and the reply received by the client. The policy can be applied at one of three levels: the client ORB, the requesting thread, or the object reference on which the request is invoked.

Relative roundtrip timeouts can be applied when the client requires low request/reply latencies.

The following example shows how to set the Relative Roundtrip Timeout policy to a value of 1 millisecond (that is 1.0e-3 * 1.0e7 in 100 nanosecond units) and apply it at the ORB level:

  // Initialize the ORB.  It serves as a factory for policies.
  CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

  // Set the timeout value as a TimeBase::TimeT (100 nanosecond units)
  // and insert it into a CORBA::Any.
  TimeBase::TimeT relative_rt_timeout = 1.0e-3 * 1.0e7;
  CORBA::Any relative_rt_timeout_as_any;
  relative_rt_timeout_as_any <<= relative_rt_timeout;

  // Create the policy and put it in a policy list.
  CORBA::PolicyList pols;
  pols.length(1);
  pols[0] = 
    orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
                        relative_rt_timeout_as_any);

  // Apply the policy at the ORB level using the ORBPolicyManager.
  CORBA::Object_var obj =
    orb->resolve_initial_references ("ORBPolicyManager");
  CORBA::PolicyManager_var policy_manager = 
    CORBA::PolicyManager::_narrow (obj.in());
  policy_manager->set_policy_overrides (pols, CORBA::SET_OVERRIDE);

All requests made via this ORB will now timeout if a reply is not received within 1 millisecond. When a timeout occurs, the ORB will raise a CORBA::TIMEOUT system exception. The client can then take whatever action is necessary to handle the failure. If a reply eventually arrives after the timeout period has expired, it will be discarded by the client ORB.

The Relative Roundtrip Timeout policy, and other Quality of Service policies defined as part of the CORBA Messaging specification, are described in more detail in the OCI TAO Developer's Guide, Chapter 8.3, available from http://www.theaceorb.com/. See also http://www.cs.wustl.edu/~schmidt/PDF/C++-report-col19.pdf.



Q:

What IDL compiler options help reduce the footprint?

A:

Footprint Reduction in Generated Code

IDL Compiler Command Line Options

-Sa Suppresses generation of Any insertion/extraction operators, and generates certain portable interceptor operations that use Anys as dummies
-St Suppresses type code generation. Since Anys depend on type codes, this options also does what -Sa does.
-Gt Generate optimized typecodes. All the string names in a type code except the repository id will be null with this option. This optimization is allowed by the, CORBA spec, but it may cause problems when trying to determine type code equivalence.
-Sc Suppresses tie class generation.
-Sp Suppresses the generation of thru-POA collocated stub code.
-Sd Suppresses the generation of direct collocated stub code. Direct collocation stub code generation is disabled by default, but the option is included for completeness.
-Sv Suppresses code generation for valuetypes. Code generation for valuetypes is disabled by default, but the option is included for completeness.

C++ Compiler Options

If both TAO and the application are compiled with TAO_HAS_INTERCEPTORS defined to be 0 (either by passing to the C++ compiler or by redefining the macro in ACE_ROOT/TAO/tao/orbconf.h) not only will the TAO library be smaller, but also the application object code, since the C++ preprocessor will skip the generated interceptor classes and parts of the code generated for each IDL operation.



Q:

How can I reduce my compile time during development?

A:

Reducing compile time during development:

Disable Optimization:

When developing software that uses ACE+TAO you can reduce the time it takes to compile your software by not enabling you compiler's optimizer flags. These often take the form -O.

Disabling optimization for your application will come at the cost of run time performance, so you should normally only do this during development, keeping your test and release build optimized.


Disable Inlining :

When compiler optimization is disabled, it is frequently the case that no inlining will be performed. In this case the ACE inlining will be adding to your compile time without any appreciable benefit. You can therefore decrease compile times further by build building your application with the -DACE_NO_INLINE C++ flag.

In order for code built with -DACE_NO_INLINE to link, you will need to be using a version of ACE+TAO built with the "inline=0" make flag.

In order to accommodate both inline and non-inline builds of your application it will be necessary to build two copies of your ACE+TAO libraries, one with inlining and one without. You can then use your ACE_ROOT and TAO_ROOT variables to point at the appropriate installation.




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?

A:

One common way to build ACE and TAO (once you have your configuration set up) is to simply run "make" in the $ACE_ROOT directory, then run "make" again in the $TAO_ROOT directory. However, running "make" from $ACE_ROOT not only builds the ACE library, it also builds all of the examples, tests, and other things you may not need. Likewise, running "make" from $TAO_ROOT builds not only the TAO and orbsvcs libraries, it also builds all the TAO and orbsvcs tests and examples.

To build only what you need to develop applications with ACE and TAO (and to save LOTS of disk space while building) you can run make in only the following directories:

  $ACE_ROOT/ace
  $ACE_ROOT/apps/gperf/src
  $TAO_ROOT/TAO_IDL
  $ACE_ROOT/ACEXML
  $TAO_ROOT/tao
  $ACE_ROOT/protocols
  $TAO_ROOT/orbsvcs/orbsvcs

This will build only the ACE library, gperf executable (needed by the IDL compiler), tao_idl executable, ACEXML library, protocol libraries (extensions of the ACE framework), TAO libraries, and orbsvcs libraries.

If you want to also build any of the orbsvcs executables (e.g., $TAO_ROOT/orbsvcs/Naming_Service), add their directories to the set of directories that you build. For example:

  cd $TAO_ROOT/orbsvcs/Naming_Service
  make

You may also find the "nslist" and "catior" utilities very useful, so you probably should also add these directories to the list of directories in which to build:

  $TAO_ROOT/utils/nslist
  $TAO_ROOT/utils/catior

Of course, you can always go back and build individual tests and examples if you want to.


Q:

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

A:

See 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? for a possible solution.




Q:

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

A:

You can add an ACE_HAS_MFC conditional #define to your ace/config.h file.
It is only necessary to use ACE_HAS_MFC if you wish threads created and managed by ACE to be able to make MFC calls. The ACE_HAS_MFC setting causes ACE to use CWinThread worker thread objects for all threads. ACE will still manage these threads just the same as threads created by _beginthreadex(). The only difference is the extra thread-local data stored in the threads. Refer to the many articles on MSDN for when to use AfxBeginThread vs _beginthread, and which MFC functions require CWinThreads. There are quite a few subtle problems. For instance, you typically can't use an MFC wrapper object created in one thread in another. (By wrapper object, I mean those that wrap windows handles. CDC, CWnd, ...) (The typical solution is to pass the handles betweeen threads.) --- In summary, if you find that you really do need to make MFC calls from ACE threads then use the MFC build of the ACE library, however it is typically not necessary because the layer of software using ACE/TAO is often separated from the layer using MFC.


Q:

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

A:

Yes, Christopher Kohlhoff (ch...@kohlhoff.com) has developed these and made them available at http://www.tenermerx.com/programming/corba/tao_bcb/using/index.html .



Windows-based platforms


Q:

Can I build ACE and TAO on Windows 95 or Windows 98?

A:

ACE and TAO should build with Visual C++ on Windows 95/98. However, there are several differences between these operating systems and Windows NT 4.0 that must be accommodated.

To make sure ACE and TAO (really, it is ACE we are concerned with here) build correctly on Windows 95/98, you have to turn off compilation of certain Windows NT specific features. To do so, insert the following line into %ACE_ROOT%\ace\config.h:

  #define ACE_HAS_WINNT4 0

The above line should be inserted just above the line that reads:

  #include "ace/config-win32.h"

See also Can I use IP multicast for service discovery in Windows 95 or Windows 98?


Q:

Does OCI's version of TAO contain MFC libraries?

A:

MFC Libraries are libraries built with the ACE_HAS_MFC variable defined. See What issues are involved when using MFC with ACE/TAO? for more details of what this means.

The OCI-produced binary installation kits do not contain MFC libraries for Windows platforms. You will need to recompile ACE and TAO in order to build them with MFC libraries.




Q:

Can I use IP multicast for service discovery in Windows 95 or Windows 98?

A:

By default, older versions of TAO use IP multicast to discover services such as the Naming Service or Trading Service. For example, when you call
  CORBA::Object_var obj =
    orb->resolve_initial_references("NameService");
an IP multicast request may be sent. If a Naming Service is running and receives the request, it will reply with the IOR of its root naming context.

IP multicast for service discovery is enabled by default on most platforms that support it, such as most UNIX operating systems and Windows NT. To enable it on Windows 95 or Windows 98, however, you must have Winsock2 and you must add the following line to ACE_wrappers\ace\config.h when you build ACE:

  #define ACE_HAS_WINSOCK2 1
So, your entire config.h might look like this:
  #define ACE_HAS_WINNT4 0
  #define ACE_HAS_WINSOCK2 1
  #include "ace/config-win32.h"



Q:

Has anybody gotten TAO (and ACE) to compile using Borland CBuilder 4?

A:

[Thoughtfully provided by Charles Frasch cfr...@spawar.navy.mil.]

A good source for how to build ACE and TAO using Borland CBuilder is http://www.tenermerx.com/tao_bcb/index.html. I just followed the steps under the "Building TAO" link with the following changes:
1A. Set ACE_ROOT to the directory in which the source kit was unpacked:

        set ACE_ROOT=c:\ACE_wrappers
3A. Make sure the CBuilder 4 binaries are in your path, e.g.
        set PATH=%PATH%;d:\PROGRA~1\CBUILD~1\Bin

The one-button tests are not built by default. To build and run them do the following:

1. Set ACE_ROOT to the directory in which the source kit was unpacked:

        set ACE_ROOT=c:\ACE_wrappers

2. Make sure the CBuilder 4 binaries are in your path, e.g.

        set PATH=%PATH%;d:\PROGRA~1\CBUILD~1\Bin

3. Change to the ACE tests source directory:

        cd C:\ACE_wrappers\tests

4. Build the one-button tests:

        make -f Makefile.bor

5. If you built ACE as a dynamic link library you must put it in your path, e.g.

        set PATH=%PATH%;%ACE_ROOT%\bin\Dynamic\Release

6. Run the tests. The results go in %temp%\log.

        run_tests bor
You can run a particular test by naming it as the second argument, e.g.
        run_tests bor Atomic_Op_Tests

I will be sending in a change to the makefile that will allow you to just

        make -f Makefile.bor tests 

I had these problems with the one-button tests:

1. The ACE_Init_Test one-button test isn't compiled. I will be changing the makefile and running this test. If successful, I will submit a problem report.

2. The Upgradable_RW_Test one-button test runs without failure on my ThinkPad but produces a floating point exception on my Gateway.

3. The run_tests.bat file should properly set the dll path based on the supplied build configuration. If I can get this to work I will submit a problem report. This would obviate step 5 above.

I built the TAO/tests/CDR test following the general scheme above. I had to run it manually since I don't have perl on my PC (yet). Judging by the returned errorlevels the test ran correctly. The CDR test is the only one that is built, and the only one that has a BCB4 makefile. If I have the time I will add some more of the tests.

I have not tried any combinations of DEBUG/STATIC/PASCAL other than the defaults, nor have I (yet) tried to use the BCB4 IDE to build an application. This will be the next step.
Just got the following note from Chris Kohloff ( ch...@kohlhoff.com):

Just saw the new faq "Has anybody gotten TAO (and ACE) to compile using Borland CBuilder 4?", and all I have to say is "Oops!" :) I added the info from the missing steps 1A and 3A into my page at http://www.tenermerx.com/tao_bcb, so you can probably remove them from the faq item.
[I've left them in for now.]
I haven't added information about building the tests (yet), but I'd like to suggest a few small corrections to what you have: - ACE_Init_Test uses MFC so won't be supported with BCB4 anyway. - The TAO/tests/CDR test was the only test as of TAO 1.0. There are more tests running (but not all) with the recent betas.



Q:

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

A:

If you're linking debug versions of an executable or DLL and have unresolved symbols, there are several possible reasons:
  1. Is your library path correct?
    (Check Tools|Options|Directories|Libraries or your project settings.)
  2. Are you linking in the ACE, TAO, and possibly orbsvcs libraries?
    (Check Build|Settings|Link)
  3. Are you linking with the right library names?
    If you are building your application against a Debug configuration of ACE+TAO, the names of the libraries will have the letter "d" in them (e.g., aced.lib, TAOd.lib , CosNamingd.lib). If you are using a Release configuration of ACE+TAO, the "d" will not be present in the library names.
  4. Have you installed or built the Debug configuration of ACE+TAO?
    If you have only installed the non-Debug version of TAO, you will not be able to build Debug executables. To check this, do one of the following:
    1. Build the Release configuration of the executable; or
    2. Remove _DEBUG from the list of preprocessor definitions.
    If the build succeeds, then you probably have a non-Debug version of TAO.



Q:

How do I export generated classes from DLL's

A:

According to the TAO Developer's Guide, version 1.1a section 7.12 "Back End Options", the way to export generated classes is thus:
  1. first, create an export header file using the perl script %ACE_ROOT%\bin\generate_export_file.pl. :
    generate_export_file.pl Foo > FooExport.h
    (Note 1, if you do not have perl installed, go to www.perl.org. Note 2, if you are using a very old version of TAO, prior to 1.1a, the batch file GenExportH.bat is used instead)
  2. use the -Wb,export_macro and -Wb,export_include options to the TAO_IDL compiler to include the macros in the generated class declarations:
    tao_idl -Wb,export_macro=Foo_Export -Wb,export_include=FooExport.h
  3. in the project settings, C/C++ tab, preprocessor options, include FOO_BUILD_DLL in the list of definitions.



Q:

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

A:

At least on Windows NT, there's a bug in which the TTL (Time-to-Live) field in multicast IP packets is set to zero. Thus, nobody pays attention to those packets. This particular problem bit OCI in their training lab environment, and for this reason we now use the Naming Service without multicasting as documented in Section 20.2.4 of the Dev Guide (see How do I locate the naming service server without multicast?).

The problem is documented in http://support.microsoft.com/support/kb/articles/Q234/9/80.ASP. Although the notes say to get the latest Service Pack, our experience shows that this doesn't help as of Service Pack 6.


Q:

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

A:

Select the Project -> Settings menu item
Select the C/C++ tab.
Set the Category to Code Generation
Under Run-time library select one of the multithreaded libraries




Q:

Why do I get errors while using 'TryEnterCriticalSection'?

A:

The Visual C++ compiler may report an error like this when using 'TryEnterCriticalSection':
C:\projects\bluebox\thom\ace/OS.i(2384) : error C2039:
'TryEnterCriticalSection': is not a member of '`global namespace''
C:\projects\bluebox\thom\ace/OS.i(2384) : error C2065: 'TryEnterCriticalSection': undeclared identifier

You may get this error because 'TryEnterCriticalSection' is only available on Windows NT and Windows 2000. There are two ways to fix this problem:

  • By far, the easiest way to solve this problem is to simply #include the ACE header files before anything else.
  • You can get the compiler to recognize 'TryEnterCriticalSection' by defining the macro _WIN32_WINNT=0x0400. This can be done by adding the parameter -D_WIN32_WINNT=0x0400 to a command line build or by adding the definition to the Visual C++ project settings.



Q:

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

A:

Either inherit the environment (via ProcessInfo) or set the SystemRoot environment variable to c:\WinNT or the appropriate place for windows install.

Q:

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

A:

Change the active configuration:
From the "Build" pull down menu choose "Set Active Configuration...". In the Configuration popup choose the appropriate (Debug or Release) MFC configuration.

Batch build:
Go to the Build pull-down in MSC++ and select the Batch Build option. When the batch build window pops up select the ACE MFC build option and deselect all the other options. This will build the acemfc.lib for you. Using batch build option you can build all the flavors of the various ACE and TAO libraries you need.



Q:

How do I instantiate a singleton from a DLL?

A:

Singletons in DLLs on Windows
If you want to instantiate a singleton in a DLL on Windows, follow these steps:
  1. Use generate_export_file.pl (found in ACE_wrappers/bin) to generate the proper Win32 export directives for your dll. For example, "perl generate_export_file.pl MyLib >MyLib_Export.h" generates the following output in the file "MyLib_Export.h":
    
    
      // -*- C++ -*-
      // generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
      // Definition for Win32 Export directives.
      // This file is generated automatically by generate_export_file.pl
      // ------------------------------
      #ifndef MYLIB_EXPORT_H
      #define MYLIB_EXPORT_H
    
      #include "ace/config-all.h"
    
      #if !defined (MYLIB_HAS_DLL)
      #  define MYLIB_HAS_DLL 1
      #endif /* ! MYLIB_HAS_DLL */
    
      #if defined (MYLIB_HAS_DLL) && (MYLIB_HAS_DLL == 1)
      #  if defined (MYLIB_BUILD_DLL)
      #    define MyLib_Export ACE_Proper_Export_Flag
      #    define MYLIB_SINGLETON_DECLARATION(T) \
                    ACE_EXPORT_SINGLETON_DECLARATION (T)
      #    define MYLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \
                    ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
      #  else /* MYLIB_BUILD_DLL */
      #    define MyLib_Export ACE_Proper_Import_Flag
      #    define MYLIB_SINGLETON_DECLARATION(T) \
                    ACE_IMPORT_SINGLETON_DECLARATION (T)
      #    define MYLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \
                    ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
      #  endif /* MYLIB_BUILD_DLL */
      #else /* MYLIB_HAS_DLL == 1 */
      #  define MyLib_Export
      #  define MYLIB_SINGLETON_DECLARATION(T)
      #  define MYLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
      #endif /* MYLIB_HAS_DLL == 1 */
    
      #endif /* MYLIB_EXPORT_H */
    
      // End of auto generated file.
    
  2. When declaring your singleton, make sure and use the right export directive that you generated for your dll. For instance, if you create a class that is meant to be a singleton in MyLib.dll, you'd typically do this:
    
      class MyLib_Export MyClass
      {
      };
    
      typedef ACE_Singleton<MyClass, ACE_Null_Mutex> MY_CLASS_SINGLETON;
      MYLIB_SINGLETON_DECLARE(ACE_Singleton, MyClass, ACE_Null_Mutex);
    


Q:

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

A:

On Windows, if one spawns a thread with, for example _beginthreadex, and makes CORBA calls from that thread, TAO will leak memory. TAO uses TSS (thread specific storage) for handling requests along the output data paths. With Win32 threads, the underlying type system does not invoke destructors on TSS and the application will leak memory. To get around this problem, please use ACE threads wherever possible. Thanks to < alexande...@gmx.net> for supplying this FAQ!


VxWorks


Q:

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

A:

See How can I minimize the sizes of the ACE and TAO libraries? for a more general discussion of TAO program/library sizes.

This all depends upon your definition of "huge" and how you built the libraries. If you consider a few megabytes to be huge and you've built optimized, nodebug, and minimum CORBA, then that's the way life is currently.

If, on the other hand, you're looking at the size of the files and you built the defaults, then the first thing you need to do is understand that the size of the file is NOT the same as the size of the code. When compiling with debug information, the compiler adds symbol information to the libraries, and that symbol information is massive. What you need to do is look at the code size. Using the WindRiver GNU toolchain, you can use sizeppc to do this, e.g.,

  $ sizeppc libACE.so
  text    data    bss     dec     hex     filename
  626392  65036   1316    692744  a9208   libACE.so

  $ ls -l libACE.so
  -rwxrwxr-x   1 cleeland distcomp 31181587 Mar 16 10:10 libACE.so*
So, you can see that the file size is 30Mb, but the code size is 692k. Quite a different number.

There are various strategies for making the libraries smaller, and all involve rebuilding. Specifically, you can build:

  • nodebug (debug=0) which will eliminate symbols and debugging messages
  • minimumCORBA, which will only compile functionality specified by the Minimum CORBA specification
  • ACE only for TAO, which will only compile the portions of ACE required by TAO

An often-used technique for keeping library sizes small and still debuggable is to build the entire library nondebug, then only build the pieces you need to debug with debug on. This allows you to debug those pieces, but not suffer through the problems that large file sizes in libraries cause ( e.g., longer download/boot times).
Here is a shortcut to rebuilding a lib with debug=0. But:
  1. It doesn't remove debugging statements.
  2. You have to be careful to not remove relocation symbols on VxWorks, so that you can load the lib. For example, use something like stripppc --strip-unneeded, or strip386 --strip-debug
  3. stripppc is broken on Tornado 2, NT host. It won't let you create the output file, so it's not of any use.


Q:

How do I create shared libraries?

A:

Shared libraries on VxWorks aren't really shared libraries. If you ever worked on Unix in the days before shared libraries, you might remember "relocatable object files", i.e., object files created by the linker with many of their symbols resolved, but also permitted to have unresolved symbols.

When you see libACE.so on VxWorks, they're simply relocatable object files. Once you realize that, and all it entails, your life will get easier :-)

Some implications of this are:

  • You should not use "-lACE" when linking libTAO.so, then try to load both libACE.so and libTAO.so. This will lead to duplicate symbols because the creation of libTAO.so will resolve all the ACE symbols. Thus, when you load libTAO.so after having loaded libACE.so, you will, effectively, load all the symbols in libACE.so again (they're in libTAO.so, too).
  • Similar to the previous point, you should not link libACE.so or libTAO.so into your application.
A command line to create a shared library on VxWorks might look like:
  $ make shared_libs_only=1 ACE_SHLIBS=
The ACE_SHLIBS make macro usually contains the names of shared libraries to link in, such as "-lTAO -lACE", etc. By making it empty, these do not get linked.



TAO and Java


Q:

Is there a Java version of TAO?

A:

Yes, and no. It's called Zen.

Check out What is ZEN?.

Note that you can use any CORBA compliant ORB with TAO. The most popular Java-based ORB used with TAO is JacORB. See What is JacORB? for more details.



Q:

Does TAO support a Java binding?

A:

TAO is a C++ ORB. Any other CORBA compliant ORB can interoperate with TAO (as well as other CORBA compliant ORBs). There are several free Java ORBs available, such as JacORB. For more information on TAO and JacORB, see What is JacORB?.

Work on a real-time Java ORB, ZEN, is currently in progress. For more information, see What is ZEN? or http://www.zen.uci.edu/ .




Q:

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

A:

Yes, but there is an issue with Codesets supported by Sun's Java 1.3 ORB.

Sun's Java 1.3 ORB does not support character sets UTF-8 and UTF-16. To use Sun's Java 1.3 ORB with TAO, you must disable the generation of optional standard profile components in IORs generated by TAO. To do so, use the following ORB initialization option with TAO servers that generate IORs that will be used by Java 1.3 ORB clients:

    -ORBStdProfileComponents 0

Thanks to Gordana and Kate Matic gord...@ot.co.nz for posing the original question and Carlos O'Ryan cor...@uci.edu for providing the answer.


Q:

Is TAO interoperable with JacORB?

A:

Yes, TAO is interoperable with JacORB.

TAO and JacORB have been tested using TAO 1.1a, JacORB 1.3.X, JacORB 1.2.3, and Java JDK 1.3. Some tests have also been performed using TAO 1.0a, JacORB 1.0.3, and Java JDK 1.1.8.




Q:

How can I use TAO with Java's tnameserv?

A:

Using tnameserv as the naming service implementation.

[From material originally posted to tao-users by Carlos O'Ryan.]
Suppose that you have a CORBA application written with TAO, and you want to use the Java naming service implementation (tnameserv):

  $ tnameserv -ORBInitialPort 1050 &;

In order for your CORBA application to use this naming service instance, you need to somehow get the IOR for the instance (exercise left to the reader). Once you get it, you can provide it to your TAO-based CORBA application using the -ORBInitRef NameService=... command line option. For example, if you have the IOR as a string, you can use:

  $ app -ORBInitRef NameService=IOR:....
Similarly, if the IOR is in a text file, you can use:
  $ app -ORBInitRef NameService=file://path/to/file.txt

Finally, if you were so lucky for your version of tnameserv to implement the Interoperable Naming Service specification (doubtful at the moment), you could use:

  $ app -ORBInitRef NameService=corbaloc:iiop:host:port/NameService

In older versions of TAO (before 1.1.10) this option takes the following form:
  $ app -ORBInitRef NameService=iioploc://host:port/NameService



Q:

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

A:

When I use the TAO name service, JavaORB returns an org.omg.CORBA.INV_OBJREF in resolve_initial_references("NameService").

There's a file called NS_Resolve.java in

    $TAO_ROOT/examples/Simulator/DOVEBrowser
that contains code which discovers TAO's Naming Service via the multicast discovery mechanism. Hooking that into the initial references table is ORB-specific, however.

Alternately, you can bypass the TAO Naming Service's multicast mechanism and connect your Java application to it directly. For an example which uses TAO and JacORB, see How do I use JacORB with TAO's Naming Service?




Q:

What is ZEN?

A:

ZEN is a real-time Java ORB being developed by the Distributed Object Computing groups at the University of California, Irvine and Washington University in St. Louis.

ZEN is currently under development. For more information, see http://www.zen.uci.edu/.

A ZEN mailing list is available. To subscribe, see http://doc.ece.uci.edu/cgi-bin/mailman/listinfo/zen-users.





TAO and JacORB


Q:

What is JacORB?

A:

JacORB is an open source Java ORB that is most often used with TAO. To learn more visit the home page or OCI's JacORB Support Page .

Q:

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

A:

Java uses a properties file called "orb.properties" to determine which ORB to use. If the Java runtime doesn't find an orb.properties file, it uses the JDK's ORB.

JacORB's orb.properties file is located in the top-level JacORB directory. Copy JacORB's orb.properties file into the Java JDK's ${java.home}/lib directory to enable JacORB. If you're not sure which directory this is, compile and run the following Java program:

  public class InstallHelper
    {           
       public static void main( String[] args )
       {
           System.out.print("orb.properties should be copied to ");
           System.out.print( System.getProperty("java.home") );
           System.out.print( System.getProperty("file.separator")
                             + "lib" );
       }
    }

A sure sign that the Java runtime is not using JacORB is that an exception is thrown, and the stack trace contains methods with the prefix "com.sun.corba".


An alternative way to specify which ORB to use is to specify it directly to the Java runtime.

Instead of the orb.properties file in the lib directory you can just pass the following to the virtual machine:

JacORB 1.3.11 or earlier:

  -Dorg.omg.CORBA.ORBClass=jacorb.orb.ORB
  -Dorg.omg.CORBA.ORBSingletonClass=jacorb.orb.ORBSingleton

JacORB 1.3.21 or later:

  -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB
  -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton

For example:

  java -classpath %CLASSPATH%;C:\Java\JacORB1_3_21\lib\jacorb.jar
     -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB 
     -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton 
     com.ociweb.appname.Main

A second alternative way to specify which ORB to use is to specify it directly in your code when you initialize the ORB.

Instead of copying the orb.properties file in the ${java.home}/lib directory, put the following in your main program:

JacORB 1.3.11 or earlier:

  java.util.Properties props = new java.util.Properties();
  props.put( "org.omg.CORBA.ORBClass", 
             "jacorb.orb.ORB" );
  props.put( "org.omg.CORBA.ORBSingletonClass", 
             "jacorb.orb.ORBSingleton" );
  org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, props );

JacORB 1.3.21 or later:

  java.util.Properties props = new java.util.Properties();
  props.put( "org.omg.CORBA.ORBClass", 
             "org.jacorb.orb.ORB" );
  props.put( "org.omg.CORBA.ORBSingletonClass",
             "org.jacorb.orb.ORBSingleton" );
  org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, props );



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?

A:

Check to see that Interface Repository Ids generated by TAO and JacORB for each interface are the same.
For example, suppose you have an IDL file called "Bank.idl", with an IDL interface called "Bank".
TAO generates a file called BankC.cpp; in that file, in the Bank class, there is an "_interface_repository_id" function. That function should return a string that looks something like this:
    "IDL:Bank:
1.0"
JacORB generates a Java file called BankHelper.java. In that file, in the BankHelper class is an "id" function. It also returns a string, and that string must match TAO's _interface_repository_id string exactly:
    "IDL:Bank:1.0"
Incidentally, both TAO and JacORB's IDL compiler support the #pragma prefix directive in IDL files.



Q:

Does JacORB support the "iioploc" object reference format?

A:

No, JacORB (as well as versions of TAO 1.1.10 and later) uses the "corbaloc" object reference format. See How do I use a "corbaloc" object reference with a TAO server? for more information about using "corbaloc" object references between JacORB (or any client) and TAO servers.




Q:

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

A:

JacORB applications can use TAO's Naming Service. Applications implemented with Java JDK 1.2 or later require a workaround to avoid using Sun's org.omg.CosNaming stubs, which are buggy. We'll use the -Xbootclasspath/p runtime option to eliminate that problem, as described below.

The steps for using TAO's Naming Service from JacORB clients are as follows:

  1. Start TAO's Naming Service, specifying a well-known endpoint
    $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service \
      -ORBEndpoint iiop://myhost:9999
    
    
  2. Write your JacORB Naming Service clients as you normally would, using orb.resolve_initial_references("NameService") to find the Naming Service.
      import org.omg.CORBA.ORB;
      import org.omg.CosNaming.*;
      import org.omg.CosNaming.NamingContextPackage.*;
    
      public class NSTest {
        public static void main(String args[]) {
          try{
            ORB orb = ORB.init(args, null);
            
            org.omg.CORBA.Object o = 
              orb.resolve_initial_references( "NameService" );
            NamingContext rootNC = NamingContextHelper.narrow( o );
    
            // ...etc...
    
          } catch ( Exception e ) {
            System.err.println("ERROR : " + e) ;
            e.printStackTrace( System.err );
          }
        }
      }
    
  3. Run your Java application using the -ORBInitRef command-line option to tell JacORB where to find the Naming Service. If the Java application is implemented using Java JDK 1.2 or later, then the -Xbootclasspath/p option will be needed to use JacORB's CosNaming stubs instead of the Sun's.

For the sake of our example, assume JacORB is installed in /usr/don/JacORB-1_2_3.

  Java 1.2 or later:

    java -Xbootclasspath/p:/usr/don/JacORB-1_2_3/lib/jacorb.jar
         -DORBInitRef.NameService=corbaloc:iiop:myhost:9999/NameService
         NSTest

  Java 1.1:
    java -DORBInitRef.NameService=corbaloc:iiop:myhost:9999/NameService
         NSTest

Note that the host and port -- "myhost" and "9999" -- in these object references match the host and port passed into the TAO Naming Service's "-ORBEndpoint" argument.

You can also use JacORB's jacorb.properties file to set the Naming Service IOR:

    #
    # jacorb.properties
    #
    ORBInitRef.NameService=corbaloc:iiop:myhost:9999/NameService
And then run the client and server without the -DORBInitRef:
  Java 1.2 or later:

    java -Xbootclasspath/p:/usr/don/JacORB-1_2_3/lib/jacorb.jar NSTest


  Java 1.1:
    java NSTest



Q:

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

A:

In JacORB 1.3.21, the prefix for all JacORB packages has been changed from "jacorb" to "org.jacorb".

The solution is to edit your orb.properties file to change this:

    org.omg.CORBA.ORBClass=jacorb.orb.ORB
    org.omg.CORBA.ORBSingletonClass=jacorb.orb.ORBSingleton

to this:

    org.omg.CORBA.ORBClass=org.jacorb.orb.ORB
    org.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton

Also, you must edit any script or build.xml file that refers to a JacORB class directly.



Q:

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

A:

You can inform JacORB which Ethernet adapter to use by specifing it in the jacorb.properties file (it could also be passed in on the command line). Just set the OAIAddr property to the IP address that you want JacORB to use. For example, on my Windows98 machine which has a DSL modem, JacORB was using the adapter Ethernet address 5.0.0.4 instead of the true public IP address. I modified OAIAddr property and everything worked fine. BTW you can see what address JacORB is attempting to connect to by setting jacorb.verbosity to 2.
For example:
  java -Djacorb.verbosity=2 -DOAIAddr=12.345.67.89 Client



Q:

JacORB-only Naming Service example

A:

A JacORB-only Naming Service example. A JacORB client uses the Naming Service to find its target object. Please see the README and the PDF file in the attached .tgz file (Windows users can use WinZip to open it).
jacorb-ns-example.tgz (3.8 K)
ns-example-presentation.pdf (259.6 K)


Reply all
Reply to author
Forward
0 new messages