You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ds...@apache.org on 2007/07/27 00:15:15 UTC
svn commit: r560018 -
/webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java
Author: dsosnoski
Date: Thu Jul 26 15:15:14 2007
New Revision: 560018
URL: http://svn.apache.org/viewvc?view=rev&rev=560018
Log:
Improve exception handling to pass root cause message
Modified:
webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java
Modified: webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java?view=diff&rev=560018&r1=560017&r2=560018
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java (original)
+++ webservices/axis2/branches/java/1_3/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java Thu Jul 26 15:15:14 2007
@@ -164,7 +164,12 @@
try {
if (marshallerIndex < 0) {
- ((IMarshallable)dataObject).marshal(ctx);
+ if (dataObject instanceof IMarshallable) {
+ ((IMarshallable)dataObject).marshal(ctx);
+ } else {
+ throw new IllegalStateException("Object of class " + dataObject.getClass().getName() +
+ " needs a JiBX <mapping> to be marshalled");
+ }
} else {
IXMLWriter wrtr = ctx.getXmlWriter();
String name = elementName;
@@ -195,7 +200,7 @@
ctx.getXmlWriter().flush();
} catch (IOException e) {
- throw new JiBXException("Error marshalling XML representation", e);
+ throw new JiBXException("Error marshalling XML representation: " + e.getMessage(), e);
}
}
@@ -211,7 +216,7 @@
marshal(true, ctx);
} catch (JiBXException e) {
- throw new XMLStreamException("Error in JiBX marshalling", e);
+ throw new XMLStreamException("Error in JiBX marshalling: " + e.getMessage(), e);
}
}
@@ -227,7 +232,7 @@
marshal(true, ctx);
} catch (JiBXException e) {
- throw new XMLStreamException("Error in JiBX marshalling", e);
+ throw new XMLStreamException("Error in JiBX marshalling: " + e.getMessage(), e);
}
}
@@ -262,7 +267,7 @@
marshal(full, ctx);
} catch (JiBXException e) {
- throw new XMLStreamException("Error in JiBX marshalling", e);
+ throw new XMLStreamException("Error in JiBX marshalling: " + e.getMessage(), e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org