final JNDIResponse res = new JNDIResponse();
res.setRequest(req);
try {
req.setMetaData(metaData);
req.readExternal(in);
} catch (final Throwable e) {
res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
final NamingException namingException = new NamingException("Could not read jndi request");
namingException.setRootCause(e);
res.setResult(new ThrowableArtifact(namingException));