# EncoderException failed to write outbound message

**URL:** <https://community.neo4j.com/t/encoderexception-failed-to-write-outbound-message/42883>\
**Category:** Drivers & Stacks\
**Tags:** apoc, cypher, java-driver\
**Created:** [August 14, 2021, 12:13am UTC](https://community.neo4j.com/t/encoderexception-failed-to-write-outbound-message/42883 "2021-08-14T00:13:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![foxtrotkpop](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/foxtrotkpop/32/4432_2.png) [@foxtrotkpop](https://community.neo4j.com/u/foxtrotkpop)\
**Post date:** [August 14, 2021, 12:13am UTC](https://community.neo4j.com/t/encoderexception-failed-to-write-outbound-message/42883/1 "2021-08-14T00:13:20Z")

</div>

Hello,

I'm using the Java neo4j driver, and I'm trying to call the apoc.refactor.mergeNodes function, but I keep running into this error:

org.neo4j.driver.internal.shaded.io.netty.handler.codec.EncoderException: Failed to write outbound message: RUN "CALL apoc.refactor.mergeNodes($nodes, {properties: 'discard', mergeRels:true}) YIELD node RETURN count(\*)

The param I'm passing in is a List\<Value\>: {nodes=[[node\<#########\>, node\<#########\>, node\<#########\>], [...], [...], ...]}

Any tips on what I'm doing wrong?

Currently trying to debug:

@Override  
public Integer execute(Transaction tx) {  
List results = tx.run(cypher, parameters("nodes", params)).list();  
System.out.println("Results " + results.get(0));  
return 1;  
}

Currently running this alongside liquibase, so it's kinda hard to debug compiled jar file

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [August 19, 2021, 9:27pm UTC](https://community.neo4j.com/t/encoderexception-failed-to-write-outbound-message/42883/2 "2021-08-19T21:27:31Z")

</div>

You cannot send nodes as parameters, you need to send their id's or business keys and look them up again.
