Commit 7454a2de authored by Pavel Vainerman's avatar Pavel Vainerman

Убрал лишние логи. Добавил принудительную инициализация CORBA-ссылок.

Исправил ошибку в указании имени.
parent 88d63c0f
...@@ -1707,7 +1707,7 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout ...@@ -1707,7 +1707,7 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
// { // {
if( unideb.debugging(Debug::WARN) ) if( unideb.debugging(Debug::WARN) )
{ {
unideb[Debug::WARN] << "не найден IOR-файл для " << uconf->oind->getNameById(rid,node) << endl; unideb[Debug::WARN] << "not found IOR-file for " << uconf->oind->getNameById(rid,node) << endl;
} }
throw UniSetTypes::ResolveNameError(); throw UniSetTypes::ResolveNameError();
// } // }
...@@ -1720,7 +1720,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout ...@@ -1720,7 +1720,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
if( node!=uconf->getLocalNode() ) if( node!=uconf->getLocalNode() )
{ {
cout << "******** Resolve REMOTE NODE ***" << endl;
// Получаем доступ к NameService на данном узле // Получаем доступ к NameService на данном узле
ostringstream s; ostringstream s;
s << uconf << oind->getRealNodeName(node); s << uconf << oind->getRealNodeName(node);
...@@ -1758,7 +1757,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout ...@@ -1758,7 +1757,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
} }
else else
{ {
cout << "******** Resolve LOCAL NODE ***" << endl;
if( CORBA::is_nil(localctx) ) if( CORBA::is_nil(localctx) )
{ {
ostringstream s; ostringstream s;
...@@ -1776,8 +1774,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout ...@@ -1776,8 +1774,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
ctx = localctx; ctx = localctx;
} }
ctx = localctx;
cout << "***resolve oname=" << oind->getNameById(rid,node).c_str() << endl;
CosNaming::Name_var oname = omniURI::stringToName( oind->getNameById(rid,node).c_str() ); CosNaming::Name_var oname = omniURI::stringToName( oind->getNameById(rid,node).c_str() );
for (unsigned int i=0; i<uconf->getRepeatCount(); i++) for (unsigned int i=0; i<uconf->getRepeatCount(); i++)
{ {
...@@ -1848,7 +1844,7 @@ void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId no ...@@ -1848,7 +1844,7 @@ void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId no
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
throw ORepFailed("UI(send): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId"); throw ORepFailed("UI(send): ERROR: id=UniSetTypes::DefaultObjectId");
try try
{ {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <string> #include <string>
#include <omniORB4/internal/initRefs.h>
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h" #include "Exceptions.h"
...@@ -335,13 +336,20 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -335,13 +336,20 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
string name(oind->getRealNodeName(it->id)); string name(oind->getRealNodeName(it->id));
ostringstream param; ostringstream param;
param << this << name << "=corbaname::" << it->host << ":" << it->port; param << this << name;
name = param.str();
param << "=corbaname::" << it->host << ":" << it->port;
new_argv[i+1] = strdup(param.str().c_str()); new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl; unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl;
i+=2; i+=2;
ostringstream uri;
uri << "corbaname::" << it->host << ":" << it->port;
if( !omni::omniInitialReferences::setFromArgs(name.c_str(), uri.str().c_str()) )
cerr << "**********************!!!! FAILED ADD name=" << name << " uri=" << uri.str() << endl;
assert( i < _argc ); assert( i < _argc );
} }
...@@ -369,6 +377,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -369,6 +377,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
new_argv[i+1] = strdup(param.str().c_str()); new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl; unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl;
{
ostringstream ns_name;
ns_name << this << "NameService";
ostringstream uri;
uri << "corbaname::" << getProp(nsnode,"host") << ":" << defPort;
if( !omni::omniInitialReferences::setFromArgs(ns_name.str().c_str(), uri.str().c_str()) )
cerr << "**********************!!!! FAILED ADD name=" <<ns_name << " uri=" << uri.str() << endl;
}
} }
_argv = new_argv; _argv = new_argv;
......
...@@ -10,13 +10,13 @@ int main( int argc, const char **argv ) ...@@ -10,13 +10,13 @@ int main( int argc, const char **argv )
try try
{ {
UniSetTypes::Configuration* myconf = new UniSetTypes::Configuration(argc,argv,"test.xml"); UniSetTypes::Configuration* myconf = new UniSetTypes::Configuration(argc,argv,"test.xml");
// UniversalInterface* ui = new UniversalInterface(myconf); UniversalInterface* ui = new UniversalInterface(myconf);
//cout << "************************ myconf=" << myconf << " conf=" << UniSetTypes::conf << endl;
UniSetTypes::Configuration* myconf2 = new UniSetTypes::Configuration(argc,argv,"conf21300.xml"); UniSetTypes::Configuration* myconf2 = new UniSetTypes::Configuration(argc,argv,"conf21300.xml");
UniversalInterface* ui2 = new UniversalInterface(myconf2); UniversalInterface* ui2 = new UniversalInterface(myconf2);
cout << "************************ " << ui2->getValue(200033) << endl; cout << "************************ conf1: " << ui->getValue(1) << endl;
cout << "************************ conf2: " << ui2->getValue(200033) << endl;
#if 0 #if 0
uniset_init(argc,argv,"test.xml"); uniset_init(argc,argv,"test.xml");
......
...@@ -4,5 +4,6 @@ SID=$1 ...@@ -4,5 +4,6 @@ SID=$1
[ -z "$SID" ] && SID=1 [ -z "$SID" ] && SID=1
uniset-start.sh -f ./ui --confile test.xml --sid $SID --unideb-add-levels any -ORBtraceLevel 20 uniset-start.sh -f ./ui --confile test.xml --sid $SID --unideb-add-levels any
# -ORBtraceLevel 20
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment