Axis2无法加载DLL [英] Axis2 fails to load DLL

查看:136
本文介绍了Axis2无法加载DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Apache-Axis2日志文件中遇到了以下一行.

I came across the below line in the Apache-Axis2 log file.

[Sat Nov 14 12:16:08 2015] [error] ..\..\util\src\class_loader.c(167) Loading shared library ..//lib/axis2_http_sender.dll  Failed. DLERROR IS DLL Load Error 126: The specified module could not be found.

分析从第156行到第167行的class_loader.c文件,如下所示:

On analyzing the class_loader.c file from line#156 to line#167 as given below:

dll_name = axutil_dll_desc_get_name(dll_desc, env);
    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Shared library to be loaded is %s",dll_name);
    dl_handler = AXIS2_PLATFORM_LOADLIB(dll_name);
    if (!dl_handler)
    {        
#ifndef WIN32
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Loading shared library %s  Failed. DLERROR IS %s", 
            dll_name, AXIS2_PLATFORM_LOADLIB_ERROR);
#else
        axis2_char_t buff[AXUTIL_WIN32_ERROR_BUFSIZE];
        axutil_win32_get_last_error(buff, AXUTIL_WIN32_ERROR_BUFSIZE);
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Loading shared library %s  Failed. DLERROR IS %s",dll_name, buff);

我想问题出在第一行-dll_name = axutil_dll_desc_get_name(dll_desc, env);. dll_name中存储的值为..//lib/axis2_http_sender.dll.尽管axis2_http_sender.dll存在 在相对于可执行文件的lib目录中,链接器无法连接到它.

I guess the problem is in the very first line - dll_name = axutil_dll_desc_get_name(dll_desc, env);. The value stored in dll_name is ..//lib/axis2_http_sender.dll. Though the axis2_http_sender.dll is present in the lib directory which is relative to the executable, the linker fails to connect to it.

我从未见过如下文件名语法:

I have never seen file name syntax like below:

..//lib/axis2_http_sender.dll

我在 Windows命令行中对其进行了测试,其工作方式类似于:

I tested it in Windows Command line and it worked like :

../lib/axis2_http_sender.dll

C 中使用连续的/意味着什么? 像fopen()这样的功能?

What are the implication of using consecutive /s in a C function like fopen()?

我确实尝试了一些代码示例.

I did try few code samples.

下面是一段 C 代码:

FILE *fp;
fopen_s(&fp,"C://tempfile.txt", "w");
fputs("Text content", fp);
fclose(fp);

上面的代码对我来说很好.

The above code worked fine for me.

推荐答案

终于破解了这个.
这篇 CSDN 博客文章建议Axis2C Windows发行版取决于OpenSSL DLL.

Cracked this one finally.
This CSDN blog post suggested that Axis2C Windows distribution depends on OpenSSL DLLs.

我使用以下命令列出了axis2_apache_server.exe的dll依赖项.

I listed the dll dependencies of axis2_apache_server.exe using the following command.

listdlls axis2_apache_server.exe

和列表显示,需要两个ssl dll libeay32ssleay32来运行它.但是,Axis2二进制分发中缺少这两个dll.

(我不知道为什么&我认为应该将其包括在内.此外,Axis2文档中没有提及这一点.)

and the list showed that the two ssl dlls libeay32 and ssleay32 are required to run it. However, these two dlls were missing from the Axis2 Binary Distribution.

(I don't know why & I think it should have been included. Moreover there is no mention of this in Axis2 documentation.)

上述dll在Apache2OpenSSL安装中都可用,我将这些dll的路径添加到了我的PATH变量中.

The above dlls are available in either Apache2 or OpenSSL installs the I added the path to these dlls to my PATH variable.

我运行了axis2_apache_server.exe和瞧!!

I ran the axis2_apache_server.exe and voila !!

结论:文件路径中的连续/根本不影响链接.

Conclusion:Consecutive /s in the file path doesn't affect the linking at all.

道德:应该首先检查exe文件的dll依赖关系,并确保在遇到dll加载错误时确保所有dll都存在.

Moral: One should check the dll dependencies of an exe file first and make sure that all the dlls are present when he ran into a dll load error.

虽然很难学道德!!

这篇关于Axis2无法加载DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆