From cfbc5224e3c89aaed4243ac249618def82e6e3cc Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 4 Mar 2010 22:22:47 +0000 Subject: [PATCH] fixed exception propagation issue with Hessian 4.0 (SPR-6899) --- .../remoting/caucho/HessianClientInterceptor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.springframework.web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java b/org.springframework.web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java index c2fc4b282e..712f4bbce0 100644 --- a/org.springframework.web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java +++ b/org.springframework.web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -223,6 +223,10 @@ public class HessianClientInterceptor extends UrlBasedRemoteAccessor implements } catch (InvocationTargetException ex) { Throwable targetEx = ex.getTargetException(); + // Hessian 4.0 check: another layer of InvocationTargetException. + if (targetEx instanceof InvocationTargetException) { + targetEx = ((InvocationTargetException) targetEx).getTargetException(); + } if (targetEx instanceof HessianConnectionException) { throw convertHessianAccessException(targetEx); }