Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004027 [Hessian] major always 05-05-10 00:12 05-05-10 00:12
Reporter halid View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.0.3
Summary 0004027: Client gets RemoteException instead of BusinessException
Description Description:

Our service on the server site throws a declared BusinessException. Hessian Skeleton on the server site does not correct serialize the exception and we get a RemoteAccessException on the client site instead of BusinessException.

Possible Fix
Root of the problem seems to be a bug in following code-snippet inside of HessianSkeleton:
297 try {
298 result = method.invoke(service, values);
299 } catch (Exception e) {
300 Throwable e1 = e;
301 if (e1 instanceof InvocationTargetException)
302 e1 = ((InvocationTargetException) e).getTargetException();
304 log.log(Level.FINE, this + " " + e1.toString(), e1);
306 out.writeFault("ServiceException", e.getMessage(), e);
307 out.close();
308 return;
309 }

In the line 301 is an InvocationTargetException (e) detected and in the following line is the target exception (exception throwed by service) extracted and assigned to the variable e1.
But in the line 306 (out.writeFault....) the InvocationTargetException (e) will be serialized instead of extracted BusinessException (e1).
We fixed the issue by replacing the variable e with the variable e in this line:

out.writeFault("ServiceException", e.getMessage(), e);
Additional Information Java Runtime: Sun jdk1.5.0_16
OS: Windows XP
Hessian: 4.0.3
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
05-05-10 00:12 halid New Issue

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
26 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker