Class ThrowableMapper


  • public final class ThrowableMapper
    extends Object
    Maps a Throwable to another one in order to avoid the transfer of non-standard (proprietary) Exception types, which could result in ClassNotFoundException on remote clients.

    Any Throwable which either is, or contains, a Throwable which is not in the allowed packages is converted.

    • Constructor Detail

      • ThrowableMapper

        public ThrowableMapper​(Throwable t)
    • Method Detail

      • map

        public Throwable map()
        Map the original Throwable to one that is non-proprietary (standard). Possible results include java.lang.Exception, java.lang.RuntimeException, java.lang.Error. The original stack trace and exception chain is preserved, each element in that chain being mapped if necessary.
        Returns:
        a Throwable which uses only standard classes