Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.6
-
All Environments
-
Unknown
Description
Dan,
Thanks again for writing the databinding components for JiBX.
Unfortunately, the JAX-RS component calls empty methods when I try to use this databinding component.
This seems to fix the problem:
---start patch
Index: rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataWriter.java
===================================================================
— rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataWriter.java (revision 1327050)
+++ rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataWriter.java (working copy)
@@ -40,6 +40,15 @@
public class JibxDataWriter implements DataWriter<XMLStreamWriter> {
public void write(Object obj, XMLStreamWriter output) {
+ try
catch (Exception e)
{ + throw new RuntimeException(e); + }}
public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) { Index: rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataReader.java =================================================================== --- rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataReader.java (revision 1327050) +++ rt/databinding/jibx/src/main/java/org/apache/cxf/jibx/JibxDataReader.java (working copy) @@ -62,7 +62,12 @@ }
public Object read(QName elementQName, XMLStreamReader input, Class<?> type) {
- throw new UnsupportedOperationException("Not Implemented");
+ try { + UnmarshallingContext ctx = getUnmarshallingContext(input, type); + return ctx.unmarshalElement(type); + } catch (JiBXException e) {+ throw new RuntimeException(e);+ }
}
public void setAttachments(Collection<Attachment> attachments) {
— end patch
I have a sample project at if you want to see a working configuration:
https://github.com/jibx/maven-plugin/tree/master/examples/cxf-jaxrs
Remember to shutdown karaf after install, before start to avoid a karaf wiring bug.
Thanks!
Don