Axis2 fails to load DLL

梦想与她 提交于 2019-12-06 06:48:51

问题


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.

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);

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

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

../lib/axis2_http_sender.dll

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

I did try few code samples.

Below is a piece of C code:

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

The above code worked fine for me.


回答1:


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

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

listdlls axis2_apache_server.exe

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.)

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

I ran the axis2_apache_server.exe and voila !!

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

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.

Hard learned moral though!!



来源:https://stackoverflow.com/questions/33706609/axis2-fails-to-load-dll

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!