Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Machholz
Contributor II
Contributor II

Unable to Create a User Defined Function in Replicate

Hello all, 

I have followed the documentation, read the README in the /addons folder, and compiled the sample UDF 'My Transformation' successfully. But the Qlik service is unable to load, and I am thinking it is because there is an error either in the addons_def.json file or something within the .dll. I am unable to figure it out and would appreciate any help.

Here is my addons_def.json:

Machholz_0-1718636155824.png

 

I have already tried using an absolute path as well, but that did not work. Any help is appreciated.

Thanks 

Qlik Replicate

Labels (1)
11 Replies
john_wang
Support
Support

Hello @Machholz ,

Thanks for reaching out to Qlik Community!

Looks to me the addons_def.json is correct, would you please confirm:

1- the .dll file location is "samples\\MyTransformation\\MyTransformation.dll", and the service was restarted

2- the "unable to load" is error message or just a warning? In my labs, I got warning in Qlik Replicate 2023.11 however the function works fine indeed, the screen shot :

john_wang_0-1718640546869.png

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Machholz
Contributor II
Contributor II
Author

Hey @john_wang,

Yes that is the path where the .dll is located, but the service itself did not start.

I tested something where I commented out the path of the dll in the addons_def.json, and the service started and the UDF did not appear as expected. I suspect that it is unable to load the .dll due to the type 'STARTUP' but I am not too sure.

Thanks.

Heinvandenheuvel
Specialist III
Specialist III

From the Readme:

>> Copy the shared library to <installation_dir>\addons\<addon_name>\<addon_name>.[dll/so]

That's the proper, default place. You can indeed provide an explicit location like the 1- the .dll file location is "samples\\MyTransformation\\MyTransformation.dll", but I do not like that as much myself.

 

Now what about "MyPasswordProvider". It is listed in your addons_def.json. 

WHY? Did you built that? I suspect not. If you didn't then be sure to remove that whole section otherwise Replicate will go out to  <installation_dir>\addons\MyPasswordProvider\MyPasswordProvider.[dll/so]   and of course fail to find it

Hein.

Machholz
Contributor II
Contributor II
Author

Sorry for the confusion, by accident I uploaded the wrong screen shot. I did have the "MyPasswordProvider" deleted in the json. 

Thanks

john_wang
Support
Support

Hello @Machholz ,

I'm not sure if DLL was compiled on the same Replicate server or not. If it's compiled on another machine please make sure the module was build in RELEASE mode rather than DEBUG mode (which  is the default option) as the DLL dependencies impact the DLL load.

We'd like help to verify DLL function if you can share it (removing the sensitive information and important logic codes and then re-compile it again).

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Machholz
Contributor II
Contributor II
Author

Hey @john_wang,
I have compiled it on a different machine, but I'm not sure what you mean by RELEASE or DEBUG mode? Is there a certain flag I should've used during compilation? Or does it have something to do with Replicate itself?

I have also attached the dll file I compiled originally.

Thanks.

 

john_wang
Support
Support

Hello @Machholz ,

Thanks for sharing the file, I'm going to have a test on it and get back to you shortly.

Regarding the RELEASE or DEBUG mode, it's a setting in Visual Studio. Let me find a sample for you. Please allow me some minutes.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
john_wang
Support
Support

Hello @Machholz ,

Please check Microsoft Doc Set debug and release configurations in Visual Studio

  • From the Build menu, select Configuration Manager, then select Debug or Release.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
john_wang
Support
Support

Hi @Machholz ,

The DLL does not work for me. "repcmd.log" show the error message like:

2024-06-19T23:18:30:235401 [ADDONS ]W: Failed to load add-on path <C:\Program Files\Attunity\Replicate\addons\samples\MyTransformation\MyTransformation.dll>, error: <%1 is not a valid Win32 application. > (at_addons_manager.c:251) 

Would you please confirm you compiled it to a 64-bit DLL ? and also please set to RELEASE mode then re-compile.

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!