Bug 602 - TAO_Internal::default_svc_conf_entries() does not work
Summary: TAO_Internal::default_svc_conf_entries() does not work
Status: VERIFIED
Alias: None
Product: TAO
Classification: Unclassified
Component: ORB (show other bugs)
Version: 1.1
Hardware: x86 Windows 2000
: P3 normal
Assignee: DOC Center Support List (internal)
URL:
Depends on:
Blocks:
 
Reported: 2000-06-29 09:54 CDT by Roger Tragin
Modified: 2000-07-24 11:16 CDT (History)
1 user (show)

See Also:


Attachments
shows problem when run like this "test -n" (1.85 KB, text/plain)
2000-07-11 14:28 CDT, Roger Tragin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Tragin 2000-06-29 09:54:49 CDT
Trying to configure server to use the "Multiple threads, single ORB, thread-pool model" using TAO_Internal::default_svc_conf_entries()

The following code

static string taoResourceFacArgs	= "static Resource_Factory \"-ORBReactorType tp\"";
static string taoSrvStrategyFac	= "static Server_Strategy_Factory \"-ORBConcurrency reactive\"";

TAO_Internal::default_svc_conf_entries(taoResourceFacArgs, taoSrvStrategyFac, 0);
TAO_Internal::open_services(argc, argv, 1);
// ORB initialization
orb = CORBA::ORB_init(argc, argv,"xxx");

will always give me a select reactor (which is the default) instead of a tp reactor.
Comment 1 Nanbor Wang 2000-06-29 17:55:58 CDT
This appears to be working for me. (I am of course using the latest version.)
Can you provide a small example showing the problem?  
Comment 2 Michael Kircher 2000-06-30 07:30:49 CDT
I am having the same problem, debugging I see that 
TAO_Default_Resource_Factory::init (int argc, char **argv) is never called, so 
where else should the arguments be read out. I have the current version of the 
repository (date 30. June).
Comment 3 Nanbor Wang 2000-06-30 14:17:20 CDT
Again.  A small example that shows the problem would be very helpful.
It appears to work for me and TAO_Default_Resource_Factory::init did get
invoked in my test.  
Comment 4 levine 2000-07-08 07:51:09 CDT
Reassigned to tao-support
Comment 5 levine 2000-07-08 07:53:00 CDT
Accepted by TAO support.  Small example, please?
Comment 6 Roger Tragin 2000-07-11 14:13:36 CDT
The problem was a combination of calling TAO_Internal::open_services(...) 
and passing command line arguments (containing the letter 'n') to my executable.

Calling TAO_Internal::open_services(...) will call 
ACE_Service_Config::parse_args(...) which will parse the command line arguments, 
find an 'n' in there and will do this "ACE_Service_Config::no_static_svcs_ = 1;"

This means there will be no Resource_Factory loaded, so "Resource_Factory 
-ORBReactorType tp" will be ignored, and TAO will default to a select reactor.

Solution:  Don't call TAO_Internal::open_services(argc, argv, 1);  Why was I 
calling it in the first place??
Comment 7 levine 2000-07-11 14:23:43 CDT
Michael, I'm not sure how that relates to your problem?
Comment 8 Roger Tragin 2000-07-11 14:28:05 CDT
Created attachment 46 [details]
shows problem when run like this "test -n"
Comment 9 Michael Kircher 2000-07-12 00:31:22 CDT
In my use case I load the ORB dynamically (see time-date example) and supply the 
arguments in the svc.conf file. Here things get complicated because of the 
service configurator, which should not be reentered.
Shall look into the details ASAP.
Comment 10 Michael Kircher 2000-07-14 10:44:38 CDT
The test case is the $TAO_ROOT/examples/Simple/time-date example. Use the 
following line in the svc.conf:
dynamic ORB Service_Object * ./Time_Date:_make_DLL_ORB() "dummy 
-ORBSkipServiceConfigOpen -ORBSvcConfDirective "static Resource_Factory 
'-ORBReactor TP'""
to select the TP reactor instead of the default select reactor.
With or without the "ORBSkipServiceConfigOpen" the select reactor will still be 
chosen.
You can test for this be setting a break-point in default_resource.cpp 
"TAO_Default_Resource_Factory::allocate_reactor_impl (void)" and see what kind 
of reactor is instantiated.
Comment 11 Nanbor Wang 2000-07-18 23:08:02 CDT
This seems to be working fine for me.  Michael, if you still have
problem getting your app to work, can you please create a new
bug and send us a sample program that demonstrates your problem
so we can help?  Thanks.
Comment 12 Michael Kircher 2000-07-24 11:16:56 CDT
Correct, this is not a bug. I was able to fix my problem by using a second 
directive in the svc.conf file.
Thanks to Bruce McIntosh who pointed out the following:

>We use the following in our configuration file with our dynamic ORB....
>
>dynamic Resource_Factory Service_Object *
>TAOd:_make_TAO_Default_Resource_Factory()  "-ORBReactor TP"
>dynamic Server_Strategy_Factory Service_Object *
>TAOd:_make_TAO_Default_Server_Strategy_Factory()
>"-ORBAllowReactivationOfSystemids 0"
>dynamic ORB Service_Object * safsvcsd:_make_ORB() "-ORBDebug -ORBDebugLevel
>99 -ORBCollocationStrategy direct -ORBSkipServiceConfigOpen "
>
>I have not had any success getting the "static" directives to work (as yet!
>)