Hi,

IndirectionHandler invokes the target method (after materializing). However,
if the target method throws an exception it is wrapped by
PersistenceBrokerException no matter what (not just for materialization
issues)!

The code looks like:

Method m = subject.getClass().getMethod(method.getName(),
method.getParameterTypes());
return m.invoke(subject, args);

while there's an outer catch:

catch (Exception e) { 
        log.error("Method invoking failed for method *"+method.getName()+ "*
on object "+subject, e); 
        throw new PersistenceBrokerException("Error
invoking:"+method.getName(),e); 
} 

The correct code should add something like:

try {
        return m.invoke(subject, args);
} catch (InvocationTargetException e) {
        throw e.getTargetException();
}

Currently the proxy isn't useful for any class that requires checked
exception - it simply overrides it with PersistenceBrokerException!

Tal

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to