You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Grzegorz Oledzki (JIRA)" <ji...@apache.org> on 2007/08/13 16:33:32 UTC

[jira] Created: (CXF-908) "XMLStreamException: No open start element..." using JaxB

"XMLStreamException: No open start element..." using JaxB
---------------------------------------------------------

                 Key: CXF-908
                 URL: https://issues.apache.org/jira/browse/CXF-908
             Project: CXF
          Issue Type: Bug
         Environment: Application on Jboss-4.2.1.GA, JRockit R27.2.0 jre 1.5.0_10. 
            Reporter: Grzegorz Oledzki


When writing a service which implements only one method: 
public Set<Address> getAddresses(String par);

we get on the server-side an 
org.codehaus.xfire.fault.XFireFault: Couldn't write message.

caused by:
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 [...here comes the list of expected elements]
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: 
cwriter = writer;

Then after writing the object the writer is closed by:

cwriter.close();

which refers to:

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.
Or... If not there, then maybe the ArrayType#writeValue()?



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-908) "XMLStreamException: No open start element..." using JaxB

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-908.
-----------------------------

       Resolution: Invalid
    Fix Version/s: Invalid


Marking invalid as this is an XFire issue, not CXF.

> "XMLStreamException: No open start element..." using JaxB
> ---------------------------------------------------------
>
>                 Key: CXF-908
>                 URL: https://issues.apache.org/jira/browse/CXF-908
>             Project: CXF
>          Issue Type: Bug
>         Environment: Application on Jboss-4.2.1.GA, JRockit R27.2.0 jre 1.5.0_10. 
>            Reporter: Grzegorz Oledzki
>             Fix For: Invalid
>
>
> When writing a service which implements only one method: 
> public Set<Address> getAddresses(String par);
> we get on the server-side an 
> org.codehaus.xfire.fault.XFireFault: Couldn't write message.
> caused by:
> 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 [...here comes the list of expected elements]
> 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: 
> cwriter = writer;
> Then after writing the object the writer is closed by:
> cwriter.close();
> which refers to:
> 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.
> Or... If not there, then maybe the ArrayType#writeValue()?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-908) "XMLStreamException: No open start element..." using JaxB

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520412 ] 

Glen Mazza commented on CXF-908:
--------------------------------

Are you using Apache CXF or Codehaus XFire?  This issue tracker is for the former.

> "XMLStreamException: No open start element..." using JaxB
> ---------------------------------------------------------
>
>                 Key: CXF-908
>                 URL: https://issues.apache.org/jira/browse/CXF-908
>             Project: CXF
>          Issue Type: Bug
>         Environment: Application on Jboss-4.2.1.GA, JRockit R27.2.0 jre 1.5.0_10. 
>            Reporter: Grzegorz Oledzki
>
> When writing a service which implements only one method: 
> public Set<Address> getAddresses(String par);
> we get on the server-side an 
> org.codehaus.xfire.fault.XFireFault: Couldn't write message.
> caused by:
> 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 [...here comes the list of expected elements]
> 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: 
> cwriter = writer;
> Then after writing the object the writer is closed by:
> cwriter.close();
> which refers to:
> 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.
> Or... If not there, then maybe the ArrayType#writeValue()?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.