View Full Version : Java bug in HessianSkeleton.invoke()

02-22-2010, 02:09 PM
While looking at the source for 4.0.3, i noticed line 306 of HessianSkeleton. In the catch block after method.invoke(...), it appears that the author intended to unwrap the target of InvocationTargetException and write it out as the returned fault. However, the unwrapped exception is always returned instead.

try {
result = method.invoke(service, values);
} catch (Exception e) {
Throwable e1 = e;
if (e1 instanceof InvocationTargetException)
e1 = ((InvocationTargetException) e).getTargetException();

log.log(Level.FINE, this + " " + e1.toString(), e1);

out.writeFault("ServiceException", e.getMessage(), e);