Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.2.7
-
None
-
openSuse 10, Eclipse 3.5.1
-
Novice
Description
PrettyPrintXMLStreamWriter
If you call the method writeStartElement(String localname) it calls writeStartElement(String prefix, String localName, String namespaceURI) with the wrong parameters.
writeStartElement(String localname, String namespaceURI) is affected as well (namespaceUri and localname are interchanged).
Instead of writeStartElement(null, localname, null) it calls writeStartElement(null, null, localname). So localname is used as namespaceURI and localname is NULL.
This leads to an Exception :
java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
at javax.xml.namespace.QName.<init>(QName.java:214)
at javax.xml.namespace.QName.<init>(QName.java:163)
at org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:231)
at org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:220)
Workaround :
Overwrite writeStartElement(String localname)
writeStartElement(String localname) {
writeStartElement(null, localname, null);
}