Source:
<code>void writeMessage(final DataOutput output, final short invocationId, final EJBClientInvocationContext invocationContext) throws IOException { if (output == null) { throw new IllegalArgumentException("Cannot write to null output"); } final Method invokedMethod = invocationContext.getInvokedMethod(); final Object[] methodParams = invocationContext.getParameters(); output.writeByte(METHOD_INVOCATION_HEADER); output.writeShort(invocationId); output.writeUTF(invokedMethod.getName()); final Class<?>[] methodParamTypes = invokedMethod.getParameterTypes(); final StringBuilder methodSignature = new StringBuilder(); for (int i = 0; i < methodParamTypes.length; i++) { methodSignature.append(methodParamTypes[i].getName()); if (i != methodParamTypes.length - 1) { methodSignature.append(METHOD_PARAM_TYPE_SEPARATOR); } } output.writeUTF(methodSignature.toString()); final Marshaller marshaller = this.prepareForMarshalling(this.marshallerFactory, output); final EJBLocator locator = invocationContext.getLocator(); marshaller.writeObject(locator.getAppName()); marshaller.writeObject(locator.getModuleName()); marshaller.writeObject(locator.getDistinctName()); marshaller.writeObject(locator.getBeanName()); marshaller.writeObject(locator); if (methodParams != null && methodParams.length > 0) { for (final Object methodParam : methodParams) { try { marshaller.writeObject(methodParam); } catch (IOException e) { <START> throw new UnmarshalException(e.getMessage() + ", issue regarding unmarshalling of EJB parameters (possible Out of Memory issue).", e); <END> } } } this.writeAttachments(marshaller, invocationContext); marshaller.finish(); }</code><technical_language>This needs properly internationalized adding a method org.jboss.ejb.client.Logs a message ID code</technical_language>

Target:
void writeMessage(final DataOutput output, final short invocationId, final EJBClientInvocationContext invocationContext) throws IOException { if (output == null) { throw new IllegalArgumentException("Cannot write to null output"); } final Method invokedMethod = invocationContext.getInvokedMethod(); final Object[] methodParams = invocationContext.getParameters(); output.writeByte(METHOD_INVOCATION_HEADER); output.writeShort(invocationId); output.writeUTF(invokedMethod.getName()); final Class<?>[] methodParamTypes = invokedMethod.getParameterTypes(); final StringBuilder methodSignature = new StringBuilder(); for (int i = 0; i < methodParamTypes.length; i++) { methodSignature.append(methodParamTypes[i].getName()); if (i != methodParamTypes.length - 1) { methodSignature.append(METHOD_PARAM_TYPE_SEPARATOR); } } output.writeUTF(methodSignature.toString()); final Marshaller marshaller = this.prepareForMarshalling(this.marshallerFactory, output); final EJBLocator locator = invocationContext.getLocator(); marshaller.writeObject(locator.getAppName()); marshaller.writeObject(locator.getModuleName()); marshaller.writeObject(locator.getDistinctName()); marshaller.writeObject(locator.getBeanName()); marshaller.writeObject(locator); if (methodParams != null && methodParams.length > 0) { for (final Object methodParam : methodParams) { try { marshaller.writeObject(methodParam); } catch (IOException e) { throw log.ejbClientInvocationParamsException(e); } } } this.writeAttachments(marshaller, invocationContext); marshaller.finish(); }