Hi all,
Observed this with ESB 4.8.1. As per my scenario the spring mediator loads
the bean successful and afterwards there was an error occurred in the java
class file which is loaded by the spring mediator. (for e.g.
ClassCastException)
However as per this code from SpringMediator.java below, ESB still catches
that error by logging 'no bean name defined' where the actual error happens
in in 'return m.mediate(synCtx);' line.
try{
Object o = appContext.getBean(beanName);
if (o != null && Mediator.class.isAssignableFrom(o.getClass())) {
Mediator m = (Mediator) o;
if (synLog.isTraceOrDebugEnabled())
{ synLog.traceOrDebug("Loaded mediator from bean : " + beanName + "
executing..."); }
*return m.mediate(synCtx);*
} else {
if (synLog.isTraceOrDebugEnabled())
{ synLog.traceOrDebug("Unable to load mediator from bean : " + beanName); }
handleException("Could not load bean named : " + beanName +
" from the Spring configuration with key : " + configKey, synCtx);
}
}* catch (Exception e) *
* { handleException("No bean named '"+beanName+"' is defined", synCtx); } *
Hence if there is no proper error handling done in the java class file it
is possible that actual error will be getting hidden due to this code.
I created [1] for this. Please fix this for an upcoming release.
Thanks!
Ishara
[1] https://wso2.org/jira/browse/ESBJAVA-3291
--
Ishara Premasada
Software Engineer,
WSO2 Inc. http://wso2.com/
*Blog : http://isharapremadasa.blogspot.com/
<http://isharapremadasa.blogspot.com/>Twitter :
https://twitter.com/ishadil <https://twitter.com/ishadil>Mobile : +94
714445832*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev