Error in Registering UDF from Web Application

I’m trying to register UDF from web application & it gives following error message.

com.aerospike.client.AerospikeException: Registration failed: invalid_filename
File: null
Line: null
Message: null

Follwing is the UDF registering code snip,

RegisterTask task = aerospikeClient.register(null, "/home/myuser/Downloads/filter_example.lua", "filter_example.lua", Language.LUA);

Also, I have tried exactly the same code running on standalone application & it’s working as expected.

Can anyone help me to resolve this issue. Am I missing something?? Thanks in advance

Not sure if you are deploying from a war file? This thread might be relevant - 3.1.0 AerospikeClient.register in war does not work · Issue #26 · aerospike/aerospike-client-java · GitHub