# Aerospike Exception Error Code 4 Parameter Error when doing a put through java client

**URL:** <https://discuss.aerospike.com/t/aerospike-exception-error-code-4-parameter-error-when-doing-a-put-through-java-client/2321>\
**Category:** Java Client\
**Created:** [December 29, 2015, 10:24am UTC](https://discuss.aerospike.com/t/aerospike-exception-error-code-4-parameter-error-when-doing-a-put-through-java-client/2321 "2015-12-29T10:24:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frugalcoder](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@frugalcoder](https://discuss.aerospike.com/u/frugalcoder)\
**Post date:** [December 29, 2015, 10:24am UTC](https://discuss.aerospike.com/t/aerospike-exception-error-code-4-parameter-error-when-doing-a-put-through-java-client/2321/1 "2015-12-29T10:24:44Z")

</div>

I am processing an avro file with a list of records and doing a client.put for each record to my local Aerospike store.

For some reason, put for a certain number of records is succeeding and it’s not for the rest. I am doing this -

`client.put(writePolicy, recordKey, bins);`

The related values for the failed call are -

namespace = test

setname = test\_set

userkey = ADIDGoogle#372b5e24-a9f7-4da8-a737-715c43755ecb

write policy = null

**Bins** - is\_user,prof\_loc,rfm,store\_browsed,store\_purch,city\_id

Log Snippet

`com.aerospike.client.AerospikeException: Error Code 4: Parameter error at com.aerospike.client.command.WriteCommand.parseResult(WriteCommand.java:72) at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:56) at com.aerospike.client.AerospikeClient.put(AerospikeClient.java:338)`

What could possibly be the issue?

---

<div class="post-metadata">

**Author:** ![frugalcoder](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@frugalcoder](https://discuss.aerospike.com/u/frugalcoder)\
**Post date:** [December 30, 2015, 10:59am UTC](https://discuss.aerospike.com/t/aerospike-exception-error-code-4-parameter-error-when-doing-a-put-through-java-client/2321/2 "2015-12-30T10:59:53Z")

</div>

Finally. Resolved!

I was using the `REPLACE` RecordsExistsAction in this case. Any bin with `null` value will fail in this configuration. Aerospike treats a null value in a bin as equivalent to removing that bin value from the record for a key. Thus `REPLACE` configuration doesn’t make sense for such an operation, and hence a parameter error - Invalid DB operation.

`UPDATE` config on the other hand will work perfectly fine.
