summaryrefslogtreecommitdiff
path: root/CIAO
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-04-07 21:06:30 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-04-07 21:06:30 +0000
commite2eda789e6f95915f5b8397a189b8882b77bd3be (patch)
tree1596b3c1330ac02f110c902ceca5119ed61a3a89 /CIAO
parentecdbf2cb4008320bbaf13dfe815f2414648bffba (diff)
downloadATCD-e2eda789e6f95915f5b8397a189b8882b77bd3be.tar.gz
Thu Apr 7 21:04:51 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
* ciao/Base/CIAO_Base.mpc: * ciao/Base/CIAO_Exceptions.idl: * ciao/Containers/Container_Base_T.cpp: * ciao/Containers/Session/Session_Container.cpp: * ciao/Deployment/Handlers/Component_Handler.cpp: * ciao/Deployment/Handlers/Home_Handler.cpp: Vastly improved error reporting for component loading problems. Plain CCM exceptions are no longer reported to DAnCE, and additional meta-data is now included that will report the exact source of library loading problems.
Diffstat (limited to 'CIAO')
-rw-r--r--CIAO/ChangeLog14
-rw-r--r--CIAO/ciao/Base/CIAO_Base.mpc5
-rw-r--r--CIAO/ciao/Base/CIAO_Exceptions.idl17
-rw-r--r--CIAO/ciao/Containers/Container_Base_T.cpp69
-rw-r--r--CIAO/ciao/Containers/Session/Session_Container.cpp100
-rw-r--r--CIAO/ciao/Deployment/Handlers/Component_Handler.cpp10
-rw-r--r--CIAO/ciao/Deployment/Handlers/Home_Handler.cpp10
7 files changed, 155 insertions, 70 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index 7b0b9d7d425..b4ee1006c01 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,3 +1,17 @@
+Thu Apr 7 21:04:51 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * ciao/Base/CIAO_Base.mpc:
+ * ciao/Base/CIAO_Exceptions.idl:
+ * ciao/Containers/Container_Base_T.cpp:
+ * ciao/Containers/Session/Session_Container.cpp:
+ * ciao/Deployment/Handlers/Component_Handler.cpp:
+ * ciao/Deployment/Handlers/Home_Handler.cpp:
+
+ Vastly improved error reporting for component loading problems.
+ Plain CCM exceptions are no longer reported to DAnCE, and
+ additional meta-data is now included that will report the exact
+ source of library loading problems.
+
Thu Apr 7 21:03:27 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
* ciao/Logger/Logger_Service.h:
diff --git a/CIAO/ciao/Base/CIAO_Base.mpc b/CIAO/ciao/Base/CIAO_Base.mpc
index 58aa9332a60..581e172d591 100644
--- a/CIAO/ciao/Base/CIAO_Base.mpc
+++ b/CIAO/ciao/Base/CIAO_Base.mpc
@@ -11,6 +11,10 @@ project(CIAO_Base_IDL) : install, ciaoidldefaults, anytypecode {
idlflags += -Gxhst
}
+ IDL_Files {
+ CIAO_Exceptions.idl
+ }
+
specific {
install_dir = ciao/Base
}
@@ -26,6 +30,7 @@ project(CIAO_Base_stub) : install, ciaolib_with_idl, ciao_output, \
}
Source_Files {
CIAO_PropertiesC.cpp
+ CIAO_ExceptionsC.cpp
Server_init.cpp
Client_init.cpp
}
diff --git a/CIAO/ciao/Base/CIAO_Exceptions.idl b/CIAO/ciao/Base/CIAO_Exceptions.idl
new file mode 100644
index 00000000000..ab96a26cb7d
--- /dev/null
+++ b/CIAO/ciao/Base/CIAO_Exceptions.idl
@@ -0,0 +1,17 @@
+// $Id$
+
+/**
+ * @file CIAO_Exceptions.idl
+ * @author William R. Otte <wotte@dre.vanderbilt.edu>
+ *
+ * Exceptions used by the CIAO Container.
+ */
+
+module CIAO
+{
+ exception Installation_Failure
+ {
+ string name;
+ string reason;
+ };
+};
diff --git a/CIAO/ciao/Containers/Container_Base_T.cpp b/CIAO/ciao/Containers/Container_Base_T.cpp
index 65f2b028b9e..b3fc50d465b 100644
--- a/CIAO/ciao/Containers/Container_Base_T.cpp
+++ b/CIAO/ciao/Containers/Container_Base_T.cpp
@@ -7,6 +7,9 @@
#include "tao/Utils/PolicyList_Destroyer.h"
#include "ciao/Containers/Servant_Activator.h"
#include "ciao/Servants/Connector_Servant_Impl_Base.h"
+#include "ciao/Base/CIAO_ExceptionsC.h"
+
+#include <sstream>
namespace CIAO
{
@@ -172,73 +175,82 @@ namespace CIAO
if (!primary_artifact)
{
+ std::ostringstream err;
+ err << "Component [" << name << "] has a nil component executor DLL name." ;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR: Null component executor DLL name\n",
- entity));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::UnknownImplId ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
if (!servant_artifact)
{
+ std::ostringstream err;
+ err << "Component [" << name << "] has a nil component servant DLL name." ;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR: Null component servant DLL name\n",
- entity));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::UnknownImplId ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
if (!entry_point)
{
+ std::ostringstream err;
+ err << "Component [" << name << "] has a nil executor entrypoint." ;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR: Null entry point for "
- "executor DLL [%C]\n",
- entity,
- primary_artifact));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
if (!servant_entrypoint)
{
+ std::ostringstream err;
+ err << "Component [" << name << "] has a nil servant entrypoint." ;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR: Null entry point for "
- "servant DLL [%C]\n",
- entity,
- servant_artifact));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
if (executor_dll.open (ACE_TEXT_CHAR_TO_TCHAR (primary_artifact),
ACE_DEFAULT_SHLIB_MODE,
false) != 0)
{
+ std::ostringstream err;
const ACE_TCHAR* error = executor_dll.error ();
+ err << "Unable to open executor DLL for component [" << name
+ << "]: " << error;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR in opening the executor "
- "DLL [%C] with error [%s]\n",
- entity,
- primary_artifact,
- error));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::UnknownImplId ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
else
{
@@ -255,19 +267,20 @@ namespace CIAO
ACE_DEFAULT_SHLIB_MODE,
false) != 0)
{
+ std::ostringstream err;
const ACE_TCHAR* error = servant_dll.error ();
+ err << "Unable to open servant DLL for component [" << name
+ << "]: " << error;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Container_i::prepare_installation <%C> - "
- "ERROR in opening the servant "
- "DLL [%C] with error [%s]\n",
- entity,
- servant_artifact,
- error));
+ "ERROR: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::UnknownImplId ();
+ throw CIAO::Installation_Failure (name, err.str ().c_str ());
}
else
{
diff --git a/CIAO/ciao/Containers/Session/Session_Container.cpp b/CIAO/ciao/Containers/Session/Session_Container.cpp
index 7a23c4bda4d..e1de3175fff 100644
--- a/CIAO/ciao/Containers/Session/Session_Container.cpp
+++ b/CIAO/ciao/Containers/Session/Session_Container.cpp
@@ -4,14 +4,14 @@
#include "ciao/Servants/Servant_Impl_Base.h"
#include "ciao/Logger/Log_Macros.h"
+#include "ciao/Base/CIAO_ExceptionsC.h"
namespace CIAO
{
///////////////////////////////////////////////////////////////
- Session_Container_i::Session_Container_i (
- CORBA::ORB_ptr o,
- PortableServer::POA_ptr poa)
+ Session_Container_i::Session_Container_i (CORBA::ORB_ptr o,
+ PortableServer::POA_ptr poa)
: Container_i < ::CIAO::Session_Container> (o, poa)
{
}
@@ -69,32 +69,38 @@ namespace CIAO
tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr_servant);
HomeServantFactory screator = reinterpret_cast<HomeServantFactory> (tmp_ptr);
- if (!hcreator)
+ if (hcreator == 0)
{
+ std::ostringstream err;
+ err << "Home executor factory function [" << entry_point << "] invalid in DLL ["
+ << primary_artifact;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Session_Container_i::install_home "
- "- Error: Entry point [%C] "
- "invalid in dll [%C]\n",
- entry_point,
- primary_artifact));
+ "- Error: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name,
+ err.str ().c_str ());
}
- if (!screator)
+ if (screator == 0)
{
+ std::ostringstream err;
+ err << "Home servant factory function [" << servant_entrypoint << "] invalid in DLL ["
+ << servant_artifact;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
- "Session_Container_i::install_home"
- " - Error: Entry point [%C] "
- "invalid in dll [%C]\n",
- servant_entrypoint,
- servant_artifact));
+ "Session_Container_i::install_home "
+ "- Error: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name,
+ err.str ().c_str ());
}
CIAO_DEBUG (9,
@@ -113,7 +119,8 @@ namespace CIAO
"Session_Container_i::install_home - "
"Home executor factory failed.\n"));
- throw Components::Deployment::InstallationFailure ();
+ throw CIAO::Installation_Failure (name,
+ "Home executor factory function failed\n");
}
CIAO_DEBUG (9,
@@ -127,13 +134,14 @@ namespace CIAO
if (home_servant == 0)
{
- CIAO_ERROR (1,
- (LM_ERROR,
- CLINFO
- "Session_Container_i::install_home - "
- "Home servant factory failed.\n"));
+ CIAO_ERROR (1,
+ (LM_ERROR,
+ CLINFO
+ "Session_Container_i::install_home - "
+ "Home servant factory failed.\n"));
- throw Components::Deployment::InstallationFailure ();
+ throw CIAO::Installation_Failure (name,
+ "Home servant factory function failed\n");
}
PortableServer::ServantBase_var safe (home_servant);
@@ -195,30 +203,36 @@ namespace CIAO
if (ccreator == 0)
{
+ std::ostringstream err;
+ err << "Entry point [" << entry_point << "] invalid in DLL ["
+ << primary_artifact;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Session_Container_i::install_component "
- "- Error: Entry point [%C] "
- "invalid in dll [%C]\n",
- entry_point,
- primary_artifact));
+ "- Error: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name,
+ err.str ().c_str ());
}
if (screator == 0)
{
+ std::ostringstream err;
+ err << "Entry point [" << servant_entrypoint << "] invalid in DLL ["
+ << servant_artifact;
+
CIAO_ERROR (1,
(LM_ERROR,
CLINFO
"Session_Container_i::install_component "
- "- Error: Entry point [%C] "
- "invalid in dll [%C]\n",
- servant_entrypoint,
- servant_artifact));
+ "- Error: %C\n",
+ err.str ().c_str ()));
- throw Components::Deployment::ImplEntryPointNotFound ();
+ throw CIAO::Installation_Failure (name,
+ err.str ().c_str ());
}
CIAO_DEBUG (9,
@@ -238,7 +252,8 @@ namespace CIAO
"Session_Container_i::install_component - "
"Component executor factory failed.\n"));
- throw Components::Deployment::InstallationFailure ();
+ throw CIAO::Installation_Failure (name,
+ "Component executor factory failed");
}
CIAO_DEBUG (9,
@@ -254,13 +269,14 @@ namespace CIAO
if (component_servant == 0)
{
- CIAO_ERROR (1,
- (LM_ERROR,
- CLINFO
- "Session_Container_i::install_component - "
- "Component servant factory failed.\n"));
+ CIAO_ERROR (1,
+ (LM_ERROR,
+ CLINFO
+ "Session_Container_i::install_component - "
+ "Component servant factory failed.\n"));
- throw Components::Deployment::InstallationFailure ();
+ throw CIAO::Installation_Failure (name,
+ "Componet servant factory failed");
}
PortableServer::ServantBase_var safe (component_servant);
@@ -282,8 +298,8 @@ namespace CIAO
Components::CCMObject::_narrow (objref.in ());
CIAO_DEBUG (9, (LM_TRACE, CLINFO
- "Session_Container_i::install_component - "
- "Component successfully created\n"));
+ "Session_Container_i::install_component - "
+ "Component successfully created\n"));
return componentref._retn ();
}
diff --git a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
index 9538abf7ddb..1da6e2b9f23 100644
--- a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
+++ b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
@@ -3,6 +3,7 @@
#include "Component_Handler.h"
#include "ciao/Logger/Log_Macros.h"
#include "ciao/Base/CIAO_PropertiesC.h"
+#include "ciao/Base/CIAO_ExceptionsC.h"
#include "ciao/Containers/Container_BaseC.h"
#include "ccm/CCM_ObjectC.h"
#include "CIAO_State.h"
@@ -201,6 +202,15 @@ namespace CIAO
container->set_attributes (comp_ref.in (),
attr_config);
}
+ catch (::CIAO::Installation_Failure &ex)
+ {
+ CIAO_ERROR (1, (LM_ERROR, CLINFO
+ "Component_Handler::install_instance - "
+ "Caught Installation_Failure exception: %C:%C\n",
+ ex.name.in (), ex.reason.in ()));
+ throw ::Deployment::StartError (ex.name.in (),
+ ex.reason.in ());
+ }
catch (const ::CORBA::Exception &ex)
{
CIAO_ERROR (1, (LM_ERROR, CLINFO
diff --git a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp
index cc06e80320d..12801778c2b 100644
--- a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp
+++ b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp
@@ -3,6 +3,7 @@
#include "Home_Handler.h"
#include "ciao/Logger/Log_Macros.h"
#include "ciao/Base/CIAO_PropertiesC.h"
+#include "ciao/Base/CIAO_ExceptionsC.h"
#include "ciao/Containers/Container_BaseC.h"
#include "CIAO_State.h"
@@ -198,6 +199,15 @@ namespace CIAO
container->set_attributes (home_ref.in (), attr_config);
}
+ catch (::CIAO::Installation_Failure &ex)
+ {
+ CIAO_ERROR (1, (LM_ERROR, CLINFO
+ "Home_Handler::install_instance - "
+ "Caught Installation_Failure exception: %C:%C\n",
+ ex.name.in (), ex.reason.in ()));
+ throw ::Deployment::StartError (ex.name.in (),
+ ex.reason.in ());
+ }
catch (::CORBA::Exception &ex)
{
CIAO_ERROR (1, (LM_ERROR, CLINFO