From: Thomas D. <tho...@jb...> - 2005-07-21 16:39:57
|
User: tdiesler Date: 05/07/21 12:38:56 Modified: src/main/org/jboss/xb/binding MappingObjectModelProvider.java Log: More debugging. Be strict on marshalling failures. Revision Changes Path 1.6 +13 -3 jboss-common/src/main/org/jboss/xb/binding/MappingObjectModelProvider.java (In the diff below, changes in quantity of whitespace are not shown.) Index: MappingObjectModelProvider.java =================================================================== RCS file: /cvsroot/jboss/jboss-common/src/main/org/jboss/xb/binding/MappingObjectModelProvider.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- MappingObjectModelProvider.java 21 Jul 2005 14:58:56 -0000 1.5 +++ MappingObjectModelProvider.java 21 Jul 2005 16:38:56 -0000 1.6 @@ -16,7 +16,7 @@ /** * @author <a href="mailto:al...@jb...">Alexey Loubyansky</a> - * @version <tt>$Revision: 1.5 $</tt> + * @version <tt>$Revision: 1.6 $</tt> */ public class MappingObjectModelProvider implements GenericObjectModelProvider @@ -175,14 +175,24 @@ { value = getter.invoke(o, null); } - else if(field != null && (!forComplexType || forComplexType && !writeAsValue(field.getType()))) + } + catch(Exception e) + { + log.error("Cannot invoke getter '" + getter + "' on object: " + o); + throw new IllegalStateException("Failed to provide value for " + localName + " from " + o, e); + } + + try + { + if(field != null && (!forComplexType || forComplexType && !writeAsValue(field.getType()))) { value = field.get(o); } } catch(Exception e) { - log.error("Failed to provide value for " + localName + " from " + o, e); + log.error("Cannot invoke field '" + field + "' on object: " + o); + throw new IllegalStateException("Failed to provide value for " + localName + " from " + o, e); } if(value != null && mapping != null && mapping.converter != null) |