title: Convert Spring Security AccessDeniedException ( with GWT )
body: <p>I'm using Google Web Toolkit and securing the server with spring security. I want to use the @PreAuthorize - annotation in my business object methods. </p>
  
  <p>The problem here is, that the AccessDeniedException ( which is thrown if the user is not authorized to call this method ) is not Serializable by GWT. So i need to implement an additional try-catch in every RPC service method which calls the BO method transform the Exception by hand. I really want to avoid this additional try-catch!</p>
  
  <p>Some more explanation:</p>
  
  <p>BO ( secured with @PreAuthorize ) &lt;&lt; is called by >> GWT RPC which need an additional try-catch to transform the exception.</p>
  
  <p>All i've found is the mapper to map specific exceptions to specific pages but none information on how i can transform the exception to another one ( or provide my own implementation to throw my custom exception ).</p>
  
  <p>I hope i could describe my problem in a way you guys can understand it.</p>
  
  <p>I found this thread:</p>
  
  <p><a href="http://forum.springsource.org/showthread.php?85937-Method-Security-Throw-custom-exception-instead-of-AccessDeniedException" rel="nofollow">http://forum.springsource.org/showthread.php?85937-Method-Security-Throw-custom-exception-instead-of-AccessDeniedException</a></p>
  
  <p>But the AccessDecisionManager only throws the AccessDeniedException and i can't get some advice on how to customize it for my needs.</p>
  
  <p>Thanks in advance!</p>