Environment Issue with Standalone Client

lislej's picture

I have a Windows client that utilizes a Dll I wrote to access Axis2/c. I have been attempting to minimize the number of Axis2/c Dlls required to distribute with the client as well as get rid of the AXIS2C_HOME environment variable.

I can run the client w/o issue if I have the AXIS2C_HOME environment variable defined.

I can not run the client otherwise.

In looking at the trace log (Fig 1) I have reached a point where I don't think it is possible to do this without the AXIS2C_HOME variable being defined. I have included a couple lines from my log file. It would appear that there is relative pathing going on from the point of execution which apparently is causing problems for the Windows API function LoadLibraryExA when using LOAD_WITH_ALTERED_SEARCH_PATH (Fig 2). The Windows docs say this (Fig 3). 

Any help in pointing me to a way of not defining the AXIS2C_HOME variable would be appreciated

Thanks,

Jim Lisle

 

[Mon Mar 23 12:04:16 2009] [debug] ..\..\src\core\deployment\dep_engine.c(1306) axis2_dep_engine_load_module_dll: DLL path is : ./modules/addressing/axis2_mod_addr.dll
[Mon Mar 23 12:04:16 2009] [error] ..\..\util\src\class_loader.c(167) Loading shared library ./modules/addressing/axis2_mod_addr.dll  Failed. DLERROR IS DLL Load Error 127: The specified procedure could not be found.

Fig 1 - Snipet from trace log


 

LoadLibraryExA("./modules/addressing/axis2_mod_addr.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified procedure could not be found (127).

Fig 2 - Snipet from dependency walker output

 

 

HMODULE WINAPI LoadLibraryEx(
  __in        LPCTSTR lpFileName,
  __reserved  HANDLE hFile,
  __in        DWORD dwFlags
);

Fig 3 - Snipet from MSDN for LoadLibraryEx

 

If this value is used (LOAD_WITH_ALTERED_SEARCH_PATH) and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed in the Remarks section to find associated executable modules that the specified module causes to be loaded. If this value is used and lpFileName specifies a relative path, the behavior is undefined.

 

http://msdn.microsoft.com/en-us/library/ms684179(VS.85).aspx


 

nandika's picture

Re

One easy way for you to get this done is to use obtain the absolute path of your client directory and pass it as the AXIS2C_HOME. Then put the repository relative to your client directory. Regards Nandika
lislej's picture

RE:Environment Issue with Standalone Client

Yes. I set the path to the directory containing the Axis2 Dlls and have the Windows client pass in the location of the AXIS2C_HOME or set it to a default. Works great. Thank you. -Jim
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)