okibun0129 发表于 2009-3-2 16:11:47

关于ServiceConfigurator的使用问题

对于ACE目录下的$(ACE_ROOT)ACE_wrappers\examples\Service_Configurator\IPC-tests\server的服务器的例子。
配置文件为svc.conf,使用其中的动态服务
dynamic Remote_Brdcast Service_Object * ./IPC_Tests_Server:remote_broadcast "-p 10001"
然后提示动态链接库IPC_Tests_Server.dll无法打开,因此动态服务无法被加载。
首先我确保被调用的DLL与exe文件在同一目录下,麻烦老大帮分析一下,下面附堆栈信息与日志输出信息。
函数调用的堆栈信息:DLL文件是成功打开了,但是最终调用包装的系统函数ACE_OS::dlopen确失败了。
最终返回的handle为0._errno 返回 0x00a91ec8 int *,lookup找不到相关错误描述信息。

> ACEd.dll!ACE_OS::dlopen(const char * fname=0x00aa9950, int mode=0)行123 C++
ACEd.dll!ACE_DLL_Handle::open(const char * dll_name=0x00aa8508, int open_mode=0, HINSTANCE__ * handle=0x00000000)行234 C++
ACEd.dll!ACE_DLL_Manager::open_dll(const char * dll_name=0x00aa8508, int open_mode=0, HINSTANCE__ * handle=0x00000000)行581 + 0x14 字节 C++
ACEd.dll!ACE_DLL::open_i(const char * dll_filename=0x00aa8320, int open_mode=0, bool close_handle_on_destruction=true, HINSTANCE__ * handle=0x00000000)行167 + 0x25 字节 C++
ACEd.dll!ACE_DLL::open(const char * dll_filename=0x00aa8320, int open_mode=0, bool close_handle_on_destruction=true)行128 C++
ACEd.dll!ACE_Location_Node::open_dll(int & yyerrno=0)行468 + 0x18 字节 C++
ACEd.dll!ACE_Object_Node::symbol(ACE_Service_Gestalt * __formal=0x00a995a8, int & yyerrno=0, ACE_Service_Gestalt * __formal=0x00a995a8)行522 + 0xc 字节 C++
ACEd.dll!ACE_Service_Type_Factory::make_service_type(ACE_Service_Gestalt * cfg=0x00a995a8)行869 + 0x29 字节 C++
ACEd.dll!ACE_Service_Gestalt::initialize(const ACE_Service_Type_Factory * stf=0x00aa8370, const char * parameters=0x00aa84c0)行579 + 0xc 字节 C++
ACEd.dll!ACE_Dynamic_Node::apply(ACE_Service_Gestalt * config=0x00a995a8, int & yyerrno=0)行316 + 0x1d 字节 C++
ACEd.dll!ace_yyparse(void * ace_svc_conf_parameter=0x0012fcb0)行1442 + 0x27 字节 C++
ACEd.dll!ACE_Service_Gestalt::process_directives_i(ACE_Svc_Conf_Param * param=0x0012fcb0)行827 + 0x9 字节 C++
ACEd.dll!ACE_Service_Gestalt::process_file(const char * file=0x00a9b8b0)行926 + 0xf 字节 C++
ACEd.dll!ACE_Service_Gestalt::process_directives(bool ignore_default_svc_conf_file=false)行1223 + 0x11 字节 C++
ACEd.dll!ACE_Service_Gestalt::open_i(const char * __formal=0x00a9bb14, const char * __formal=0x00a9bb14, bool ignore_static_svcs=false, bool ignore_default_svc_conf_file=false, bool ignore_debug_flag=false)行1067 + 0xc 字节 C++
ACEd.dll!ACE_Service_Gestalt::open(int argc=2, char * * argv=0x00a9bb08, const char * logger_key=0x0040674c, bool ignore_static_svcs=false, bool ignore_default_svc_conf=false, bool ignore_debug_flag=false)行51 C++
ACEd.dll!ACE_Service_Config::open(int argc=2, char * * argv=0x00a9bb08, const char * logger_key=0x0040674c, bool ignore_static_svcs=false, bool ignore_default_svc_conf=false, bool ignore_debug_flag=false)行60 C++
server_test.exe!ace_main_i(int argc=2, char * * argv=0x00a9bb08)行20 + 0x1b 字节 C++

输出的日志信息:
beginning reconfiguration at Mon Mar 02 15:35:02 2009
ACE (3748|2172) STDG::<ctor>, repo=00A987A8, name=.\svc.conf - begining at
ACE (3748|2172) SG::process_directives_i, repo=00A987A8 - <from file>
ACE (3748|2172) SCG:<ctor=0012FCB8> - config=00A98700 repo=00A987A8 superceded b
y repo=00A987A8
ACE (3748|2172) SG::initialize - () repo=00A987A8, looking up static service 'AC
E_Service_Manager' to initialize
ACE (3748|2172) Static_Node::apply - Did static on ACE_Service_Manager (yyerrno=
0)
ACE (3748|2172) SG::initialize - repo=00A987A8, name=Remote_Brdcast - looking up
in the repo
ACE (3748|2172) STDG::<ctor>, repo=00A987A8, name=Remote_Brdcast - begining at [
2]
ACE (3748|2172) LN::open_dll - path=./IPC_Tests_Server
ACE (3748|2172) DLL_Handle::open ("./IPC_Tests_Server", 0x0) -> failed: 操作成功
完成。
ACE (3748|2172) DLL_Handle::open ('./IPC_Tests_Server') failed, errno=126: 操作
成功完成。
ACE (3748|2172) DLL_Handle::open ("./IPC_Tests_Server"): Invalid handle error:
操作成功完成。
ACE_DLL_Manager::open_dll: Could not open dll ./IPC_Tests_Server.
ACE (3748|2172) DLL_Handle::close - ./IPC_Tests_Server (handle=0, refcount=0)
ACE (3748|2172) LN::open_dll - Failed to open ./IPC_Tests_Server: 操作成功完成。

ACE (3748|2172) Unable to create service object for Remote_Brdcast
ACE (3748|2172) STDG::<dtor> - Failed (-1) to find Remote_Brdcast -> 00000000
ACE (3748|2172) Dynamic_Node::apply - Did dynamic on Remote_Brdcast (yyerrno=1)
ACE (3748|2172) SCG:<dtor=0012FCB8> - new repo=00A987A8
ACE (3748|2172) STDG::<dtor> - Failed (-1) to find .\svc.conf -> 00000000

winston 发表于 2009-3-3 16:42:16

单步跟踪一下比较理想。DLL load成功,决定因素有好几个呢。比如是否有依赖的DLL文件,dllmain中是否有什么操作等。
页: [1]
查看完整版本: 关于ServiceConfigurator的使用问题