Search in sources :

Example 1 with PdxConfigurationException

use of org.apache.geode.pdx.PdxConfigurationException in project geode by apache.

the class GatewayReceiverCommand method writeFatalException.

private static void writeFatalException(Message origMsg, Throwable exception, ServerConnection servConn, int batchId) throws IOException {
    Message errorMsg = servConn.getErrorResponseMessage();
    errorMsg.setMessageType(MessageType.EXCEPTION);
    errorMsg.setNumberOfParts(2);
    errorMsg.setTransactionId(origMsg.getTransactionId());
    // they can deserialize.
    if ((servConn.getClientVersion() == null || servConn.getClientVersion().compareTo(Version.GFE_80) < 0) && exception instanceof PdxRegistryMismatchException) {
        PdxConfigurationException newException = new PdxConfigurationException(exception.getMessage());
        newException.setStackTrace(exception.getStackTrace());
        exception = newException;
    }
    errorMsg.addObjPart(exception);
    // errorMsg.addStringPart(be.toString());
    errorMsg.send(servConn);
    logger.warn(LocalizedMessage.create(LocalizedStrings.ProcessBatch_0_WROTE_BATCH_EXCEPTION, servConn.getName()), exception);
}
Also used : Message(org.apache.geode.internal.cache.tier.sockets.Message) LocalizedMessage(org.apache.geode.internal.logging.log4j.LocalizedMessage) PdxRegistryMismatchException(org.apache.geode.pdx.PdxRegistryMismatchException) PdxConfigurationException(org.apache.geode.pdx.PdxConfigurationException)

Aggregations

Message (org.apache.geode.internal.cache.tier.sockets.Message)1 LocalizedMessage (org.apache.geode.internal.logging.log4j.LocalizedMessage)1 PdxConfigurationException (org.apache.geode.pdx.PdxConfigurationException)1 PdxRegistryMismatchException (org.apache.geode.pdx.PdxRegistryMismatchException)1