History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-972
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mika Goeckel
Reporter: Mika Goeckel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

StaxSerializer improper handling of empty namespace

Created: 30/Apr/07 09:26 AM   Updated: 30/Apr/07 09:42 AM
Component/s: Core
Affects Version/s: 1.2.5
Fix Version/s: 1.2.6

Time Tracking:
Not Specified

Environment: Weblogic 9.2


 Description  « Hide
Bea's stax implementation throws an IllegalArgumentException if XMLStreamWriter.getPrefix is called with null or "" (EMPTY_STRING) argument as URI.
This can be reproduced with the CustomXFireFaultTest using -Djavax.xml.stream.XMLInputFactory=weblogic.xml.stax.XMLStreamInputFactory and having weblogic.jar on the classpath of the JUnit test.

The quick workaround is to test for empty namespace url and assume an empty prefix (I'm not sure if this applies to all situations.)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Mika Goeckel - 30/Apr/07 09:42 AM
Checked in Revision 2153:

Index: StaxSerializer.java
===================================================================
— StaxSerializer.java (revision 1673)
+++ StaxSerializer.java (revision 2153)
@@ -41,7 +41,12 @@
String elPrefix = e.getNamespacePrefix();
String elUri = e.getNamespaceURI();

  • String boundPrefix = writer.getPrefix(elUri);
    + // XFIRE-972
    + String boundPrefix = elPrefix;
    + if(elUri != null && !"".equals(elUri)){ + boundPrefix = writer.getPrefix(elUri); + }
    +
    boolean writeElementNS = false;
    if (boundPrefix == null || !elPrefix.equals(boundPrefix))
    {