"XMLStreamException: No open start element..." using JaxB
---------------------------------------------------------
Key: XFIRE-1077
URL: http://jira.codehaus.org/browse/XFIRE-1077
Project: XFire
Issue Type: Bug
Components: Aegis Module
Affects Versions: 1.2.6
Environment: Application on Jboss-4.2.1.GA, JRockit R27.2.0 jre
1.5.0_10.
Reporter: Grzegorz Oledzki
Assignee: Dan Diephouse
When writing a service which implements only one method:
bq. public Set<Address> getAddresses(String par);
we get on the server-side an
bq. org.codehaus.xfire.fault.XFireFault: Couldn't write message.
caused by:
bq. javax.xml.stream.XMLStreamException: No open start element, when trying to
write end element
Client failes with the message:
org.codehaus.xfire.fault.XFireFault: Could not unmarshall type : unexpected
element (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Envelope").
Expected elements are
<{http://syncron.com/bpp}address>,<{http://syncron.com/bpp}companyEntry>,<{http://syncron.com/bpp}extendSetWrapper>,<{http://syncron.com/bpp}setWrapper>
at org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:219)
[...]
After debugging the XFire under Eclipse I discovered that:
- the problem is caused by too many writeEndElement() compared to
writeStartElement(),
- the error has to been somewhere in the area constrained by these calls:
AegisBindingProvider:220 # writeParameter() creates an ElementWriter with
constructor NOT writing the start element,
CollectionType # writeObject() is called
ArrayType:279 # writeValue() is called
Since type is JaxbType this line is called:
bq. cwriter = writer;
Then after writing the object the writer is closed by:
bq. cwriter.close();
which refers to:
bq. ElementWriter:176 # close()
which writes the end-element (but there has been no start element written
before, so it closes its parent)
My guess is that the ElementWriter#close() implementation should be changed. So
that the end element is written only if the start element was written before.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email