Wso2 axis2_http_服务器无法加载服务库

Wso2 axis2_http_服务器无法加载服务库,wso2,axis2c,Wso2,Axis2c,我正在尝试让一个简单的hello world web服务工作。我使用WSDL2CPP从wsdl文件生成服务代码。这将生成并显示在的服务列表中 localhost:8080/axis2/services 现在,我创建了一个简单的客户端来访问该服务。当我尝试向web服务发出请求时,我在axis2.log中看到以下内容: [Tue Aug 27 09:50:31 2013] [debug] http_worker.c(186) Client HTTP version HTTP/1.1 [Tue Au

我正在尝试让一个简单的hello world web服务工作。我使用WSDL2CPP从wsdl文件生成服务代码。这将生成并显示在的服务列表中
localhost:8080/axis2/services

现在,我创建了一个简单的客户端来访问该服务。当我尝试向web服务发出请求时,我在axis2.log中看到以下内容:


[Tue Aug 27 09:50:31 2013] [debug] http_worker.c(186) Client HTTP version HTTP/1.1
[Tue Aug 27 09:50:31 2013] [debug] soap_builder.c(882) identified soap version is soap12
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler request_uri_based_dispatcher within the phase Transport
[Tue Aug 27 09:50:31 2013] [debug] req_uri_disp.c(97) Checking for service using target endpoint address : http://127.0.0.1:8080/axis2/services/Hello_Service
[Tue Aug 27 09:50:31 2013] [debug] req_uri_disp.c(117) Service found using target endpoint address
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler AddressingInHandler within the phase Transport
[Tue Aug 27 09:50:31 2013] [info]  Starting addressing in handler
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler addressing_based_dispatcher within the phase Transport
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler rest_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler soap_message_body_based_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] soap_body_disp.c(200) Checking for operation using SOAP messagebody's first child's local name : sayHello
[Tue Aug 27 09:50:31 2013] [debug] soap_body_disp.c(207) Operation found using SOAP message body's first child's local name
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler soap_action_based_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler dispatch_post_conditions_evaluator within the phase PostDispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler context_handler within the phase PostDispatch
[Tue Aug 27 09:50:31 2013] [error] class_loader.c(152) Loading shared library ..//services/Hello_Service/libHello_Service.so  Failed. DLERROR IS ..//services/Hello_Service/libHello_Service.so: undefined symbol: _ZN7wso2wsf11Environment6getEnvEv
[Tue Aug 27 09:50:31 2013] [error] wsf_cpp_msg_recv.cpp(185) IMPL object for service 'Hello_Service' not set in message receiver. 103 :: Failed in creating DLL
关注范围包括:


[Tue Aug 27 09:50:31 2013] [error] class_loader.c(152) Loading shared library ..//services/Hello_Service/libHello_Service.so  Failed. DLERROR IS ..//services/Hello_Service/libHello_Service.so: undefined symbol: _ZN7wso2wsf11Environment6getEnvEv

这看起来像是WSO C++代码和Axserver服务器C代码之间的名字。有什么想法吗?

可能是您忘了链接WSO2 WSF/C++本身


尝试重新编译您的服务,将
-lwso2\u wsf
添加到LDFLAGS中。

我正在使用:
g++-g-shared-olibHello\u service.so-I$WSFCPP\u HOME/include-I.-I$WSFCPP\u HOME/include/axis2-1.6.0-I$WSFCPP\u HOME/include/axis2-1.6.0/platforms-L$WSFCPP\u HOME/lib-util\laxis2\laxis2\u引擎-laxis2_解析器\-lpthread \-laxis2_http_发送方\-laxis2_http_接收方\-lguththila \-lws2_wsf\*.cpp
因此,我认为它构建正确。这很奇怪,因为服务器一开始加载服务很好。
c++filt\u ZN7wso2wsf11Environment6getEnvEv
给出了
wso2wsf::Environment::getEnv()
——它应该在
libwso2\u wsf.so
。尝试通过启动
nm/path/to/libwso2_wsf.so | grep(grep)zn7wso2wsf11environment6getenev
来检查它,并将结果写入此处。00017750 T(u zn7wso2wsf11environment6getenvewell,符号在那里,此库正在导出该符号(符号类型为“T”)。确保您从与服务链接相同的库开始。我的意思是可以有两个不同的库:一个在LD_LIBRARY_路径中(不包含该符号),另一个在
$WSFCPP_HOME/lib
中。还有一个好处是在链接服务时禁用未定义的符号:将
-Wl,--no undefined
添加到
LDFLAGS
以查看链接时缺少哪些符号。我现在认为我是个白痴,没有在运行服务器的shell中设置LD\u LIBRARY\u路径。掌心。我得再试一次monday@paul-奥格尔维:嗨,保罗,我找到了这个的复制品,所以把它合上了。请考虑这一更新。参见@ SJSAM。